Skip to content

Instantly share code, notes, and snippets.

View benkaiser's full-sized avatar
🌊
Loving Life

Benjamin Kaiser benkaiser

🌊
Loving Life
View GitHub Profile
@benkaiser
benkaiser / wmiirc
Last active December 13, 2015 23:49
My wmiirc (WMII configuration file)
#!/bin/dash -f
# Configure wmii
wmiiscript=wmiirc # For wmii.sh
. wmii.sh
# Configuration Variables
MODKEY=Mod1
UP=k
DOWN=j
@benkaiser
benkaiser / how_to_ffmpeg_screencast.sh
Last active December 14, 2015 01:19
hi-res ffmpeg capture without lag
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -s <widthxheight> -i :0.0<+offsetx,offsety> -acodec pcm_s16le -vcodec libx264 -r 25 -preset ultrafast -crf 0 -threads 0 <filename>.mkv
@benkaiser
benkaiser / application.js
Created March 28, 2013 01:49
Check if variable was initialised from JSON file.
$(document).ready(function() {
if(data !== undefined){
// the data loaded just fine
loaded = true;
}
});
@benkaiser
benkaiser / .zshrc
Last active December 18, 2015 01:48
My zshrc as of 2013-06-04. Custom aliases for Ubuntu / Work with vim turned on also.
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt autocd
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/benkaiser/.zshrc'
@benkaiser
benkaiser / Packages
Last active December 18, 2015 14:19
My Arch Packages. To be moved to my new machine
abs
acpi
alsa-utils
arp-scan
autoconf
automake
baobab
bash
bison
btrfs-progs
@benkaiser
benkaiser / maths.py
Created August 27, 2013 11:06
Simple program I made for my brother to practice his multiplication and division.
#!/usr/bin/python
import random
def main():
num_correct = 0
num_incorrect = 0
while True:
num_1 = random.randint(0, 12)
num_2 = random.randint(1, 12)
is_mult = bool(random.getrandbits(1))
@benkaiser
benkaiser / fix_keyboard_backlight.sh
Last active December 23, 2015 00:19
Stored somewhere in the default PATH. e.g. /usr/bin/raise_key_backlight and /usr/bin/lower_key_backlight
#!/bin/sh
chmod 0777 /sys/class/leds/samsung::kbd_backlight/brightness
@benkaiser
benkaiser / clear_logs.sh
Created September 23, 2013 01:00
Clear debug logs android (they seem to build up on my device)
adb root
adb shell
cd data
rm -rf log/*
// DU
du -h -d=1
@benkaiser
benkaiser / rsync.sh
Created September 23, 2013 01:09
Rsync backup root folder to external drive
# command from archlinux wiki: https://wiki.archlinux.org/index.php/Full_System_Backup_with_rsync
sudo rsync -aAXh --progress --exclude /mnt/ --exclude /media/ --exclude /dev/ --exclude /proc/ --exclude /sys/ --exclude /tmp/ --exclude /run/ --exclude /lost+found/ --exclude /home/benkaiser/Copy --exclude /home/benkaiser/tmp /* /run/media/benkaiser/WD\ 2TB/rsync
@benkaiser
benkaiser / install
Last active September 24, 2018 21:35
Install Packer on new install (Arch Linux)
# install needed packages
pacman -S base-devel fakeroot jshon
# get the PKGBUILD for Packer
wget https://aur.archlinux.org/packages/pa/packer/PKGBUILD
# make the package
makepkg
# install it with pacman
pacman -U packer-*.pkg.tar.xz