Tuesday, September 30, 2008

Links to good documents about assembly / disassembly / reveng / systems

In this post is a collection a good links I've accumulated over some time. This is mostly programming material in assembly. Using tools for assembly/disassembly of running processes and mappings of function in memory, etc... Please enjoy these good reads as I have. I especially liked the one on netrino.com about testing memory on embedded systems. This would be a nice project to do for testing memory in servers and desktops alike. Maybe in assembly, so the application footprint is not so big. This would also reduce the amount of time needed to run each test. I will update my post on .bashrc. This way you can have some alias' for the respects of assembling, disassembling, compiling, decompiling and debugging applications on Unix/Linux environment. Thanks. Enjoy. -A

http://www.nasm.us/doc/nasmdoc2.html
http://asm.sourceforge.net//syscall.html
http://asm.sourceforge.net//howto/Assembly-HOWTO.html

http://sourceware.org/binutils/docs/as/index.html
http://www.tldp.org/LDP/lki/
http://www.cplusplus.com/reference/
http://www.itee.uq.edu.au/~comp2303/Leslie_C_ref/C/cref.html
http://webster.cs.ucr.edu/AoA/Windows/HTML/AoATOC.html
http://www.intel.com/products/processor/manuals/index.htm
http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_875_7044,00.html
http://www.netrino.com/Embedded-Systems/How-To/Memory-Test-Suite-C
http://www.ibiblio.org/pub/historic-linux/distributions/slackware/3.1/docs/ELF-HOWTO
http://cs.mipt.ru/docs/comp/eng/os/linux/howto/howto_english/elf/elf-howto.html
http://www.hex-rays.com/idapro/idadown.htm
http://www.linuxforums.org/misc/understanding_elf_using_readelf_and_objdump.html
http://biew.sourceforge.net/en/biew.html
http://www.linuxjournal.com/article/1059
http://www.linuxjournal.com/article/1060
http://en.wikipedia.org/wiki/Executable_and_Linkable_Format
http://en.wikipedia.org/wiki/Physical_Address_Extension
http://en.wikipedia.org/wiki/Page_replacement_algorithms
http://en.wikipedia.org/wiki/Realloc
http://en.wikipedia.org/wiki/Call_stack
http://en.wikipedia.org/wiki/Page_table
http://en.wikipedia.org/wiki/Instruction_set_architecture
http://en.wikipedia.org/wiki/X86_instruction_listings
http://en.wikipedia.org/wiki/Protected_mode

Friday, September 26, 2008

OpenBSD Snort: Cannot check flow connection for non-TCP traffic

I wasted a couple hours trying to figure out why snort would NOT start. It seems I was using CURRENT and not the actual current version number. Look in /var/log/daemon file to see what is happening. If you see anything like this:

Cannot check flow connection for non-TCP traffic


It means your snort rules or snort.conf file is NOT of the same version of snort you installed. Check which snort version you have like this:

snort -v


make sure that is you have oinkmaster installed make sure that your url is reflecting the correct rules file to download and oinkcode. You must first register with snort.org to receive an oinkcode.

Then just do this to update your rules, notice the dot:

cd /etc/snort/rules && oinkmaster -o .


or place into a cron for auto update of snort rules. Hope this saves someone a couple hours. -A

Saturday, September 20, 2008

My python curl.py class template with stdout colors support

This is my curl.py class that I use as a template. It supports stdout colors. When a function is called is displays output of the caller and called functions. Also you can display any string, list, dict,tuple,etc...Very Nice, I like. It's the same thing as using print. Only you add color to the output. I especially like it for situations like. Displaying webpage data. Large amounts of it. Logs and CSV files. You can find patters and display them in different colors. You can use this script to download and upload data to any website. Please correct indentation where necessary.

How to Use:
sess = curl.session("") #create new session
sess.login("http://domain/site/login_post","admin","super_secret_pass")

#!/usr/bin/env python
from ctypes import *
import os, sys, types, urllib, urllib2, urlparse, string, pycurl
import stdout_colours


