Skip to content

Instantly share code, notes, and snippets.

// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+\\",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "ctrl+b",
"command": "-workbench.action.toggleSidebarVisibility"
},
@Zetaphor
Zetaphor / airdots.sh
Created October 16, 2019 19:42
Automatically reconnect bluetooth headphones
#!/bin/bash
##### CONFIGURATION #####
MAC="E8:EC:A3:30:0C:62"
MODE="connect"
#########################
STATUS=$(bluetoothctl info $MAC | grep "Connected" | awk '{print $2}')
@Zetaphor
Zetaphor / test.json
Last active September 22, 2021 23:22
{
"MRData": {
"xmlns": "http:\/\/ergast.com\/mrd\/1.4",
"series": "f1",
"url": "http://ergast.com/api/f1/2018/circuits.json",
"limit": "30",
"offset": "0",
"total": "21",
"CircuitTable": {
"season": "2018",
@Zetaphor
Zetaphor / bash-sensors.sh
Last active October 29, 2021 21:21
Bash Sensors
echo 🌡 AMD: `sensors | grep 'edge:' | cut -c 16-18 | rev | cut -c 2-100 | rev`°C
echo 🌡 NVIDIA: `nvidia-smi -q -d temperature | grep 'GPU Current Temp' | cut -c 45-47 | xargs`°C
echo 🌡 2TB: `sensors | grep 'Composite:' | sed -n '1p' | cut -c 16-18 | rev | cut -c 2-10 | rev`°C
echo 🌡 1TB: `sensors | grep 'Composite:' | sed -n '2p' | cut -c 16-18 | rev | cut -c 2-10 | rev`°C
echo ⌬ CPU: `top -bn1 | sed -n '/Cpu/p' | awk '{print $2}' `%
echo ⌧ RAM `free -m | awk 'NR==2{printf "%.2fGB (%.2f%%)\n", $3/1024,$3*100/$2 }'`
echo 🌡 CPU `cat /sys/class/thermal/thermal_zone0/temp | sed 's/.\{3\}$/.&/' | rev | cut -c 5-10 | rev`°C
echo ֎ FAN: `sensors | grep cpu_fan | cut -c 17-100 | rev | cut -c 5-100 | rev | xargs`RPM
@Zetaphor
Zetaphor / keychron_linux.md
Created July 11, 2022 21:31 — forked from andrebrait/keychron_linux.md
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work

Keychron Keyboards on Linux use the hid_apple driver (even in Windows/Android mode), both in Bluetooth and Wired modes. By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn + the key to get the usual F1 through F12 keys.

@Zetaphor
Zetaphor / docker-selenium.sh
Last active November 15, 2023 03:05
Music download automation
docker pull selenium/standalone-chrome
docker run -d -p 4444:4444 --shm-size=2g selenium/standalone-chrome
@Zetaphor
Zetaphor / markov_chain.py
Created February 17, 2024 07:11
ChatGPT authored Markov Chain in Python
"""
Read a collection of JSON files from a directory as the inputs to a Markov Chain.
Also adds the user inputs to the dictionary as the conversation progresses.
Assumes it's using the formatted data from the NeoLLaMder project.
Written by ChatGPT
"""
import json
import random
import re