Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/bin/bash | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/local/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# exit on error | |
set -e | |
TMUX_VERSION=1.8 |
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}' |
#!/usr/bin/python | |
# Author - Vivek Ramachandran [email protected] | |
# | |
import sys, binascii, re | |
from subprocess import Popen, PIPE | |
f = open(sys.argv[1], 'r') | |
for line in f: | |
wepKey = re.sub(r'\W+', '', line) |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
##Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:alexpchin/.git
# Set up some logging. VERY useful to see why things aren't working. | |
logger_syslog=-1 | |
logger_syslog_level=2 | |
logger_stdout=-1 | |
logger_stdout_level=2 | |
# Which interface to use and which bridge to join | |
interface=wlan0 | |
bridge=br0 |
// 4 spaces to 2 spaces | |
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g | |
// Tab to 2 spaces | |
:%s/\t/ /g |
This page is about embedding raster images into svg or html as data URI string. Data URI being base64 string, we first need to convert our image into base64 strings. There I explain how to do it server side and client side.
Given image.png
as a valid image, let's creates a *.b64 copy as a text file containing a valid base64 text string.
openssl base64 -in image.png -out image.b64
echo $(cat image.b64)
#!/bin/bash | |
TMUX_VERSION=2.3 | |
NCURSES_VERSION=6.0 | |
LIBEVENT_VERSION=2.0.22 | |
BASEDIR=${HOME}/work/tmux-static | |
TMUXTARGET=${BASEDIR}/local | |
mkdir -p $TMUXTARGET | |
cd $BASEDIR |
# LICENSE: MIT, wtfpl or whatever OSS license you like | |
function get_stack () { | |
STACK="" | |
local i message="${1:-""}" | |
local stack_size=${#FUNCNAME[@]} | |
# to avoid noise we start with 1 to skip the get_stack function | |
for (( i=1; i<$stack_size; i++ )); do | |
local func="${FUNCNAME[$i]}" | |
[ x$func = x ] && func=MAIN | |
local linen="${BASH_LINENO[$(( i - 1 ))]}" |