class curl(object):
"Encapsulate user operations on CGIs through curl."
def __init__(self, base_url=""):
self.func_me_color="white_on_black"
self.soc=stdout_colours.stdout_colors()
self.soc.me_him(['ENTER:',__name__],self.func_me_color)
# These members might be set.
self.base_url = base_url
self.verbosity = 0
# Nothing past here should be modified by the caller.
self.response = ""
self.curlobj = pycurl.Curl()
# Verify that we've got the right site...
self.curlobj.setopt(pycurl.SSL_VERIFYHOST, 2)
# Follow redirects in case it wants to take us to a CGI...
self.curlobj.setopt(pycurl.FOLLOWLOCATION, 1)
self.curlobj.setopt(pycurl.MAXREDIRS, 5)
# Setting this option with even a nonexistent file makes libcurl
# handle cookie capture and playback automatically.
self.curlobj.setopt(pycurl.COOKIEFILE, "/dev/null")
# Set timeouts to avoid hanging too long
self.curlobj.setopt(pycurl.CONNECTTIMEOUT, 30)
self.curlobj.setopt(pycurl.TIMEOUT, 300)
# Set up a callback to capture
def response_callback(x):
self.response += x
self.curlobj.setopt(pycurl.WRITEFUNCTION, response_callback)
self.soc.me_him(['EXIT:',__name__],self.func_me_color)
def set_verbosity(self, level):
"Set verbosity to 1 to see transactions."
self.soc.me_him(['ENTER:',__name__],self.func_me_color)
self.curlobj.setopt(pycurl.VERBOSE, level)
self.soc.me_him(['EXIT:',__name__],self.func_me_color)
def get(self, cgi, params="",verbose=0):
"Ship a GET request to a specified CGI, capture the response body."
self.soc.me_him(['ENTER:',__name__],self.func_me_color)
if params:
cgi += "?" + urllib.urlencode(params)
self.curlobj.setopt(pycurl.URL, os.path.join(self.base_url, cgi))
self.curlobj.setopt(pycurl.HTTPGET, 1)
self.response = ""
self.curlobj.perform()
if verbose > 0:
print self.response
self.soc.me_him(['EXIT:',__name__],self.func_me_color)

def post(self, cgi, params,verbose=0):
"Ship a POST request to a specified CGI, capture the response body.."
self.soc.me_him(['ENTER:',__name__],self.func_me_color)
self.curlobj.setopt(pycurl.URL, os.path.join(self.base_url, cgi))
self.curlobj.setopt(pycurl.POST, 1)
self.curlobj.setopt(pycurl.POSTFIELDS, urllib.urlencode(params))
self.response = ""
self.curlobj.perform()
if verbose>0:
print self.response
self.soc.me_him(['EXIT:',__name__],self.func_me_color)
def upload(self, cgi, file_name, file, verbose=0):
"POST file from localhost to location/cgi."
self.soc.me_him(['ENTER:',__name__],self.func_me_color)
self.curlobj.setopt(pycurl.URL, os.path.join(self.base_url, cgi))
self.curlobj.setopt(pycurl.HTTPPOST,[(file_name, (pycurl.FORM_FILE,file))])
self.response = ""
self.curlobj.perform()
if verbose>0:
print self.response
self.soc.me_him(['EXIT:',__name__],self.func_me_color)
filename), "wb").write(content)

#fnames = ",".join([fname for fname, ct, c in files])
#return HttpResponse("me-%s-RECEIVE-OK[POST=%s,files=%s]" % (request.META["SERVER_PORT"], request.POST.values(), fnames ))

def answered(self, check):
"Does a given check string occur in the response?"
self.soc.me_him(['ENTER:',__name__],self.func_me_color)
self.soc.me_him(['RETURN:',__name__],self.func_me_color)
return self.response.find(check) >= 0
def close(self):
"Close a session, freeing resources."
self.soc.me_him(['ENTER:',__name__],self.func_me_color)
self.curlobj.close()
self.soc.me_him(['EXIT:',__name__],self.func_me_color)

