Skip to content

Instantly share code, notes, and snippets.

@Happyholic1203
Happyholic1203 / cVimrc
Created June 10, 2015 02:34
vimrc for Chrome extension: cVim.
map <C-f> scrollFullPageDown
map <C-b> scrollFullPageUp
map <C-e> scrollDown
map <C-y> scrollUp
#!/bin/bash
test `xcode-select -p` || xcode-select --install
test `which brew` || ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew install caskroom/cask/brew-cask
brew cask install google-chrome
brew cask install macdown
@Happyholic1203
Happyholic1203 / install.sh
Created December 15, 2015 09:28 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@Happyholic1203
Happyholic1203 / mirror-port.sh
Created June 2, 2016 01:56 — forked from lonelymtn/mirror-port.sh
Mirror traffic between two interfaces using Linux's traffic controll subsystem (tc)
#!/usr/bin/env bash
# Time-stamp: <2014-07-31 13:31:43 (ryanc)>
#
# Description: Mirror traffic between two interfaces using Linux's
# traffic control subsystem (tc)
trap cleanup EXIT
CLEANUP=1
SRC_IFACE=$1
@Happyholic1203
Happyholic1203 / flask-upload
Last active June 18, 2016 15:40 — forked from dAnjou/flask-upload
Flask upload example
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
# Source: https://gist.github.com/v-yarotsky/2157908
# Usage:
# - Prefix is set to Ctrl-o (make sure you remapped Caps Lock to Ctrl)
# - All prefixed with Ctrl-o
# - Last used window: /
# - Last used pane: ;
# - Vertical split: v
# - Horizontal split: s
### KEYS ###
@Happyholic1203
Happyholic1203 / urllib2_upload.py
Created September 12, 2016 10:01 — forked from zhenyi2697/urllib2_upload.py
Python: urllib2 upload file demo
#!/usr/bin/python
# demo from here: http://pymotw.com/2/urllib2/index.html#uploading-files
import itertools
import mimetools
import mimetypes
from cStringIO import StringIO
import urllib
import urllib2
@Happyholic1203
Happyholic1203 / jq-insert-var.sh
Created September 14, 2016 12:30 — forked from joar/jq-insert-var.sh
Add a field to an object with JQ
# Add field
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}'
# {
# "hello": "world",
# "foo": "bar"
# }
# Override field value
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}'
{
@Happyholic1203
Happyholic1203 / tmux.md
Created November 2, 2016 06:39 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@Happyholic1203
Happyholic1203 / PyOpenSSL example
Last active June 14, 2023 19:35 — forked from shatil/punnel.py
Python OpenSSL libraries' private key signing vs. OpenSSL's rsautl
#!/usr/bin/env python
from __future__ import print_function
import base64
import sys
PEM = ("""-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAgK1Q6Ydi8UUheJLvnTYJE65NOZtAtjDdDSxS+6b4x9EakjIylljSzs5uLEJn