This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !^.*\.png | |
RewriteRule ^/(.+) /index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find branches already merged | |
git branch -a --merged | |
# Find a list of branches by date and author | |
git for-each-ref --sort=committerdate --format='%(committerdate:short) %(authorname) %(refname:short)' | grep "origin" | |
# Prune your locally cloned version | |
git fetch -p | |
git gc --prune=now | |
git remote prune origin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto lo | |
iface lo inet loopback | |
iface eth0 inet dhcp | |
allow-hotplug wlan0 | |
iface wlan0 inet manual | |
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf | |
iface default inet dhcp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILE_PATH="$1" | |
FILE_DIR=$(dirname "$FILE_PATH") | |
FILE_NAME=$(basename "$FILE_PATH") | |
FILE_BASE="${FILE_NAME%.*}" | |
avconv -i "$FILE_PATH" -vcodec h264 -acodec aac -strict -2 "$FILE_DIR/$FILE_BASE.mp4" | |
rm -r -f "$FILE_PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check host gateway with address 192.168.1.1 | |
start "/usr/sbin/service networking start" | |
stop "/usr/sbin/service networking stop" | |
if failed icmp type echo count 5 with timeout 10 seconds | |
then restart | |
if 4 restarts within 5 cycles | |
then exec /sbin/reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.*; | |
import org.usb4java.*; | |
public class ReadTrinket { | |
public static void main(String args[]) { | |
Context context = init(); | |
DeviceHandle trinketHandle = openDevice(); | |
try { | |
int result = LibUsb.claimInterface(trinketHandle, (short) 0x00); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DEST_DIR="/home/iPod" | |
FULL_PATH="$1" | |
ALBUM=$(basename "$FULL_PATH") | |
NEW_PATH="$DEST_DIR/$ALBUM" | |
echo "Transcoding into $NEW_PATH" | |
mkdir "$NEW_PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
queueStatsToDataframe <- function(uri, username, password) { | |
uri <- paste(uri, "api/queues", sep="/") | |
credentials = paste(username, password, sep=":") | |
doc <- getURL(uri, userpwd=credentials, httpauth=1L) | |
src <- fromJSON(doc) | |
items.df <- data.frame() | |
if(length(src) > 0) { | |
for(i in 1:length(src)) { | |
if(length(src[[i]]$messages_details) == 3) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getContents <- function(uri, username, password) { | |
credentials = paste(username, password, sep=":") | |
doc <- getURL(uri, userpwd=credentials, httpauth=1L, ssl.verifypeer = FALSE) | |
} |
OlderNewer