View encrypt-md4.py
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
# Taken from http://www.giuseppeurso.eu/en/alfresco-tips-and-tricks-1-reset-the-admin-password/ | |
import sys | |
import hashlib | |
if len(sys.argv) > 1: | |
passwd = sys.argv[1] | |
print "Encrypting password '%s'" % passwd | |
passwd.encode('utf-16le') | |
print "Encryped password is '%s'" % hashlib.new('md4', passwd.encode('utf-16le')).hexdigest() |
View mysql.repo
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
[mysql56-community] | |
name=MySQL 5.6 Community Server | |
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/$releasever/$basearch/ | |
enabled=1 | |
failovermethod=priority | |
gpgcheck=1 | |
gpgkey=https://raw.githubusercontent.com/chef-cookbooks/yum-mysql-community/master/files/default/mysql_pubkey.asc |
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 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 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 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