A list of my sources
General news list
#!/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 |
#!/usr/bin/env bash | |
set -euo pipefail | |
CFG="/boot/grub/grub.cfg" | |
# 1) Read every top‑level menuentry title (handles leading whitespace & both quote styles) | |
mapfile -t ENTRIES < <( | |
grep -E "^[[:space:]]*menuentry [\"'].*[\"']" "$CFG" \ | |
| sed -E "s/^[[:space:]]*menuentry [\"']([^\"']+)[\"'].*/\1/" | |
) |
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 |
# Make Ubuntu use local time (Fix Windows 10 dual boot different time issue) | |
timedatectl set-local-rtc 1 --adjust-system-clock | |
# Check current settings | |
timedatectl | |
# Install packages | |
sudo apt update | |
sudo apt upgrade -y | |
sudo apt install emacs vim curl wget git build-essential -y |
# 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) |
#!/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%.*}" |
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; | |
}; |
#!/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", "")) |
# You need jq and curl installed: | |
# sudo apt install jq curl -y | |
#!/bin/bash | |
# CHANGE THESE | |
auth_email="[email protected]" | |
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # find in cloudflare account settings | |
zone_identifier="023e105f4ecef8ad9ca31a8372d0c353" # get zone ID via API | |
# Get zone ID |