Skip to content

Instantly share code, notes, and snippets.

View lauriro's full-sized avatar

Lauri Rooden lauriro

View GitHub Profile
@lauriro
lauriro / .bachrc
Created February 15, 2010 07:53
.bachrc
SSH_AGENT_FILE=`echo ~/.ssh-agent-$(hostname)`
source ${SSH_AGENT_FILE} &> /dev/null
alias ssh-add='if ! kill -0 "$SSH_AGENT_PID" 2>/dev/null; then ssh-agent > "$SSH_AGENT_FILE"; source "$SSH_AGENT_FILE"; fi; ssh-add'
alias ui='cd /cygdrive/d/Code/yoga/web'
alias web='cd /cygdrive/d/Code/github/lauriro.github.com'
alias runphp='/usr/local/php-5.3.1/php-cgi.exe -b 127.0.0.1:9000 &'
alias runwww='kill `cat /var/run/lighttpd.pid` 2>/dev/null; /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf'
@lauriro
lauriro / diffmerge-diff.sh
Created March 4, 2010 13:41
diffmerge-diff.sh
#!/bin/sh
if [ ! -f "$2" -o ! -f "$5" ] ; then
echo "One side missing: $2 vs. $5"
exit 0
fi
if which cygpath &> /dev/null; then
path="$(cygpath $1)"
@lauriro
lauriro / diffmerge-merge.sh
Created March 4, 2010 14:02
diffmerge-merge.sh
#!/bin/sh
localPath="$(cygpath --mixed --absolute "$2")"
basePath="$(cygpath --mixed --absolute "$1")"
remotePath="$(cygpath --mixed --absolute "$3")"
resultPath="$(cygpath --mixed --absolute "$4")"
if [ ! -f $basePath ]
then
basePath="$(cygpath --mixed --absolute ~/diffmerge-empty)"
@lauriro
lauriro / Makefile
Created July 16, 2010 08:12
Makefile
#
# Makefile for Project
#
#
# Tags:
# =====
#
# Certain tags are used in comments to assist in indexing common issues:
# - TODO to indicate planned enhancements.
# - FIXME to mark potential problematic code that requires special
http://github.com/medined/smime
Secure Exchange Solutions
SES Client
The tool it is mostly about an AS1 implementation (www.ietf.org, look for
"MIME-based secure EDI"). The end-user tool should be able to download from
an Internet site (there is a specific WSDL, authentication mechanism and file
format) a directory of contacts (name and e-mail plus the public encryption
@lauriro
lauriro / rsacrypt.sh
Created August 26, 2010 21:22
RSA Encryption
#!/bin/sh
# openssl rsa -in ~/.ssh/id_rsa -pubout -out ~/.ssh/id_rsa.pub.pem
# ln -s ~/rsacrypt.sh /usr/bin/rsacrypt
ENCRYPTED=""
DECRYPTED=""
usage() {
echo -e "\nUsage: $0 [-e [PUBLIC_KEY]] [-d [PRIVATE_KEY]]"
exit 1
@lauriro
lauriro / gist:944278
Created April 27, 2011 13:49
krüptitud data
Lauri@Lauri-PC ~/.ssh (acer *)
$ echo "123" | openssl rsautl -inkey ~/.ssh/id_rsa.pub.pem -pubin -encrypt | openssl base64
GC5YemYYXLkkd8FulzLvJyKrtnqtxP0FuZ27qhDMgA1i38pi4Lgs/xFLwOYa1Hcu
TDuVETicqnBRCg0erBqmJwnCLe8qLvOio+MpnUO01LZzMC8XM0X7A6iSL4TtEUqw
fzD+ZqpHhGHlZHNhQ3U8nl2ZpiFTPr5ho9FRG8f6e9mJrI0n4xnNB3xKj9S9k00P
Njqn753WNRE5KC+8vwo8zrjgmB3is1Q0kIdmlTGzJfq8N08MQDJT1gAV/hsbCjvV
dqd7QNvInrq3qCA5H0aHhFV+EhXU8OxSKPYVnhslm6j6KDjZij0Idv7vEuDIlJsK
MngVoDaSpjy7abfyLTvA+NAqIMGAr98Tp3ik+2xAcyKpM/b4SVWvWEJalVXbV72S
8HK2FVK2IlaULto0qpGHOl/QqPzLuIpmVB3zzU8VyPBAUWuvuJUpoFGIvslItrTe
vyHs93c3qmcEgNHJQPPTufHp1/JYtZ00odGGDRCcbU34Fg782hXMKqRuCmOGrjEQ
export PS1='\n\[\e[32m\]\t \u@\h \[\e[33m\w$(__git_ps1)\e[0m\]\n\$ '
ps1_time() {
local s=1 c IFS=$'\n'
for c in $BASH_COMMAND; do s=$((${#c}/$COLUMNS+1+$s)); done
printf "\033[s\033[${s}A\033[32m%s\033[0m\033[u" $(date +%H:%M:%S);
}
export PROMPT_COMMAND="trap 'ps1_time; trap DEBUG' DEBUG"
@lauriro
lauriro / time_to_run.sh
Last active December 23, 2015 18:19
Show command execution time in shell when it takes more than five seconds.
# Add to .bashrc or .zshrc and try it out
# $ sleep 5
# -- Runs 5 seconds
time_to_words() {
local mod num="$1" out=""
set -- 60 second 60 minute 24 hour 7 day 4 week 12 month
while test $num -gt 0; do
mod=`expr $num % $1`
@lauriro
lauriro / Readme.md
Last active February 6, 2018 08:39
bench

Hello