Skip to content

Instantly share code, notes, and snippets.

View cuibonobo's full-sized avatar

Jen Garcia cuibonobo

View GitHub Profile
@cuibonobo
cuibonobo / rpi-backup.sh
Last active December 17, 2015 14:29
Raspberry Pi Backup
# Run DF and look for your SD Card
df -h
# Use the SD Card device name on the following lines
diskutil unmountDisk /dev/disk3
dd if=/dev/disk3 of=wheezy-backup.img bs=1m
diskutil eject /dev/disk3
@cuibonobo
cuibonobo / rename_img_seq.sh
Last active December 17, 2015 19:59
Terminal command to batch rename an image sequence from a movie to the format XXm_XXs_XX.png, assuming 4 fps and .png filename
count=0; for i in *.png; do let countmin=$count/240; let countsec=$count-240\*$countmin; mv $i $(printf '%02dm_%02ds_%02dm'.png $countmin $(( $countsec / 4 )) $(( $count % 4 ))); (( count++ )); done
@cuibonobo
cuibonobo / \etc\network\interfaces
Created May 30, 2013 01:19
How to get my Raspberry Pi working on my local network with a static IP address
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.0.17
netmask 255.255.255.0
gateway 192.168.0.1
network 192.168.0.0
broadcast 192.168.0.255
@cuibonobo
cuibonobo / \boot\cmdline.txt
Created May 30, 2013 03:28
To use bootchart on the Raspberry Pi, `sudo apt-get install bootchart bootchart-view` and then add `init=/sbin/bootchartd` to the end of `/boot/cmdline.txt`
dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootflags=commit=120,data=writeback elevator=deadline rootwait quiet init=/sbin/bootchartd
@cuibonobo
cuibonobo / \etc\sysctl.conf
Created May 30, 2013 04:21
Supposedly these values in `/etc/sysctl.conf` will make booting snappier. I don't have hard before/after times to confirm this though.
vm.dirty_background_ratio = 20
vm.dirty_expire_centisecs = 0
vm.dirty_ratio = 80
vm.dirty_writeback_centisecs = 1200
vm.overcommit_ratio = 2
vm.laptop_mode = 5
vm.swappiness = 10
@cuibonobo
cuibonobo / twitter-trends.md
Created June 2, 2013 19:40
Twitter Trends
@cuibonobo
cuibonobo / .bash_profile
Created June 5, 2013 20:50
Get the Terminal to display color-coded information about files and change the format/color of the prompt. This also aliases cd so that you get the contents of a directory whenever you cd into it.
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
# ------------Color Aliases ---------------
BLACK="0;30"
GREEN="0;32"
CYAN="0;36"
RED="0;31"
PURPLE="0;35"
BROWN="0;33"
@cuibonobo
cuibonobo / downloadphotosfromcameraandsort.py
Created July 12, 2013 15:23
Download photos from a digital camera and sort them into directories. (Found here: http://blog.markturansky.com/archives/20)
"""
DownloadAndSortPhotosFromCamera.py
(c) 2004 Mark Gregory Turansky (http://www.markturansky.com)
This program will download pictures from your digital camera and store them
in dated directories for long term archiving. Feel free to alter the behavior
of the script to suit your needs.
This script will also REMOVE the pictures from your camera! Once downloaded
#!/usr/bin/env bash
mm=`date +%b`
dd=`date $1 +%d`
dd=`expr $dd`
if [ "$dd" -ge "10" ]
then
dt=`echo "$mm $dd"`
else
dt=`echo "$mm $dd"`
#!/bin/bash
alertme() {
say "Big brother watching"
# If you want a Growl notification:
# growlnotify --appIcon TextEdit "Big brother" -m 'watching'
}
while :