-
This is a numbered list.
-
I'm going to include a fenced code block as part of this bullet:
Code More Code
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/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
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 | |
# Example for reading from the Twitter streaming API using pycurl | |
# | |
# PyCurl is not installed by default so install it like this: | |
# | |
# pip install pycurl | |
# | |
# The streaming api methods are documented here: |
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/sh | |
mkdir ~/down/ | |
cd ~/down/ | |
sudo apt-get install build-essential | |
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz | |
tar -xzf Python-2.7.2.tgz | |
cd Python-2.7.2 | |
sudo apt-get install libsqlite3-dev zlib1g-dev libncurses5-dev | |
sudo apt-get install libgdbm-dev libbz2-dev libreadline5-dev | |
sudo apt-get install libssl-dev libdb-dev |
Two ways to do it, but only worked for me so I'll put it first and the second for reference:
$ openssl pkcs12 -export -in hostname.crt -inkey hostname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem
Other options for this method in comments below:
# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hostname.key -certfile root.crt -out hostname.p12
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
Some things to note: | |
I'm running SiriProxy on port 2000 using a non-privileged user. I'm then redirecting internal network traffic | |
using iptables from port 443 to port 2000. This is more secure than running SiriProxy as root. I also have it | |
set up to respawn SiriProxy when it dies (which happens pretty regularly). Finally, I'm dumping all the output | |
to /tmp/siriproxy (in theory), but I don't seem to get output to that log. Which is unfortunate. Maybe someone | |
can explain what's wrong there. I'm really not an expert in Upstart either. :-) | |
As usual, simply copying/pasting this stuff anywhere will get you pretty much nowhere. You need to have some idea | |
what you're doing to make this work. Good luck! |
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/sh | |
baseurl=http://mygitlaburl | |
usermail=adminuser@mymailserver | |
userpass=adminpassword | |
repo_access=2 #0=denied 1=read 2=read&write | |
project_access=2 #0=deined 1=read 2=report 3=admin | |
# login | |
curl -s -I -c cookies.txt -d "utf8=✓&user[email]=$usermail&user[password]=$userpass&commit=Sign+in" $baseurl/users/sign_in |
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
# Was asked how I keep my zshrc config sync'd between my computers with Dropbox | |
# Add a new directory in your Dropbox (or use an existing one) | |
mkdir -p ~/Dropbox/ohmyzsh | |
# move existing file to Dropbox | |
mv ~/.zshrc ~/Dropbox/ohmyzsh/zshrc | |
# symlink file back to your local directory | |
ln -s ~/Dropbox/ohmyzsh/zshrc ~/.zshrc |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
OlderNewer