class session(curl):
def login(self, cgisite,username, password):
"""login - cgi="account/login.php",params=(("username",name),("password",pass),("foo","bar")) """
self.soc.me_him(['ENTER:',__name__],self.func_me_color)
self.post(cgisite, (("username",username),
("password",password),
("mode","login"),
("usertype","P"),
("redirect","admin")))
self.soc.me_him(['EXIT:',__name__],self.func_me_color)
def logout(self, cgisite):
"""logout - cgi="account/logout.php" """
self.soc.me_him(['ENTER:',__name__],self.func_me_color)
self.get(cgisite)
self.soc.me_him(['EXIT:',__name__],self.func_me_color)

if __name__ == "__main__":
if len(sys.argv) < 3:
print "Usage: %s \"schema://site/cgi\" \"username\" \"password\"" % sys.argv[0]
site=sys.argv[1]
username=sys.argv[2]
password=sys.argv[3]
sess=session("")
sess.set_verbosity(1)
sess.login(site,username,password)
a=""
for i in range(len(password)):
a+="*"

print "YOU ARE LOGGED IN!",site,username,a
sess.logout()
sess.close()

Friday, September 19, 2008

Python Incremental Downloader Script

This is a script that will incremental download all files on a website. It accumulates all names and sends you an email to user@localhost of files that were downloaded and kept. Which ones were downloaded and deleted due to a wrong file size. etc... Make modification/s where necessary. This is something that worked for me. Most sites don't need the session variable passed via query string. For the ones that do this script work great. You may come across sites that require storage of cookie. The most feasible way I can think of that you would accomplish this is if you used pyCurl. You can also add this functionality to a bot that will download files and zip them after reaching a certain directory space limit. For easy download via DCC(in python) or something. A lot of possibilities here. Depending on the site and your connection you make get in extent of 10GB per day download speeds. Of course there may be a better way to implement the functionality. This is one way to do it. You can add more functions named start_ and do what you will with the data. Such as img, form or input fields. Nuff said. Enjoy this script. It not mine really and you can do what you want with it. No Restrictions and all that mumbo jumbo.

NOTE: Modification is required to use this script.


#!/usr/bin/env python
#download all txt files

from sgmllib import SGMLParser
import os,sys,urllib,string

class URLLister(SGMLParser):
def reset(self):
SGMLParser.reset(self)
self.urls = []

def start_a(self, attrs):
href = [v for k, v in attrs if k == 'href']
if href:
self.urls.extend(href)

class file_downloader(object):
def __init__(self):
self.c="" #used to hold session string
self.modu=150 # perform session check every modulus == 0
self.h="http://www.example.org" #used to get session
self.u="http://www.example.org/download.php?id=" #used to get file via sess
self.d="file/" #dir to dl files to
self.mailer=True #send mail upon complete
self.to_email="user@localhost" #message are sent here if above True
self.ws=110 #wrong file size
self.messagerm="" #used to hold message sent of removed files
self.messagesv="" #used to hold message sent of saved files
self.messageimprm="" #used to hold message sent of impossible removed files
self.messageimpsv="" #used to hold message sent of impossible saved files
self.mfn="file_missed" #impossible files are stored in this file under specified dir
self.missed=[] #missed list
self.impossible=[] #impossible list
def session_var(self):
usock = urllib.urlopen(self.h)
parser = URLLister()
parser.feed(usock.read())
usock.close()
parser.close()
for url in parser.urls:
if string.find("".join(url),"download.php") != -1:
return url.split("&")[1]
def check_wrong_size(self):
d,mfn,missed,ws=self.d,self.mfn,self.missed,self.ws
if os.path.exists(d+mfn) == True:
mls=open(d+mfn).readline()
ml=eval(mls.split("\n")[0])
missed={}.fromkeys(ml).keys()

