Skip to content

Instantly share code, notes, and snippets.

View sdomi's full-sized avatar
💽
I Hate The New New GitHub UI

Dominique Liberda sdomi

💽
I Hate The New New GitHub UI
View GitHub Profile
background = default default
frame = white default
window_title = white default
directory = cyan default bold
selected_directory = black green
playlist = white default bold
selected_playlist = black green
file = white default
selected_file = black green
marked_file = white default bold
@sdomi
sdomi / isnetup
Created May 16, 2018 15:48
magic internet checker in bash
#!/bin/bash
# has interweb come back up? know today with this one simple trick!
ip=$1;
if ! [[ $ip ]]; then
ip="8.8.8.8";
fi
while true; do
if ping -c 1 $ip &> /dev/null; then
notify-send --urgency=critical --icon=firefox "Internet is back up!"
@sdomi
sdomi / temps.sh
Created May 19, 2018 11:19
script for measuring raspberry pi's GPU and CPU temp (requires superuser for gpu)
#!/bin/bash
cpu=$(cat /sys/class/thermal/thermal_zone0/temp)
cpureal=$(echo $cpu | cut -c 1-2).$(echo $cpu | cut -c 3-6)\'C
gpu=$(vcgencmd measure_temp | cut -c 6-11)
echo "CPU: $cpureal | GPU: $gpu"
#!/bin/bash
xsetwacom --set "Wacom Bamboo Connect Pen stylus" MapToOutput 1280x1024+0+0
while true; do
sudo evtest --query /dev/input/event2 EV_KEY KEY_LEFTMETA
if [[ $? == 10 ]]; then
xdotool mousedown 1
else
xdotool mouseup 1
@sdomi
sdomi / tablet.sh
Created May 27, 2018 21:59
Fujitsu LifeBook P1610 run-before-touchscreen-perl-driver commands. Yay!
stty -F /dev/ttyS0 9600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
setserial /dev/ttyS0 port 0x0220 irq 4 autoconfig
@sdomi
sdomi / patcher.sh
Created October 17, 2018 20:08
Automatic XPI version patcher
#!/bin/bash
if [[ -f $1 ]]; then
echo "XPI Patcher by reds"
mkdir "$1_tmp"; cd "$1_tmp";
unzip ../$1
sed '/<em:targetApplication>$/,/<\/em:targetApplication/!{//!b};d' install.rdf | sed '/<\/Description>$/,/<\/\/RDF/!{//!b};d' > install_.rdf
echo "
<!-- Firefox -->
<em:targetApplication>
@sdomi
sdomi / gist:be43a82b5fb1d5a61d57194fbe842ba8
Created July 25, 2019 20:23
4chan image dumper w/ following links
#!/bin/python
from bs4 import BeautifulSoup
import urllib.request
import sys
import re
import os
arg = sys.argv[1]
opener = urllib.request.build_opener()
@sdomi
sdomi / internetShare.md
Last active March 2, 2024 18:15
farewell

Magical Linux internet sharing: The Tutorial

The following tutorial assumes that you want to provide the interwebs to a PC connected via eth0 to your host, and that your host is connected to the world via wlan0.

  1. Set up the local IP address
# ifconfig eth0 192.168.250.1

or, if you're using ip:

# ip a a 192.168.250.1/24 dev eth0