Skip to content

Instantly share code, notes, and snippets.

View craigw's full-sized avatar
🦄

Craig R Webster craigw

🦄
View GitHub Profile
>> Time.utc(2038, 1, 19, 3, 14, 7, 999999)
=> Tue Jan 19 03:14:07 UTC 2038
>> Time.utc(2038, 1, 19, 3, 14, 7, 999999).succ
=> Fri Dec 13 20:45:52 UTC 1901
# Don't rewrite UserDir requests
RewriteRule ^/~.*$ - [L]
git clone http://barkingiguana.com/~craig/syndication_notice.git/
require 'net/http'
require 'hpricot'
barking_iguana = URI.parse('http://barkingiguana.com/')
loop do
articles = Hpricot(Net::HTTP.get(barking_iguana))
title = (articles / "div.article a[@rel=bookmark] text()").first
link = (articles / "div.article a[@rel=bookmark]").first['href']
# Of course, this should have a real file path in it.
sudo apt-get install iptables
sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT
sudo iptables -A INPUT -j DROP
sudo sh -c "iptables-save -c > /etc/iptables.rules"
pre-up iptables-restore < /etc/iptables.rules
post-down iptables-save -c > /etc/iptables.rules
sudo iptables -I INPUT 4 -s 193.219.108.245 -p icmp -m icmp --icmp-type 8 -j ACCEPT
sudo sh -c "iptables-save -c > /etc/iptables.rules"
sudo apt-get install postfix --yes
sudo /etc/init.d/postfix stop