This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| from sense_hat import SenseHat | |
| import os | |
| def get_cpu_temp(): | |
| res = os.popen('vcgencmd measure_temp').readline() | |
| return float(res.replace("temp=", "").replace("'C\n", "")) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const crossConcatReducer = (acc, cur, idx) => { | |
| const gap = idx + 1; | |
| cur.forEach((element, i) => { | |
| const indexToInsert = (i + 1) * gap - 1; | |
| acc.splice(indexToInsert, 0, element); | |
| }); | |
| return acc; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| FILEPATH="" | |
| for arg in $@ | |
| do | |
| FILEPATH="${FILEPATH}${arg}" | |
| if [[ -f $FILEPATH ]]; then | |
| echo "Converting $FILEPATH to mp4" | |
| FILENAME_W_EXTENSION=$(basename "$FILEPATH") | |
| FILENAME="${FILENAME_W_EXTENSION%.*}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # WIP | |
| # The script is compatible with Canonical Ubuntu (Always Free Eligible) Minimal | |
| sudo apt update | |
| sudo apt install wireguard | |
| # ifconfig to check your interfae | |
| # for Ubuntu 20.04 Minimal 2021.03.25-0 it's ens3 | |
| # Generate keys (WIP) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| set -o pipefail | |
| # Install 1Password password manager | |
| sudo apt update && sudo apt install 1password -y | |
| # Install vanilla GNOME desktop environment (without Ubuntu modifications) | |
| sudo apt purge pipewire-alsa pipewire-audio -y | |
| sudo apt install vanilla-gnome-desktop vanilla-gnome-default-settings -y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rem to disable private dns | |
| adb shell settings put global private_dns_mode off | |
| rem to enable private dns with hostname (example with dns.adguard.com) | |
| adb shell settings put global private_dns_mode hostname | |
| adb shell settings put global private_dns_specifier dns.adguard.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # Check if running as root, if not, re-run with sudo | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "This script needs to read grub.cfg and modify boot settings." | |
| echo "Re-running with sudo..." | |
| exec sudo "$0" "$@" | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # 1) Install acpid if missing | |
| if ! dpkg -s acpid >/dev/null 2>&1; then | |
| apt-get update | |
| DEBIAN_FRONTEND=noninteractive apt-get install -y acpid | |
| fi | |
| # 2) Enable/start it if needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # ----------------------------------------------------------------------------- | |
| # cleanup-emacs-backups.sh | |
| # | |
| # Recursively find and delete all Emacs backup files (ending in '~') in | |
| # the given directory (defaults to current directory). | |
| # | |
| # Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Configures Windows to interpret the hardware clock (RTC) as Coordinated Universal Time (UTC). | |
| .DESCRIPTION | |
| This script adds or updates the 'RealTimeIsUniversal' DWORD value in the Windows Registry | |
| at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation. | |
| Setting this value to 1 tells Windows to treat the hardware clock as UTC, | |
| aligning its behavior with most Linux distributions (like Ubuntu) and resolving | |
| time discrepancies in dual-boot environments. |