Skip to content

Instantly share code, notes, and snippets.


Daniel Serodio dserodio

View GitHub Profile
dserodio /
Created Apr 29, 2014
Installing PyQT for IPython QtConsole on Mac
brew install zeromq pyqt
pip install ipython pyzmq pygments
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
set -ex
if [ $# -ne 2 ]; then
echo usage: $0 root_dir jenkins_master
dserodio /
Created Feb 4, 2015
Upgrade Brew if on OS X or apt-get otherwise. If parameter is received, upgrade a remote (Ubuntu) machine
if [ -z $1 ]
if [ "$OS" == "Darwin" ]
echo "Updating…"
brew update
echo "Upgrading…"
brew upgrade
sudo apt-get update
def _shell_escape(string):
""" Escape double quotes, backticks and
dollar signs in given ``string``.
For example:
>>> _shell_escape('abc$') 'abc\\\\$'
>>> _shell_escape('"') '\\\\"'
for char in ('"', '$', '`'):
## Copyright (C) 2009 Przemyslaw Pawelczyk <>
## License: GNU General Public License v2, v3
# Lockable script boilerplate
### HEADER ###
LOCKFILE="/var/lock/`basename $0`"
dserodio /
Created Jun 18, 2015
Test if a RSA keypair matches
diff <( ssh-keygen -y -e -f "$PRIVKEY" ) <( ssh-keygen -y -e -f "$TESTKEY" )
dserodio / wget.ps1
Created Jun 26, 2015
Download a remote URL using Powershell
View wget.ps1
[String] $remoteUrl,
[String] $localPath
$webClient = new-object System.Net.WebClient;
$webClient.DownloadFile($remoteUrl, $localPath);
dserodio / google.xsd
Created May 13, 2011
Google DTD converted to a XML Schema (XSD) using Trang
View google.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="" elementFormDefault="qualified">
<xs:element name="GSP">
<xs:element ref="TM"/>
<xs:element ref="Q"/>
<xs:element maxOccurs="unbounded" ref="PARAM"/>
<xs:element minOccurs="0" ref="SEARCH_MODES"/>
dserodio / hook_stdout_stderr
Last active Dec 4, 2015
Hook into stdout and stderr of a running process
View hook_stdout_stderr
sudo strace -p $PID -e trace=write -e write=1,2
# To log started and elapsed times, add -ttT
dserodio / 0_reuse_code.js
Created Oct 22, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console