View OutputStream to byte Array
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
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
int red = 0; | |
boolean finished = false; | |
byte[] tempdata = new byte[1024]; | |
while (!finished) { | |
red = instr.read(tempdata); | |
if (red > 0) { | |
baos.write(tempdata, 0, red); | |
} else { | |
finished = true; |
View Find and exec grep
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 . -type f -exec grep -l 'what to search' \{} \; |
View SSH Tunnel
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
ssh -L 8888:host-source:8888 user@host-dest -g cat - |
View ifconfig set static IP
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
ifconfig eth0 192.10.200.111 netmask 255.255.255.0 up |
View route add default gateway
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
route add default gw 192.10.200.252 |
View svn server add user
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
htpasswd2 /var/svn/conf/svnusers simone |
View mysql adduser
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
## First * : privileges | |
## Second * : DB name | |
## Third * : Table name | |
grant * on *.* to 'username'@'localhost' identified by 'password'; | |
flush privileges; |
View Kill with Grep
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
ps -edaf | grep something_to_grep | awk '{print $2}' | xargs kill -s 9 |
View Java Remote Debug
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
JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" |
View Clean .svn folders
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 . -name '.svn' | xargs rm -Rf |
OlderNewer