Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ryanzabcik on github.
  • I am ryanz (https://keybase.io/ryanz) on keybase.
  • I have a public key whose fingerprint is 0F53 72D5 17D1 08CA 08A9 ABD0 9BE2 668A 86F2 AB77

To claim this, I am signing this object:

@ryanzabcik
ryanzabcik / fb.css
Created March 29, 2014 00:04
Facebook stylesheet for a white background
._5vb_, ._5vb_ #contentCol {
background-color: white;
}
if [ $EUID != 0 ]; then
echo "It's a weird tree."
else
echo ' _ __'
echo ' / `\ (~._ ./ )'
echo ' \__/ __`-_\__/ ./'
echo ' _ \ \/ \ \ |_ __'
echo ' ( ) \__/ -^ \ / \'
echo ' \_/ " \ | o o |.. / __'
echo " \\. --' ==== / || / \\ "
@ryanzabcik
ryanzabcik / weekly-backup
Created October 22, 2013 04:38
This is the backup script designed to run every week on tachyon.
#!/bin/sh
if [ ! $UID = 0 ]; then
echo -e '\e[31merror: this script needs to be run as root'
exit 1
else
# echo each command before executing to show progress
set -o xtrace
dd if=/dev/disk/by-label/win8 | gzip -c > /mnt/data0/Backup/win8.ntfs.gz
umount /mnt/arch-backup
dd if=/dev/disk/by-label/arch-backup | gzip -c > /mnt/data0/Backup/arch-backup.ext4.gz
@ryanzabcik
ryanzabcik / 6h-backup
Last active December 26, 2015 04:39
This is the backup script designed to run every 6 hours on tachyon.
#!/bin/sh
if [ $EUID != 0 ]; then
echo -e '\e[31mError: this script needs to be run as root'
exit 1
else
rsync -aHAX --delete-during --exclude={/lost+found,/var/lib/docker} /mnt/root/ /mnt/arch-backup
if mount | grep -q /mnt/data0-backup; then
if [ -d /mnt/data0-backup/ToMove ]; then
echo -e '\e[31mWarning: there are files to move from data0-backup/ToMove. This directory will be copied to data0.'
cp -rp /mnt/data0-backup/ToMove /mnt/data0/ToMove
@ryanzabcik
ryanzabcik / cudaminer-reset
Last active December 26, 2015 04:39
This script runs cudaminer only if the main display :0 is off. Uses polling every ~10 seconds.
#!/bin/sh
export DISPLAY=:0
while true; do
# check to see if cudaminer is still alive, (possibly stopped)
if pgrep cudaminer; then
#if the monitor is on
if xset -q | grep -q 'Monitor is On'; then
pkill -STP cudaminer
else