git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
rsync (Everyone seems to like -z, but it is much slower for me)
| import email | |
| def get_decoded_email_body(message_body): | |
| """ Decode email body. | |
| Detect character set if the header is not set. | |
| We try to get text/plain, but if there is not one then fallback to text/html. | |
| :param message_body: Raw 7-bit message body input e.g. from imaplib. Double encoded in quoted-printable and latin-1 |
| #!/usr/bin/python | |
| # http://www.packtpub.com/article/python-ldap-applications-ldap-opearations | |
| # sudo apt-get install python-ldap | |
| import ldap | |
| host = 'ldap://example.com:389' | |
| dn = 'ldap@example.com' |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| require 'rubygems' | |
| require 'openssl' | |
| require 'digest/md5' | |
| key = OpenSSL::PKey::RSA.new(2048) | |
| cipher = OpenSSL::Cipher::AES.new(256, :CBC) | |
| ctx = OpenSSL::SSL::SSLContext.new | |
| puts "Spoof must be in DER format and saved as root.cer" | |
| raw = File.read "root.cer" | |
| cert = OpenSSL::X509::Certificate.new raw | |
| cert.version = 2 |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| Function Test-Url { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory=$true)] | |
| [String] $Url, | |
| [Parameter()] | |
| [Switch] $ReturnUri | |
| ) |