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 python | |
""" | |
getimg.py | |
Gets the current image of the day from NASA and sets it as the | |
background. The summary / description text is written | |
to the image. | |
Requires: | |
PIL (apt-get install python-imaging or pip install PIL) |
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 -e | |
# Running this script will disable the on-access (real-time) scanner in F-Secure Anti-Virus for Mac | |
# while preserving the ability to use the on-demand (manual) scanner. | |
# | |
# Note that this *will* make the UI persistently tell you that there is a problem with real-time | |
# scanning. Which is true, because you disabled it. :-) | |
# | |
# NOTE THAT THIS WILL MAKE YOUR COMPUTER UNPROTECTED. DO THIS AT YOUR OWN RISK! | |
# NOTE THAT THIS WILL MAKE A BACKUP COPY IN YOUR "Documents" FOLDER. KEEP IT. | |
# NOTE THAT THIS IS AN UNSUPPORTED HACK. IT MAY STOP WORKING AT ANY TIME. |
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 -e | |
# | |
# Run this to restore on-access scanning after you have run the script at | |
# https://gist.github.com/1021702 | |
sudo cp ~/Documents/com.f-secure.fsavd.plist /Library/LaunchDaemons | |
sudo launchctl unload /Library/LaunchDaemons/com.f-secure.fsavd.plist | |
sudo launchctl load /Library/LaunchDaemons/com.f-secure.fsavd.plist | |
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 | |
# cryptsync.sh - a simple script for keeping an encrypted backup of a folder | |
# | |
# Author: Rasmus Sten <cryptsync@dll.nu> | |
# | |
# For example, to make an encrypted backup of my ~/Documents folder to Dropbox: | |
# | |
# ./cryptsync.sh --init ~/Documents/ ~/Dropbox/ | |
# |
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/perl | |
# | |
# Script som omvandlar finska Nordeas transaktionslogg till ett format som | |
# är kompatibelt med bankimporten på smartbudget.se | |
# Använd med pbcopy för att placera resultatet i clipboard. | |
# (exportera transaktionerna under fliken "Transaktionsförteckning" i | |
# kontovyn på Nordeas nätbank) | |
# | |
# exempel: | |
# |
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
# Moved here: https://github.com/pajp/add-to-itunes |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Mobile Patent Suits</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?1.29.1"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.29.1"></script> | |
<style type="text/css"> |
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 | |
/Applications/Twitter.app/Contents/MacOS/Twitter & | |
sudo dtrace -q -p $! -n 'pid$target::free:entry /arg0 != 0/ { printf("%s\n", copyinstr(arg0)) }' 2> /dev/null | grep oauth |
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
NUMPAGES=800 | |
USERNAME=pajp | |
APIKEY=DEADBEEF | |
# may need to run this several times because last.fm sometimes returns 403 | |
page=1; while [ $page -le $NUMPAGES ] ; do if [ -s page.$page ] ; then echo "Skipping page $page" ; page=$(($page + 1)); continue ; fi ; echo "Doing page $page"; curl -f "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${USER}&api_key=$APIKEY&page=$page" > page.$page && echo "Page $page OK"; page=$(($page + 1)); done | |
# convert the downloaded XML to CSV using xmlstarlet. Assumes a certain order of the XML elements to may break at any time. | |
for page in `seq 1 $NUMPAGES`; do count=0; xml sel -t -v '//track/name | //track/album | //track/artist | //track/date' < page.$page|while read line; do case $(( $count % 4 )) in 0) artist="$line" ;; 1) track="$line" ;; 2) album="$line";; 3) ts="$line"; echo \"$track\"\;\"$album\"\;\"$artist\"\;\"$ts\" ;; esac ; count=$(($count + 1));done;done > tracks.csv |
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 <CoreServices/CoreServices.h> | |
/* | |
* compile with: | |
* cc -o simpletrasher -framework CoreServices simpletrasher.c | |
*/ | |
int main(int argc, const char** argv) { | |
for (int i=1; i < argc; i++) { | |
char *trash_path = NULL; |
OlderNewer