Skip to content

Instantly share code, notes, and snippets.

View crazybyte's full-sized avatar
💭
I may be slow to respond.

Levente Varga crazybyte

💭
I may be slow to respond.
View GitHub Profile
@crazybyte
crazybyte / git_useful_commands_aliases.md
Created March 5, 2013 09:09
Useful git commands and aliases
  • Current branch local name:
git config alias.lbranch-name 'rev-parse --abbrev-ref HEAD'
git lbranch-name
  • Remote tracking branch name:
git config alias.rbranch-name 'rev-parse --symbolic-full-name --abbrev-ref @{u}'
git rbranch-name
@crazybyte
crazybyte / git_cheatsheet.md
Last active April 25, 2019 13:13
Advanced (almost) git command cheatsheet

Commiting

  • Changing the last commit message
    git commit --amend -m "New commit message"  
  • Ignoring at commit the modifications of an already tracked file:
@crazybyte
crazybyte / st2_paramiko.md
Created December 1, 2012 11:42
Using Paramiko in Sublime Text 2 plugins

Using Paramiko in Sublime Text 2 plugins (as a guide to using Python libraries in Sublime Text 2 plugins)

  1. use 'easy_install paramiko' to install paramiko and crypto. Now your system python should be able to import paramiko
  2. Install paramiko for your ST2 plugin
    a. Get paramiko from here http://www.lag.net/paramiko/ (or alternatively the most recent version from GitHub).
    b. Place the folder with the 'init.py' file in [ST Packages]/[MY PACKAGE]/paramiko
  3. Install Crypto for your ST2 plugin
    a. Check where your python libraries are using python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
    b. Go to that folder (in my case /Library/Python/2.7/site-packages) and copy the file 'pycrypto-2.6-py2.7-macosx-10.8-intel.egg' somewhere
    c. Unpack it (just rename it to .zip)
@crazybyte
crazybyte / encrypt_openssl.txt
Created November 25, 2012 10:10
File encryption using OpenSSL
For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt
For Asymmetric encryption you must first generate your private key and extract the public key.
@crazybyte
crazybyte / certs.txt
Created November 25, 2012 09:45
OpenSSL transformations
NOTE: HTTP SSL keys are all in PEM format (base64 encoded)
#From PEM format to DER
openssl x509 -in $1.crt -out $1.der -outform DER
#From DER format to PEM
openssl x509 -in $1.der -inform DER -out $1.pem -outform PEM
#Transforming RSA key to DER format
openssl rsa -in oberon.key -inform PEM -out oberon_key.der -outform DER