# Install Ruby | |
wget http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.gz | |
tar xvzf ruby-2.1.1.tar.gz | |
cd ruby-2.1.1 | |
./configure --prefix=/usr | |
make | |
make install | |
# remove "ruby-2.1.1" folder in /root |
As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/usr/bin/env bash | |
# Create a page in the current dir | |
echo "My Test Page" > test.html | |
# Start server | |
python -m SimpleHTTPServer 8000 &> /dev/null & | |
pid=$! | |
# Give server time to start up |
import BaseHTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
import sys | |
import base64 | |
key = "" | |
class AuthHandler(SimpleHTTPRequestHandler): | |
''' Main class to present webpages and authentication. ''' | |
def do_HEAD(self): |
import BaseHTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
import sys | |
import base64 | |
key = "" | |
class AuthHandler(SimpleHTTPRequestHandler): | |
''' Main class to present webpages and authentication. ''' | |
def do_HEAD(self): |
This is a quick guide on installing HTTPie for Mac OS X systems. This is also useful if you want the python package management utility pip
. An installed copy of Homebrew is a prerequisite.
# install the python package provided with homebrew
brew install python
# install HTTPie with the pip utility
pip install httpie
#!/usr/bin/env python | |
import os, sys | |
sys.path.append(os.getcwd()) | |
import logging | |
import rq | |
MAX_FAILURES = 3 |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Le styles --> | |
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet"> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script> | |
</head> | |
<body> |
This guide will demonstrate the steps required to encrypt and decrypt files using OpenSSL on Mac OS X. The working assumption is that by demonstrating how to encrypt a file with your own public key, you'll also be able to encrypt a file you plan to send to somebody else using their private key, though you may wish to use this approach to keep archived data safe from prying eyes.
Assuming you've already done the setup described later in this document, that id_rsa.pub.pcks8 is the public key you want to use, that id_rsa is the private key the recipient will use, and secret.txt is the data you want to transmit…
$ openssl rand 192 -out key
$ openssl aes-256-cbc -in secret.txt -out secret.txt.enc -pass file:key