#os.listdir(os.getcwd()) #list all files in cwd
files=os.listdir(d)
for i in range(len(files)):
f=d+files[i]
if os.path.getsize(f) < int(ws):
print "removing file "+f
os.system("rm "+f)
missed.append(i)
os.system("echo \""+str(missed)+"\" > "+d+mfn)
""" run for loop and get """
def download_files(self,rans,rane):
d,u,mfn,missed,ws,modu=self.d,self.u,self.mfn,self.missed,self.ws,self.modu
messagerm,messagesv=self.messagerm,self.messagesv
messageimprm,messageimpsv=self.messageimprm,self.messageimpsv
c=self.session_var()
if os.path.exists(d+mfn) == True:
mls=open(d+mfn).readline()
ml=eval(mls.split("\n")[0])
missed={}.fromkeys(ml).keys()
for i in range(int(rans), int(rane)):
if i % int(modu) == 0:
c=self.session_var()
print i, c
urllib.urlretrieve(u+str(i)+"&"+c,d+str(i)+".txt")
if os.path.getsize(d+str(i)+".txt") < int(ws):
os.system("rm "+d+str(i)+".txt")
missed.append(str(i))
messagerm += d+str(i)+".txt "
else:
messagesv += d+str(i)+".txt "

#retry impossible & missed files
m=missed
impossible,to_email=self.impossible,self.to_email
for i in range(len(m)):
c=self.session_var()
#mission impossible?
urllib.urlretrieve(u+str(m[i])+"&"+c,d+str(m[i])+".txt")
if os.path.getsize(d+str(m[i])+".txt") < int(ws):
os.system("rm "+d+str(m[i])+".txt")
impossible.append(str(m[i]))
messageimprm += d+str(m[i])+".txt "
else:
messageimpsv += d+str(m[i])+".txt "
os.system("echo \""+str(impossible)+"\" > "+d+mfn)
if self.mailer == True:
os.system("echo \""+messagerm+"\" > "+d+"filerm")
os.system("mail -s 'file removed' "+to_email+" < "+d+"filerm")
os.system("rm "+d+"filerm")

os.system("echo \""+messagesv+"\" > "+d+"filesv")
os.system("mail -s 'file saved' "+to_email+" < "+d+"filesv")
os.system("rm "+d+"filesv")

os.system("echo \""+messageimprm+"\" > "+d+"filerm")
os.system("mail -s 'file impossible removed' "+to_email+" < "+d+"filerm")
os.system("rm "+d+"filerm")

os.system("echo \""+messageimpsv+"\" > "+d+"filesv")
os.system("mail -s 'file impossible saved' "+to_email+" < "+d+"filesv")
os.system("rm "+d+"filesv")
if __name__ == "__main__":
a=file_downloader()
if len(sys.argv) < 2:
a.check_wrong_size()
else:
rans=sys.argv(1) #range start 250
rane=sys.argv(2) #range end 432
a.download_files(rans,rane)

Symbol Scanner and .bashrc for fast system navigation via the command line terminal

Howto fast command line system navigation via alias' in your ~/.bashrc and a symbol barcode scanner

Here are some alias you can set in your ~/.bashrc
Make sure to remove wrap where necessary and source your bashrc(sbrc) in every terminal that hasn't already loaded your modification. I will update alias' as I go. To have as a reference for you and me. pixelbeat.org/cmdline.html, also has a nice cmdline reference. I though this would come in handy for someone. I made a barcodes cheat sheet, use it if you are to lazy to type. You can also make your own cheatsheet and pass it on to your best buddies with your bashrc :) Enjoy.

Note: You may need to type/scan sudo before some of these alias'.

append to file: .bashrc

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTCONTROL=ignoreboth

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
;;
*)
;;
esac

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

#if [ -f ~/.bash_aliases ]; then
# . ~/.bash_aliases
#fi

# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'

#alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'
fi

# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
alias ll='ls -CF'
alias l='ls -la'
alias cpr='cp -r'
#reverse dig
alias digx='dig -x'

alias lso='sudo lsof -i -T -n'

