Skip to content

Instantly share code, notes, and snippets.

View imabuddha's full-sized avatar
👨‍💻
Looking for work

John Mifsud imabuddha

👨‍💻
Looking for work
View GitHub Profile
From a post by John Fairbairn on GoDiscussions.com:
For most practical purposes the necessary information can be reduced to an algorithm which I think goes back to a paper by Karl-Heinz Lenz in the Deutsche Go-Zeiting in the early 80s. My version of it (at your own peril) is:
1. Choose Attacker (= player with advantage; side with bigger eye or, if equal side with more exclusive liberties) and defender; small eyes count as equal irrespective of size)
2. Get number of Shared liberties S
3. From S, get Fail number F
on adding folder items to this_folder after receiving added_items
tell application "Safari"
repeat with w in windows
if name of w is "Downloads" then
set isdocument to true
try
set d to document of w
set the result to d
on error
set isdocument to false
@imabuddha
imabuddha / Get pro go games
Created January 28, 2010 04:47
get new go games & rename files
#!/bin/bash
# great src url: http://igo-kisen.hp.infoseek.co.jp/topics.html
SGF_SRC_LISTUsers/adrian/Go/Games/TWIG/urls.txt
SCRATCH_DIRtmp/twig
DESTINATION_DIRUsers/adrian/Go/Games/TWIG
mkdir $SCRATCH_DIR
cd $SCRATCH_DIR
@imabuddha
imabuddha / stress — [Raspberry Pi]
Last active December 6, 2020 17:58
Short cpu stress & temp based on script used by https://www.youtube.com/c/explainingcomputers
#!/bin/bash
clear
for f in {1..7}
do
vcgencmd measure_temp
sysbench --test=cpu --cpu-max-prime=25000 --num-threads=4 run >/dev/null 2>&1
done
vcgencmd measure_temp
@imabuddha
imabuddha / long-stress — [Raspberry Pi]
Created December 6, 2020 17:59
Full day cpu & gpu stress test
#!/bin/bash
clear
glxgears &
echo running a full day, ctrl+c to quit
stress-ng --cpu 0 --cpu-method fft
@imabuddha
imabuddha / splatmoji — [Raspberry Pi]
Created December 6, 2020 18:23
GUI Emoji chooser popup
https://github.com/cspeterson/splatmoji
@imabuddha
imabuddha / shairpoint-sync-autostart — [Raspberry Pi]
Last active December 7, 2020 11:30
Run shairport-sync on login [create new file shairpoint-sync-autostart in /home/pi/.config/autostart]
[Desktop Entry]
Type=Application
Name=Shairport-sync autostart
Comment=must be run after login because of pulseaudio
NoDisplay=true
Exec=/usr/local/bin/shairport-sync
@imabuddha
imabuddha / setxkbmap-config-options.txt
Last active December 7, 2020 17:25 — forked from jatcwang/gist:ae3b7019f219b8cdc6798329108c9aee
List of all setxkbmap configuration options (including models/layout/etc)
! model
pc101 Generic 101-key PC
pc102 Generic 102-key (Intl) PC
pc104 Generic 104-key PC
pc105 Generic 105-key (Intl) PC
dell101 Dell 101-key PC
latitude Dell Latitude series laptop
dellm65 Dell Precision M65
everex Everex STEPnote
flexpro Keytronic FlexPro
@imabuddha
imabuddha / Natural Scrolling [Raspberry Pi].md
Last active December 8, 2020 08:28 — forked from eli9000/bookworm.md
Change your Raspberry Pi scrolling to Natural Scrolling (like iOS)

How to invert mouse wheel to NaturalScrolling in Linux for Raspberry Pi

Via the Terminal, type the following

cd /usr/share/X11/xorg.conf.d
sudo nano 40-libinput.conf

Add to following line to the BOTTOM of the FIRST Section "InputClass"

@imabuddha
imabuddha / .bashrc
Created December 9, 2020 06:14
Add this line to your ~/.bashrc file (probably at the end) to get the terminal app to use the system keychain. This will eliminate the need to enter your ssh passphrase if not using autologin && you've got ssh-agent configured.
export $(gnome-keyring-daemon --daemonize --start)