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 / crontab
Created February 13, 2014 11:43
xkcd crontab
* * * * * DISPLAY=:0 /usr/bin/bash /home/benkaiser/.i3/update_background
@benkaiser
benkaiser / .conkyrc
Last active November 20, 2016 20:54
My conkyrc file. Mainly defaults except for colors and my added xkcd title text viewer
# Conky, a system monitor, based on torsmo
#
# Any original torsmo code is licensed under the BSD license
#
# All code written since the fork of torsmo is licensed under the GPL
#
# Please see COPYING for details
#
# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
# Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
@benkaiser
benkaiser / config
Created February 5, 2014 11:59
Scripts to get i3 dynamic tagging working
# Just add the following lines to your i3 config file
# dynamic tagging feature
bindsym $mod+t exec ~/.i3/get_workspace_options.py | dmenu -b | ~/.i3/go_to_workspace.py
bindsym $mod+Shift+t exec ~/.i3/get_workspace_options.py | dmenu -b | ~/.i3/move_to_workspace.py
@benkaiser
benkaiser / xkcd.py
Last active November 26, 2015 10:35
#!/usr/bin/env python
# xkcd.py
#
# Copyright 2012 Benjamin Kaiser <benkaiser@benkaiser>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@benkaiser
benkaiser / my_marble.py
Created December 29, 2013 18:22
Marble Python Hello World example
from PyQt4.QtGui import *
from PyKDE4.marble import *
import sys
def main():
# Initialize QApplication
app = QApplication(sys.argv)
# Create a Marble QWidget
m = Marble.MarbleWidget()
@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
@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 / 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 / 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 / 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))