#outguess will only hide data in jpg files
#gout super_secret_pass data.txt poop.jpg fat_poop.jpg
function gout() { outguess -k $1 -d $2 $3 $4 ;}

#scan for open dns resolver ports 1024-1150
function scandns() { nmap -sU -vv -p 1024-1300 -P0 -T Aggressive ;}

#sslsniff listenport cerificatefile
function sslsniffer() { sslsniff -p $1 -c $2 ;} #listenport certfile post_only -P

#ipforwarding on
function ip_forward() { echo 1 > /proc/sys/net/ipv4/ip_forward ;}

function arpsp() { arpspoof -i $1 -t $2 $3 ;} #eth0 victim router
function arpskr() { arp-sk -r -S $1 -D $2 ;} #router victim

#ipt_ssl listenport
function ipt_ssl() { iptables -t nat -A PREROUTING -p tcp --destination-port 443 -j REDIRECT --to-ports $1 ;}

#ungout super_secret_pass fat_poop.jpg data.txt
function ungout() { outguess -k $1 -r $2 $3 ;}

#steghide will hide data in bmp,jpg,au and wav files, default encrypt method is Rijndael/AES 128 bits
#steg poop.jpg fat_poop.jpg data.txt super_secret_pass
function steg() { steghide embed -cf $1 -sf $2 -ef $3 -p $4 ;}

#unsteg fat_poop.jpg
function unsteg() { steghide extract -sf $1 ;}

#unalias vars
function unal() { unalias "$@" ;}

#fsn 192.168.1 255
function fsn() { for i in `seq $2`;do ping -c1 $1.$i;done ;}
alias hc='hexcat'
#awk find replace file
function awkfpf() { awk -F "|" '{gsub( /$1/,"$2");print}' $3 ;}

#ec "modified something in /etc, now commit with bzr"
function ec() {
ec_var="`pwd`" && cd /etc/ && sudo bzr commit -m "$@" && cd $ec_var
}
#dump /dev/mem file.dump 18384 48 4
function memdump() { sudo dd if=$1 of=$2 bs=$3 skip=$4 count=$5 ;}
#macch eth0 00:11:22:33:44:55
function macchange() { ifconfig $1 hw ether $2 ;}
alias ifc='ifconfig'
alias cmd0='sudo'
alias nbrc='nano ~/.bashrc'
alias sbrc='source ~/.bashrc'
alias sudh='sudo dhclient'
alias dush='sudo du -sh' #location
alias agi='sudo apt-get install'
alias agu='sudo apt-get update'
alias ags='sudo apt-cache search'
alias agsh='sudo apt-cache show'
alias agr='sudo apt-get remove'
alias agd='sudo apt-get dist-upgrade'
alias agc='sudo apt-get clean'
alias agac='sudo apt-get autoclean'
alias pkgstat='dpkg --status'
alias pkgrec='sudo dpkg-reconfigure'
alias cdrec='cdrecord -v dev=/dev/cdrom' #*.iso
alias screenl='screen -ls'
alias screenr='screen -raAD'
alias screenk='screen /dev/ttyUSB0 115200'
alias enc='encfs.sh' #mount encfs mounts
alias unc='uncfs.sh' #unmount encfs mount
alias zipit='zip -r' #zip_file.zip file_or_dir_to_zip
alias tarit='tar -czvf' #file_to_make.tar.gz file_or_dir_to_tar
alias tarlit='tar -cvhf' #file_to_tar.tar.gz file_or_dir_to_tar
alias untar='tar -zxvf' #file_to_unpack.tar.gz
alias unrare='unrar e' #file.rar #unpack/open rar
alias unrarl='unrar l' #file.rar # list contents
alias unrarx='unrar x' #file.rar #extract full path
alias unrarp='unrar e -p' # file.rar #unrar password protected rar archive
alias unrart='unrar t' #file.rar # test integrity of archive
alias burncd='cdrecord -v dev=/dev/cdrom' #iso_to_burn.iso
alias npv='pkill npviewer.bin' #this kills flash player
alias killit='killall -v -HUP' #inetd
alias bat='cat /proc/acpi/battery/BAT0/state'
alias t='tail -n'
alias c='cat'
alias p='python'
alias e='encfs'
alias m='mysql -u root -p'

