An introduction to curl using GitHub's API
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
#!/bin/bash | |
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'` | |
for JAIL in $JAILS | |
do | |
fail2ban-client status $JAIL | |
done |
#!/bin/bash | |
# License: Public Domain. | |
# Author: Joseph Wecker, 2012 | |
# | |
# -- DEPRICATED -- | |
# This gist is slow and is missing .bashrc_once | |
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch | |
# (Thanks gioele) | |
# | |
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile? |
<?php | |
/** | |
* Scrape the number of podcast reviews from iTunes for all country specific storefronts. | |
* | |
* @author Sean Murphy <sean@iamseanmurphy.com> | |
*/ | |
$podcast_id = '366931951'; // Startups For the Rest of Us | |
//$podcast_id = '318567721'; // techzing |
-- PostgreSQL cheat sheet | |
--postgres is set up to use local.6 which is syslog'd to sflog001 | |
--slow query log is /var/log/localmessages | |
--config files are always in /data/friend/*.conf | |
--vacuums are set via cfengine, we use both manual and auto. vacuums/analyze help with frozen id's being recouped, and thus TX'id's not going over 2b thus causing massing shutdown/reset. Fix it to exp/imp high TX tables. | |
--to log into psql: psql -U postgres -d <DB> (usually friend) |
WITH RECURSIVE | |
x(i) AS ( VALUES (0) | |
UNION ALL SELECT i + 1 | |
FROM x | |
WHERE i < 101), | |
Z(Ix, Iy, Cx, Cy, X, Y, I) AS ( | |
SELECT | |
Ix, | |
Iy, | |
X :: FLOAT, |
import multiprocessing | |
# The socket to bind. | |
bind = "127.0.0.1:8080" | |
# The maximum number of pending connections. | |
backlog = 2024 | |
# The number of worker process for handling requests | |
workers = multiprocessing.cpu_count() * 2 + 1 | |
# The type of workers to use. (sync|eventlet|gevent|tornado) | |
worker_class = 'gevent' |
from openpyxl.workbook import Workbook | |
from openpyxl.writer.excel import ExcelWriter | |
from openpyxl.cell import get_column_letter | |
class XlsLogger(object): | |
""" | |
Save something to a Excel spreadsheet | |
""" | |
def __init__(self): |
apt-get install -y build-essential libx11-dev libgl1-mesa-dev libxext-dev perl perl-modules make | |
cd /tmp | |
wget http://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz | |
tar xzvf UnixBench5.1.3.tgz | |
cd UnixBench | |
./Run | |