Skip to content

Instantly share code, notes, and snippets.

Avatar
💽
fuck the new github UI

Dominika Liberda sdomi

💽
fuck the new github UI
View GitHub Profile
View internetShare.md

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 uncool ip:

# ip addr add 192.168.250.1 dev eth0
@sdomi
sdomi / gist:be43a82b5fb1d5a61d57194fbe842ba8
Created Jul 25, 2019
4chan image dumper w/ following links
View gist:be43a82b5fb1d5a61d57194fbe842ba8
#!/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 / patcher.sh
Created Oct 17, 2018
Automatic XPI version patcher
View patcher.sh
#!/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 / tablet.sh
Created May 27, 2018
Fujitsu LifeBook P1610 run-before-touchscreen-perl-driver commands. Yay!
View tablet.sh
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
View magictablet.sh
#!/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 / temps.sh
Created May 19, 2018
script for measuring raspberry pi's GPU and CPU temp (requires superuser for gpu)
View temps.sh
#!/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"
@sdomi
sdomi / isnetup
Created May 16, 2018
magic internet checker in bash
View isnetup
#!/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!"
View theme_greenish_mocp
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
You can’t perform that action at this time.