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/sh | |
# Sends an SMS. Usage: | |
# sms <number> | |
# Message is read from stdin. | |
# | |
# Access token is read from ~/pushbullet.token and device id from ~/pushbullet.device. | |
# I would recommend keeping these files chmod 400. | |
device=`cat ~/pushbullet.device` |
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
/* Takes the same argumetns as vprintf. Allocates space to store the string and returns | |
* a pointer to it. | |
*/ | |
static char* dynvsprintf(char* format, va_list argp) | |
{ | |
char* buffer=NULL; | |
int length; | |
length = vsnprintf(NULL, 0, format, argp)+1; | |
buffer = malloc(length); |
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/sh | |
# Convert brainf*ck to c and compile. Works astonishingly well. | |
# Usage: $0 < file.bf | |
sed '1imain(){char*m=calloc(30000,1); | |
s|[^][+><.,-]||g | |
s|]|}|g | |
s|\[|while(*m){|g | |
s|+|(*m)++;|g |
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 | |
source /etc/btrfsrotate.cron | |
set -e | |
set -u | |
function die { | |
echo "Error: $2" >&2 | |
exit $1 | |
} |