function dumpsql() { mysqldump -h $1 -u $2 -p -r $3 $4 ;} #somehost someuser backup_filename database_name

# '{}' gets replace by the name of the file that was found
function findexi() { find $1 -iname $2 -exec $3 '{}' \; ;} # 'dir' 'file_str' 'str_to_find'
function findex() { find $1 -name $2 -exec $3 '{}' \; ;} # 'dir' 'file_str' 'str_to_find'

function findnam() { find $1 -type f -iname $2 ;} #. "*str_to_find_in_filename*"
function findstr() { find $1 | xargs grep $2 ;} #. 'str_to_find_in_files'
function findstrnam() { find $1 -iname '$2' | xargs grep '$3' ;} #. 'file_str' 'str_to_find' -sl # -sl to show filename only
function findstrnamtime() { find $1 -iname $2 -mtime $4 | xargs grep $3 ;} #. 'file_str' 'str_to_find' -1|1 #-1=today 1=olderthantoday

function dushdir() { for i in {`ls $1`};do du -sh $1/$i;done ;}
alias grepi='grep -i'
function grepr() { grep -r '$@' ;} # "string to find" "/dir/to/recurse"
function grephr() { grep -H -r '$@' ;} # same as above, only return filename string
function greprf() { grep -H $1 $2 -R | cut -d: -f1 ;} # "string" "/etc/*"


alias rk='rafkill' # < this is a game

alias relfh='readelf -h' #hello
alias relfS='readelf -S' #hello
alias relfs='readelf -s' #hello
alias relfl='readelf -l' #hello
#DANGEROUS
alias umntl='umount `mount | grep "/dev" | awk "{ print $1 }"`'
#-d=disassemble, -j=section
alias objdumpdj='objdump -d -j' #.text hello
alias oddj.text='objdump -d -j .text' #hello
alias oddj.data='objdump -d -j .data' #hello
#block started by symbol
alias oddj.bss='objdump -d -j .bss' #hello

#Virtual Memory Area--VMA for process
#first field is VMA addr range
#last field shows backing file
#before doing this you can do:
#gdb ->b main ->r ->q
function procsegn() { cat /proc/`pgrep $1`/maps ;} #process name
function procsegi() { cat /proc/$1/maps ;} #process id

alias gccc='gcc -c' #hello.c #creates hello.o
alias gcco='gcc -o' #hello hello.c
alias sp='splint' #hello.c
alias mkfat32='mkdosfs -F 32'
alias nasmfe='nasm -f elf' #hello.asm

function nasmfo() { nasm -f $1 $2 -o $3 ;} #bin hello.asm hello.com

alias ldso='ld -s -o' #hello hello.o

alias svnco='svn checkout' #URL path
alias svnrev='svn checkout -r' #rev URL path
alias svni='svn info' #path
alias svna='svn add' #path
alias svnrm='svn remove' #path
alias svnu='svn update'
alias svnup='svn update' #path
alias svnc='svn commit -m' #message
alias shfreq='cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'
alias shgovr='cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors'
alias cpufs='cpufreq-selector -f' #1300000
alias rmlock="sudo rm /var/lib/dpkg/lock && sudo rm /var/cache/apt/archives/lock"
alias cronlu='sudo crontab -lu' #user
alias cronadd='sudo crontab -eu' #user
alias paros='/usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/bin/java -jar /home/nopsidy/Desktop/paros/build/paros/paros.jar'

alias lastcrash='last |grep crash'
alias lastreboot='last reboot'
function lastn() { last '$@' ;}
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi

PATH=$HOME/bin:$PATH
PYTHONPATH=$HOME/lib/python
EDITOR=vim

export PATH PYTHONPATH EDITOR



