Skip to content

Instantly share code, notes, and snippets.

View laszlomiklosik's full-sized avatar

Laszlo Miklosik laszlomiklosik

View GitHub Profile
@laszlomiklosik
laszlomiklosik / mysql case sensitivity disabling
Created March 21, 2014 08:25
mysql case sensitivity disabling
# if you want queries executed in all you schemas to be case insensitive do this
$ sudo gedit /etc/mysql/my.cnf
edit the file adding the entry lower_case_table_names=1 just under the group definition: [mysqld]
[mysqld]
lower_case_table_names=1
@laszlomiklosik
laszlomiklosik / gist:9661756
Last active May 24, 2022 09:22
Allow remote access to postgres via username and password
1) in file /var/lib/pgsql/9.3/data/postgresql.conf change the default value 'localhost' to '*' (all) as shown
listen_addresses = '*'
2) in file /var/lib/pgsql/9.3/data/pg_hba.conf add line:
host all all all password
3) if it still does not work, you bet it's iptables fault. so either stop it temporarily to verify this or add an exception for port 5432
@laszlomiklosik
laszlomiklosik / mysql dump and restore database from command line
Created February 20, 2014 13:58
mysql dump and restore database from command line
#1. dump
mysqldump -u root db_name > dump_name.sql
#2. restore
mysql -u root -p db_name < dump_name.sql
@laszlomiklosik
laszlomiklosik / Upload artifact to protected Maven group repository
Created October 2, 2013 11:28
Upload artifact to protected Maven group repository
# Precondition: you must have the credentials for serverId thirdparty defined in your settings.xml file like this:
#
# <servers>
# <server>
# <id>thirdparty</id>
# <username>your_username_goes_here</username>
# <password>your_password_goes_here</password>
# </server>
# ...
# </servers>
@laszlomiklosik
laszlomiklosik / Gerrit configure a project locally in order to be to follow the review flow
Created September 16, 2013 08:28
Gerrit configure a project locally in order to be to follow the review flow
1. clone the project
2. copy the gerrit hook from the gerrit server (http://gerritserver:8080/tools/hooks/commit-msg) to your local repo's .git/hooks/ folder
3. push for review like this: git push origin HEAD:refs/for/branch_name
@laszlomiklosik
laszlomiklosik / keytool frequently used commands
Last active December 21, 2015 08:28
keytool frequently used commands
1. when importing public key, a .cer file needs to be created and the X509 data must be entered between these:
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
2. import a public key:
keytool -keystore mykeystore.jks -storepass mykeystorepass -import -noprompt -trustcacerts -alias myserveralias -file public.cer
@laszlomiklosik
laszlomiklosik / mysql: connect, create user and database
Last active December 12, 2015 09:39
mysql: connect, create user and database
sudo mysql --user=root mysql --password
CREATE DATABASE your_db DEFAULT CHARACTER SET utf8;
CREATE USER 'your_user'@'%' IDENTIFIED BY 'your_pass';
GRANT ALL PRIVILEGES ON your_db.* TO 'your_user'@'%';
@laszlomiklosik
laszlomiklosik / Maven multi-module build options
Created January 28, 2013 07:29
Maven multi-module build options
# Inspired from http://blog.akquinet.de/2010/05/26/mastering-the-maven-command-line-%E2%80%93-reactor-options/
# Build only specific modules:
mvn clean install -pl sub-module-name2
mvn clean install -pl sub-module-name2,sub-module-name3
# Build only starting from specific sub-module (resume from)
mvn clean install -rf sub-module-name2
# Build dependencies (also make)
@laszlomiklosik
laszlomiklosik / Monitor open threads with refresh
Created December 13, 2012 14:49
Monitor open threads with refresh
while true ; do
date
echo "DB1 threads: `netstat -an |grep '68.20' |grep ESTABLISHED|wc -l`" ;
echo "DB2 threads: `netstat -an |grep '67.20' |grep ESTABLISHED|wc -l`" ;
echo "ajp threads: `netstat -an |grep 8009 |grep ESTABLISHED|wc -l`" ;
echo "HINT if you see errors check details with: tail -1000 /var/log/catalina.out |grep ERROR -A 50 -B 50"
tail -500 /var/log/catalina.out |grep ERROR|tail -n 20
sleep 5;
clear;
done
@laszlomiklosik
laszlomiklosik / Linux see number of open files allowed per process (too many open files related)
Created December 7, 2012 16:18
Linux see number of open files allowed per process (too many open files related)