Skip to content

Instantly share code, notes, and snippets.

Avatar
🐛
Squashing bugs but sparing the cute ones!

Noah Doersing doersino

🐛
Squashing bugs but sparing the cute ones!
View GitHub Profile
@doersino
doersino / setvolume.sh
Created Sep 19, 2015
Sets the volume on a Mac.
View setvolume.sh
function setvolume() {
local USAGE
USAGE="usage: setvolume NUMBER_FROM_0_AND_7"
if [ -z "$1" ]; then
echo -e "$USAGE"; return 1
fi
osascript -e "set volume $1"
}
@doersino
doersino / backup_sync.sh
Last active Aug 29, 2015
Rsync wrapper with sanity checking for some of the most common use cases.
View backup_sync.sh
#!/bin/bash
# Performs an rsync with predefined flags, configurable default arguments, only
# the most important options (dry-run and excludes), and sanity checking.
#
# Usage:
# ./backup_sync.sh [-n] [-e EXCLUDE] [-f FLAGS] [-d] [SRC] [DEST]
#
# (If SRC or DEST are not given, the defaults will be used.)
#
@doersino
doersino / backup_gists.py
Last active Aug 29, 2015 — forked from statX/downloadGists.py
Clone or update a user's public gists. Usage: backup_gists.py USERNAME [DIR]
View backup_gists.py
#!/usr/bin/env python
# Clone or update a user's public gists.
# Usage: backup_gists.py USERNAME [DIR]
import json
from subprocess import call
from urllib import urlopen
import os
import sys
@doersino
doersino / webcam_dl.sh
Last active Aug 29, 2015
Downloads a webcam image, overlays the date/time, and compress past images into ZIP and MP4 format.
View webcam_dl.sh
#!/bin/bash
# http://www.reddit.com/r/spacex/comments/2pwjni/live_video_of_asds_in_port/cn19n2i?context=7
# https://gist.github.com/doersino/ade1edd8fe154ea30ba4
#
# This script downloads a webcam image to a date/hour-labeled directory,
# creating intermediate directories as required, making sure that the image is
# not corrupt, and optionally overlaying the current date and time on the image
# and maintaining a mirror of the webcam. Any images from the previous day will
# optionally be ZIP-compressed and compiled into a MP4 video after the first
@doersino
doersino / read_update.php
Last active Aug 29, 2015
Quick-and-dirty script for getting the source of articles added to a local install of ReAD before this commit: https://github.com/doersino/ReAD/commit/80f08d303f0b2cad7c9263b82ad59794c46208a9
View read_update.php
<!-- gets source of your previously ReAD articles
before executing this file, update your database according to the
import.sql file (i.e. add a column "source" of type MEDIUMTEXT to the
"read" table) -->
<meta charset="UTF-8"><body style="overflow-x: scroll;"><pre><?php
error_reporting(E_ALL);
ini_set('max_execution_time', 30);
@doersino
doersino / backup_tumblr.sh
Last active Oct 28, 2017
Simple way of backing up one or multiple Tumblr blogs to date-prefixed folders; downloads and removes required software (except Python) automatically. http://neondust.tumblr.com/post/97723922505/simple-tumblr-backup-script-for-mac-os-x-and-linux
View backup_tumblr.sh
#!/bin/bash
# http://neondust.tumblr.com/post/97723922505/simple-tumblr-backup-script-for-mac-os-x-and-linux
# https://gist.github.com/doersino/7e3e5db591e42bf543e1
# BLOGS is a space-separated list of the blogs you want to backup. You can omit
# the ".tumblr.com" part if you want.
BLOGS="neondust.tumblr.com aufgeloest.tumblr.com hejlisten.tumblr.com"
# OUT is the directory where the backups will be stored. For each blog, a date-
# prefixed subdirectory will be created here.
@doersino
doersino / settitle.sh
Created Jan 26, 2013
Sets the window/tab title on an OS X terminal.
View settitle.sh
function settitle() {
local USAGE
USAGE="usage: settitle WINDOW_TITLE"
if [ -z "$1" ]; then
echo -e "$USAGE"; return 1
fi
echo -ne "\033]0;$1\007"
}
You can’t perform that action at this time.