This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#for dbext: | |
apt-get install unixodbc | |
perl -MCPAN -e 'install Bundle::DBI' -e 'install DBD::ODBC' | |
#for vim-sql-workbench | |
#sqlite | |
wget https://bitbucket.org/xerial/sqlite-jdbc/downloads/sqlite-jdbc-3.8.11.2.jar | |
#mysql | |
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.38.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . | xargs head -n1 | strings | grep :// > squid-urls.txt #list of urls in squid cache | |
#purge pattern from cache | |
for x in `cat squid-urls.txt | grep foo`; do | |
squidclient -m PURGE $x ; | |
done | |
#format the dates | |
perl -p -e 's/^([0-9\.]*)/"[".localtime($1)."]"/e' *.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#this is for a file that should get sourced on startup | |
#call it with xmodmap ~/.Xmodmap | |
cat > ~/.Xmodmap << EOF | |
remove Lock = Caps_Lock | |
add Lock = Escape | |
keysym Caps_Lock = Escape | |
keysym Escape = Caps_Lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#show size of remote file, should fetch only header | |
curl 'http://www.ruhbarbdownloads.remote'\ | |
--silent -H 'Accept-Encoding: gzip,deflate'\ | |
--write-out 'size_download=%{size_download}\n'\ | |
--output /dev/null | |
#show header | |
curl -sI 'http://www.ruhbarbdownloads.remote' #| awk '/Content-Length/ { print $2 }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#nix date conversion | |
# time2unixStamp | |
date -d "2016/03/01 01:00:00" "+%s" | |
#readline | |
while read line ; do echo $line\;$(date -d "$t" "+%s") ; done < $1 | |
#unixTime2human | |
date -d @1458636426 | |
awk '{ print strftime("%c", $0); }' $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dates YYYY-MM-DD HH:MM:SS | |
grep -oP '[1-2][90][0-9]{2,2}([-/ ])[0-2][0-9]\1[0-2][0-9] [0-2][0-9]([:])[0-6][0-9]\2[0-6][0-9]' | |
# | |
perl -pe 's/[^[:ascii:]]//g' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sed -re ' | |
s/^.*$/<tr>\n<td>&<\/td>\n<\/tr>/g | |
s/[,]/<\/td>\n<td>/g | |
1i <table style="width:100%"> | |
$a\<\/table>' "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Modeline and Notes"{ | |
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker="{,"} foldlevel=0 foldmethod=marker filetype=vim noswapfile spell: | |
"} | |
let g:python_host_prog='/usr/bin/python2.7' | |
let g:python3_host_prog = '/usr/bin/python3' | |
set nocompatible " be iMproved, required | |
filetype off " required |