Now we can use these alias' as bar codes. We can create bar codes with kbarcode. Then use them with a Symbol LS2208 barcode scanner or any scanner that understands Code 128 format, etc. You can change what the alias does for a scanned bar code. Instead of re-printing a new sheet of barcodes. I created 10 custom commands. You can set these to anything you like. I mostly use my alias to keep my commands in a central place. I helps me to keep things organized and easier to find. Instead of writing them down. Saves me time. I don't have to look through my notebook for the right commands.

Please share your .bashrc

You can get a symbol on ebay for $100-$150. This makes it very convenient to use for system maintenance. Especially if you know what commands you have to run ahead of time for a full system install. :) I've been working with python for a little while now. I would like to make a script to create barcodes for me automatically after I modify bashrc(nbrc&&sbrc)

You can download my current odt file. The password is lowercase "linux" without the quotes. I plan on adding prepend/append codes for a tab key or enter key to the cheat sheet. You can just store your .bashrc file on a usb stick. Plug it in with your trusty cheat sheet, a scanner and your on your way. I still don't know of a good way to transfer files via a keyspan. Is it possible? I think what I will do next is tape some cheat sheets on my walls next to my pc at home. Then I can sit relax and not type so much. :) I will keep updating this file.

Thank You.

Saturday, September 13, 2008

Must have Firefox Addons for a web developer or any avid surfer

In this post I will attempt to cover all the plug-ins a web developer/avid surfer must have to make his/her life easier. These are only plug-ins that I'm accustomed to, so that means that I may be missing a few. Not sure. This is what I use. I'm bored, so I'm posting to my blog about Firefox addons :) Please post a comment with your suggestion of a nice addon/plugin for me to checkout.

Note: Clicking on the links below will prompt you to install the plug-in/addon. You may want to go directly to https://addons.mozilla.org/en-US/firefox/ and do some research before you actually install something you may not want.

1. Web Developer Tools found here
2. Firebug found here
3. FoxyProxy found here
4. NoScript found here
5. FlashBlock found here
6. FirePHP found here
7. FormFox found here
8. Modify Headers found here
9. Tamper Data found here
10. SQL Injection! found here
11. Speed Dial found here
12. FoxMarks found here and in my post below
13. Password Exporter found here (potentially dangerous if someone gets your password file. Even if you encrypt it, you've been warned)
14. UnHide Passwords found here
15. UrlFlipper found here
EDIT: I knew I forgot something.
16. GreaseMonkey found here
17. StumbleUpon found here
18. ChatZilla found here
19. venkman found here
20. NetCraft Toolbar find it here
21. ShowIP found here
22. Server SPY find it here
23. HackBar found here
24. User Agent Switcher found here
25. LocalRodeo found here
26. RequestPolicy found here
Enjoy, and please leave a comment with your favorite addons that you like to use. TIA

Thursday, September 11, 2008

Foxmarks

Are you looking for an easy way to copy all your bookmarks from one computer to another? Then, I have great news for you. There's no need to manually export and import all your bookmarks anymore. You can download a great plug-in for Firefox called Foxmarks. It'll merge and/or copy all your bookmarks on every computer that you have this plug-in installed on. This plug-in is a time saver. Check it out here.

Friday, September 5, 2008

My First Post from Google Chrome Running in a Seamless VirtualBox

From the beginning we all knew that the browser would over power the OS. In starting to use the new Google Chrome I realized that my browsing experience has been maximized. Everything is at your finger tips when it comes to Google. They have done it again. Only this time with a great browser. OOps, what will Microsoft say now? It has some really great features. Your browser url bar is used for searching, "omnibar". When you open a new tab it takes you to your frequently visited pages. That's a nice touch. Task Manager of current open tabs. Plus more. It saves you that much time it your browsing experience. While working on projects my computer may start going slow sometimes. yet chrome has that kick. It's so fast. Great Job Guys.

Thursday, September 4, 2008

Post Links and Make serious Money with UrlCash

Want to make Money posting links to blogs, forums and websites? It's easy to make the Money online. You can do it too. As easy as posting a link.