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
import RPi.GPIO as GPIO | |
import web | |
PIN = 7 | |
# to use Raspberry Pi board pin numbers | |
GPIO.setmode(GPIO.BOARD) | |
# set up GPIO output channel | |
GPIO.setup(PIN, GPIO.OUT) | |
urls = ( |
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/python | |
import sys | |
from twisted.web import http, proxy | |
from twisted.internet import reactor | |
HEAD = 'Fuck GFW\x01\r\n' | |
f = http.HTTPFactory() | |
f.protocol = proxy.Proxy | |
if 'client' in sys.argv: | |
_connectTCP = reactor.connectTCP # redirect to our server |
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=utf8"> | |
<title>Float Label Pattern</title> | |
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> | |
<style type="text/css" media="screen"> | |
.row { | |
/*position: relative;*/ | |
padding-top: 24px; |
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
#encoding = utf-8 | |
require "nokogiri" | |
require "open-uri" | |
def fetch_page(i) | |
page_url = "http://happycasts.net/episodes/#{i}" | |
begin | |
doc = Nokogiri::HTML(open(page_url)) | |
link = doc.css('a.download').first |
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
require 'sinatra' # gem install sinatra --no-rdoc --no-ri | |
set :port, 3000 | |
set :environment, :production | |
html = <<-EOT | |
<html><head><style> | |
#text{width:100%; font-size: 15px; padding: 5px; display: block;} | |
</style></head><body> | |
<input id="text" placeholder="Write then press Enter."/> | |
<div id="chat"></div> |
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/python | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
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
import sys | |
import bencode | |
import hashlib | |
import base64 | |
import urllib | |
torrent_file = sys.argv[1] | |
torrent = open(torrent_file, 'r').read() | |
metadata = bencode.bdecode(torrent) |
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
import commands | |
def get_cpu_temp(): | |
tempFile = open( "/sys/class/thermal/thermal_zone0/temp" ) | |
cpu_temp = tempFile.read() | |
tempFile.close() | |
return float(cpu_temp)/1000 | |
# Uncomment the next line if you want the temp in Fahrenheit | |
#return float(1.8*cpu_temp)+32 | |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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 | |
/etc/init.d/ntp stop | |
until ping -nq -c3 8.8.8.8 > /dev/null; do | |
echo "Waiting for network..." | |
done | |
ntpdate -s time.nist.gov |
OlderNewer