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 | |
# Change this to the directory containing the image files. | |
XKCDPATH="/usr/local/bin/xkcdnow" | |
HOUR=$(TZ=Asia/Kamchatka date +%H) | |
MINUTE=$(date +%M) | |
if [ $MINUTE -gt 00 -a $MINUTE -le 15 ]; then | |
MINUTE=15 | |
elif [ $MINUTE -gt 15 -a $MINUTE -le 30 ]; then | |
MINUTE=30 |
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 | |
for HOUR in {00..23}; do | |
for MINUTE in 00 15 30 45; do | |
wget "http://imgs.xkcd.com/comics/now/"$HOUR"h"$MINUTE"m.png" | |
done | |
done | |
exit |
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 | |
LOCATION="/usr/local/bin" | |
if [ $# -eq 2 ]; then | |
if [ -f $1 ]; then | |
$LOCATION/spl/bin/spl2c < $1 > $2.c | |
gcc $2.c -o $2 -I $LOCATION/spl/include -L $LOCATION/spl/lib -lspl -lm | |
rm $2.c | |
rm $1 | |
else | |
echo "USAGE: spl2c [file to compile] [name of resulting program]" |
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
38400 8N1 |
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
#include <avr/sleep.h> | |
#include <avr/interrupt.h> | |
volatile int pinOutState; | |
ISR(PCINT0_vect){ | |
if (pinOutState == 0){ | |
PORTB = (1 << PB1); | |
pinOutState = 1; | |
} |
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 | |
clear | |
one() | |
{ | |
FILETEXT=`cat $FILE | tail -c +5` | |
echo $FILETEXT | |
rm -f $FILE | |
} | |
two() | |
{ |
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
badopts() | |
{ | |
echo -e "Usage: ifchanged [command to check] [number of seconds to wait between checks] [command to execute if not changed] [command to execute if changed]" | |
exit | |
} | |
if [ $# -ne 4 ]; then | |
badopts | |
else | |
while true; do | |
RES=`$1` |
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
#!/usr/bin/env ruby | |
$randwins = 0 | |
$swins = 0 | |
$equal = 0 | |
$tried = [] | |
ARGV[0].to_i.times do | |
$times = 0 | |
$num = rand(1..9) | |
$sel = rand(1..$num) | |
loop do |
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
#!/usr/bin/env ruby | |
$one = 0 | |
$two = 0 | |
$three = 0 | |
$four = 0 | |
$five = 0 | |
$six = 0 | |
$seven = 0 | |
$eight = 0 | |
$nine = 0 |
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 | |
DATE=$(date -d "$1" +%Y-%m-%d) | |
URL="http://schlockmercenary.com/$DATE" | |
PICS=$(xidel $URL -e "//@src/resolve-uri(.)" 2> /dev/null | egrep '[0-9][a-z].(png|jpg)') | |
if [ -z "$PICS" ]; then | |
PICS=$(xidel $URL -e "//@src/resolve-uri(.)" 2> /dev/null | egrep '[0-9].[png|jpg]' | head -n 1) | |
fi | |
echo "$PICS" | |
exit |