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 | |
import sys, datetime | |
import requests | |
from StringIO import StringIO | |
from lxml.html import parse | |
import PyRSS2Gen | |
PAGE = 'http://www.dailysabah.com/columns/dogan-eskinat/archive' | |
# XPath queries |
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 | |
import requests | |
from StringIO import StringIO | |
from lxml.html import parse | |
import datetime | |
import PyRSS2Gen | |
PAGE = 'http://www.independent.co.uk/biography/patrick-cockburn' | |
# XPath queries |
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, requests | |
from bs4 import BeautifulSoup | |
def scrape(url='http://example.com'): | |
try: | |
html = requests.get(url).content | |
except: | |
print "URL doesn\'t load" | |
exit() | |
page = BeautifulSoup(html) |
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/expect | |
# Login to SSH with password automatically | |
# Requires expect: | |
# sudo apt-get install expect | |
set timeout 60 | |
set login $argv | |
spawn ssh $login |
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 | |
while read line | |
do | |
/data/exssh.sh "$line" | |
done < hostnames.txt |
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/expect | |
# Login to SSH with password automatically | |
# Requires expect: | |
# sudo apt-get install expect | |
set timeout 60 | |
spawn ssh gnufs@nsa.gov | |
while {1} { |
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 | |
# Clone and update LibreOffice repositories | |
# Browse repos at http://cgit.freedesktop.org/libreoffice | |
Repo=('artwork' 'base' 'bootstrap' 'build' 'calc' 'components' 'contrib/buildbot' 'contrib/dev-tools' 'contrib/dumper' 'contrib/ooeclipse' 'contrib/svn-to-git' 'contrib/test-files' 'extensions' 'extras' 'filters' 'help' 'impress' 'l10n' 'libs-core' 'libs-extern-sys' 'libs-extern' 'libs-gui' 'postprocess' 'sdk' 'testing' 'translations' 'ugly' 'ure' 'writer'); | |
for (( i = 0; i < ${#Repo[@]}; i++ )) | |
do | |
echo "cloning ${Repo[i]}" | |
git clone git://anongit.freedesktop.org/libreoffice/${Repo[i]} |
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
net = require('net'); | |
var sockets = []; //connected people | |
// net.createServer == net.Server | |
var s = net.Server(function(socket) { | |
sockets.push(socket); | |
socket.on('data', function(d) { | |
for (var i = 0; i < sockets.length; i++){ |
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 <stdio.h> | |
/* pointer fun */ | |
main() { | |
int x = 81; | |
int y; | |
printf("The adress of x is %p\n", &x); | |
printf("The value of x is %d\n", *&x); | |
printf("The address of y is %p\n", &y); | |
printf("The value of y is %d\n", *&y); |