Skip to content

Instantly share code, notes, and snippets.

Avatar

Maurizio Pillitu maoo

View GitHub Profile
@maoo
maoo / encrypt-md4.py
Last active Aug 29, 2015
Encrypt password for alfresco-global.properties
View encrypt-md4.py
# 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()
@maoo
maoo / mysql.repo
Created Nov 27, 2015
MySQL Community YUM repo
View mysql.repo
[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
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
find . -type f -exec grep -l 'what to search' \{} \;
View SSH Tunnel
ssh -L 8888:host-source:8888 user@host-dest -g cat -
View ifconfig set static IP
ifconfig eth0 192.10.200.111 netmask 255.255.255.0 up
View mysql adduser
## First * : privileges
## Second * : DB name
## Third * : Table name
grant * on *.* to 'username'@'localhost' identified by 'password';
flush privileges;
View svn server add user
htpasswd2 /var/svn/conf/svnusers simone