Sign up to create your own snipts, or login.

Public snipts » lucastheis's snipts The latest snipts from lucastheis.

showing 1-5 of 5 snipts
  • SSH via TOR using SOCAT
    # start TOR
    tor
    
    # create tunnel
    socat TCP-LISTEN:<port> SOCKS4A:localhost:<host>:22,socksport=9050
    
    # login through local tunnel
    ssh <user>@localhost -p <port>
    

    copy | embed

    0 comments - tagged in  posted by lucastheis on Feb 06, 2010 at 7:46 p.m. EST
  • GPG Basics
    # generate key
    gpg --gen-key
    
    
    
    # export public key in ASCII format
    gpg --export -a <username> > <filename>
    
    # import public key
    gpg --import <filename>
    
    # remove public key
    gpg --delete-key <username>
    
    # list all public keys
    gpg --list-keys
    
    
    
    # encrypt file
    gpg --encrypt --recipient <username> <filename>
    gpg -e -r <username> <filename>
    
    # decrypt file
    gpg --decrypt <filename>
    gpg -d <filename>
    
    
    
    # add email address
    gpg --edit-key <username> adduid
    
    
    
    # sign public key
    gpg --sign-key <username>
    
    # list signatures
    gpg --list-sigs [<username>]
    
    
    
    # receive keys from server using key ids
    gpg [--keyserver <server>] --recv-keys <keyid>
    
    # send signed key
    gpg [--keyserver <server>] --send-key <keyid>
    
    # update already received keys
    gpg [--keyserver <server>] --refresh-keys
    

    copy | embed

    0 comments - tagged in  posted by lucastheis on Feb 04, 2010 at 10:33 a.m. EST
  • Line Spacing
    % include package
    \usepackage{setspace}
    
    % use one of the following
    \singlespacing
    \onehalfspacing
    \doublespacing
    \setstretch{3}
    

    copy | embed

    0 comments - tagged in  posted by lucastheis on Jan 30, 2010 at 12:18 p.m. EST
  • Amazon EC2 Basics
    # list available amazon machine images (AMIs)
    ec2-describe-images -o amazon
    ec2-describe-images -a
    
    # boot instance
    ec2-run-instances <ami-id> -k <keypair-file>
    
    # list running instances
    ec2-describe-instances
    
    # open/close ports on virtual server (open port 22 for ssh)
    ec2-authorize default -p <port>
    ec2-revoke default -p <port>
    
    # log into instance
    ssh -i <keypair-file> root@ec2-<address>.compute-1.amazonaws.com
    
    # shut down instance
    ec2-terminate-instances i-<instance-id>
    

    copy | embed

    0 comments - tagged in  posted by lucastheis on Dec 27, 2009 at 3:11 p.m. EST
  • Git Basics
    # init a git repository
    git init
    
    # add file to repository
    git add <filename>
    
    # commit all changes
    git commit -a -m <message>
    
    # change to previous revision
    git checkout <revision>
    
    # give current revision a name
    git tag <name>
    
    
    
    # create new branch
    git branch <branch>
    
    # switch to branch
    git checkout <branch>
    
    
    
    # checkout remote repository
    git clone <url>
    
    # checkout changes from remote repository
    git pull
    
    
    
    # list all files under version control
    git ls-files
    

    copy | embed

    0 comments - tagged in  posted by lucastheis on Dec 25, 2009 at 4:00 a.m. EST
Sign up to create your own snipts, or login.