Thursday, October 7, 2010

How to list all the jar contents in one line and redirect the output to a text file for easy searching

1. place all the jar files in a directory on a linux server

2.
$ cd jardirectory

3. list the files
$ for file in `ls | grep ".jar"`; do `unzip -l $file >> jarcontents.txt` ; done

4. use vi and search for entries
vi jarcontents.txt
In vi, type forward slash, and your search string.

Monday, October 4, 2010

On the Android phone: how to disable the annoying Verizon VCAST messages that autoplay when you plug your phone into the USB connector

dial ##7764726
Hit Call (you will not hear a ring tone)
Type Password 000000 (that's 6 zeros)
Hit Feature Settings
Choose CD ROM
Click Disable
Hit menu, commit modifications (it will say "No item changed")
Done.
----------------------------

Credits: http://community.vzw.com/t5/DROID-Incredible-by-HTC/Disable-V-CAST-Media-Manager-Web-Pop-Up/m-p/275464

Friday, October 1, 2010

How to delete a fail2ban IP from the iptables chain of rules

################################################
root@myserver:~# nano /usr/local/sbin/deleteipfromfail2ban.sh
#!/bin/bash

IP=$1

if [ "$IP" = "" ] ; then
echo "Syntax: deleteipfromfail2ban.sh "
RETURNSTATUS=1
exit $RETURNSTATUS
fi

iptables -D fail2ban-ssh -s $IP -j DROP

################################################

Example of usage:
deleteipfromfail2ban.sh 10.1.1.25