This file contains hidden or 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/ruby | |
require "open3" | |
def bash input | |
streams = Open3.popen3 input | |
out = "" | |
while((line=streams[1].gets) != nil) | |
out += line | |
end | |
return out |
This file contains hidden or 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 dd bs=1m if=~/2012-12-16-wheezy-raspbian.img of=/dev/sdc ; notify-send -t 2 -i /usr/share/icons/Humanity/apps/128/gnome-terminal.xpm "Pi Imaged" |
This file contains hidden or 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/ruby | |
=begin | |
Copyright (c) 2013 Shane Quigley | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WIT |
This file contains hidden or 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 | |
BEFORE=0 | |
while true | |
do | |
wget https://news.ycombinator.com/rss -q -O test | |
NOW=$(wc -c test | grep -o -P "\d+") | |
if [ "$NOW" -ne "$BEFORE" ] ; then | |
mplayer Alert.ogg | |
fi |
This file contains hidden or 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
var f = document.getElementsByClassName('fbFeedTickerStory'); | |
for(var i = 0; i < f.length; i++){ | |
if(f[i].innerHTML.indexOf("spotify") !== -1){ | |
f[i].style.display="none"; | |
} | |
} |
This file contains hidden or 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
for(var i = 0; i < 12; i++){ | |
console.log($('#cp-'+i).innerText.replace(/\d:\d+/, '')); | |
} |
This file contains hidden or 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
function krisKindle() { | |
"use strict"; | |
var peopleInKrisKindle, bag, key, giver,firstGiver, reciever, sendMail; | |
sendMail = function(giver, reciever) { | |
var email = peopleInKrisKindle[giver], | |
subject = "Secret Santa", | |
message = "You have to get a gift for " + reciever; | |
MailApp.sendEmail(email, subject, message); | |
}; | |
peopleInKrisKindle = { |
This file contains hidden or 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 | |
BEFORE=0 | |
while true | |
do | |
wget http://feeds.feedburner.com/linuxashd -q -O las.feed | |
NOW=$(wc -c las.feed | grep -o -P "\d+") | |
if [ "$NOW" -ne "$BEFORE" ] ; then | |
wget $(grep -o -P "url(\s|\S)+\.mp4" las.feed | head -1 | cut -c 6-) | |
fi | |
BEFORE=$NOW |
This file contains hidden or 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
npm ls | grep -oP "\w[^@]+@" | sed s/@// | sort |uniq | awk '{print "npm view " $1 " repository.url"}' | sh | grep -oP "github(\w|\W)+\.git" | sed 's/.git//g' | sed 's/.com/.com\/repos/g' | awk '{print "curl -s \"https://api."$1"\" | grep -P \"(stargazers_count|full_name)\" "}' | sh |
This file contains hidden or 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
mount -t btrfs -o skip_balance, subvol=@home /dev/mmcblk0p28 /myhome |