Open ~/.bash_profile
in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {
''' | |
SimpleSecureHTTPServer.py - simple HTTP server supporting SSL. | |
- replace fpem with the location of your .pem server file. | |
- the default port is 443. | |
usage: python SimpleSecureHTTPServer.py | |
Credit: https://code.activestate.com/recipes/442473-simple-http-server-supporting-ssl-secure-communica/ | |
License: PSF License |
//from: http://stackoverflow.com/questions/934012/get-image-data-in-javascript | |
function getBase64Image(img) { | |
// Create an empty canvas element | |
var canvas = document.createElement("canvas"); | |
canvas.width = img.width; | |
canvas.height = img.height; | |
// Copy the image contents to the canvas | |
var ctx = canvas.getContext("2d"); |
#!/usr/bin/env python | |
""" | |
Very simple HTTP server in python (Updated for Python 3.7) | |
Usage: | |
./dummy-web-server.py -h | |
./dummy-web-server.py -l localhost -p 8000 | |
Send a GET request: |
#include "stdafx.h" | |
#include <WinSock2.h> | |
#include <ws2tcpip.h> | |
#pragma comment(lib, "Ws2_32.lib") | |
void run_client() | |
{ | |
WSADATA wsaData; | |
WSAStartup( MAKEWORD(2,2), &wsaData ); |
#!/bin/zsh | |
# pyenv install for CentOS 6.5 x86_64 | |
yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel | |
git clone git://github.com/yyuu/pyenv.git ~/.pyenv | |
export PATH="$HOME/.pyenv/bin:$PATH" | |
eval "$(pyenv init -)" |
# references: | |
# Learning by doing: Writing your own traceroute in 8 easy steps (Ksplice Blog) | |
# https://blogs.oracle.com/ksplice/entry/learning_by_doing_writing_your | |
import sys | |
import socket | |
def traceroute(dest_addr, max_hops=30, timeout=0.2): | |
proto_icmp = socket.getprotobyname('icmp') | |
proto_udp = socket.getprotobyname('udp') |
Get Git log in JSON format
git log --pretty=format:'{%n "commit": "%H",%n "abbreviated_commit": "%h",%n "tree": "%T",%n "abbreviated_tree": "%t",%n "parent": "%P",%n "abbreviated_parent": "%p",%n "refs": "%D",%n "encoding": "%e",%n "subject": "%s",%n "sanitized_subject_line": "%f",%n "body": "%b",%n "commit_notes": "%N",%n "verification_flag": "%G?",%n "signer": "%GS",%n "signer_key": "%GK",%n "author": {%n "name": "%aN",%n "email": "%aE",%n "date": "%aD"%n },%n "commiter": {%n "name": "%cN",%n "email": "%cE",%n "date": "%cD"%n }%n},'
The only information that aren't fetched are:
%B
: raw body (unwrapped subject and body)%GG
: raw verification message from GPG for a signed commitbase url is www.geeni.org | |
first two indentations are paths | |
CAPITALS are request methods | |
last identation is queries | |
return is in {} | |
state is 1 for success 0 for anything else | |
message is "success" or failure message | |
stripeid/chargeid is stripe internal id for object, already written to firebase so no need to | |
site will use HTTPS/SSL in future but currently does not so stick to test ccs / bank accounts |
Free O'Reilly books and convenient script to just download them.
Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post
How to use:
download.sh
file and put it into a directory where you want the files to be saved.cd
into the directory and make sure that it has executable permissions (chmod +x download.sh
should do it)./download.sh
and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.