Skip to content

Instantly share code, notes, and snippets.

@do3cc
do3cc / gist:11041989
Created April 18, 2014 12:38
Simple way to generate ssl certs without interactive questions
# When having multiple vhosts, and one of them listens to https,
# nginx will answer ssl requests for all of your vhosts, but with data
# from that one host that answers ssl. The browser will complain
# that the certificate is for the wrong site and you will receive
# the wrong site.
# With this simple self signed certificate, the user gets a warning
# for the untrusted certificate but at least gets the right site.
openssl req -x509 -newkey rsa:2048 -keyout lala.key -out lala.crt -days 3650 -nodes -subj "/C=de/CN=www.example.com"
@do3cc
do3cc / gist:5805562
Created June 18, 2013 13:56
Ordering imports or other things in vim can be done with !sort If you have some proper locales set, sort always sorts case insensitive and there is no flag to tell him to stop that. You can, however, run sort with a different locale. Doing so from vim is a bit much to type though, therefor, add the alias below
# Works in bash AND zsh
alias sort="LC_ALL=C sort"
@do3cc
do3cc / gist:5611777
Created May 20, 2013 11:45
This is a template one can use to create notifications for each repo, one ever committed to on github
# In this example, I chose to look into the organizations collective and plone only. Adjust to your needs, don't forget to add yourself, if you want to watch yourself.
# Pagination count is based on the number of repos in collective, which is 919.
# Get all repos from a project
for ORG in collective plone
do
for PAGE in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
do
curl -u $YOURUSER:$YOURPASS -i https://api.github.com/users/$ORG/repos\?page\=$PAGE >> repos
done