Skip to content

Instantly share code, notes, and snippets.

View ttj4's full-sized avatar

Jinto Thomas ttj4

  • Socure Inc
  • Chennai
View GitHub Profile
@ttj4
ttj4 / init-script-sample
Last active January 16, 2019 09:35
Init script for linux server with Java component
DAEMON_PATH="/home/ubuntu/components/rms"
DAEMON="rmsapp.jar"
DAEMONOPTS="log4j.properties config.properties"
JAVABIN="/usr/bin/java -jar"
NAME="rmsapp"
DESC="1 minute delayed price stream from globalfeed"
PIDFILE=/var/run/$NAME.pid
@ttj4
ttj4 / monit-script-component-sample
Created January 16, 2019 09:36
monit tool configuration
check process price with pidfile /var/run/price.pid
start program = "/bin/bash /home/ubuntu/etc/init_globalfeed.sh start"
stop program = "/bin/bash /home/ubuntu/etc/init_globalfeed.sh stop"
check process proxy with pidfile /var/run/proxy-server.pid
start program = "/bin/bash /home/ubuntu/etc/init_proxy.sh start"
stop program = "/bin/bash /home/ubuntu/etc/init_proxy.sh stop"
depends on price
check process quote with pidfile /var/run/quoteupdate.pid
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
add these in /etc/environment
JAVA_HOME=/usr/lib/jvm/java-8-oracle
JRE_HOME=/usr/lib/jvm/java-8-oracle/jre
do : source /etc/environment
sudo apt-get install mysql-server-5.7
sudo service mysql stop
sudo mkdir -p /var/run/mysqld
sudo chown mysql:mysql /var/run/mysqld
sudo mysqld_safe --skip-grant-tables --skip-syslog --skip-networking
open new terminal and enter : mysql -uroot
sudo iptables --flush
sudo iptables --delete-chain
allow loopback
sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A OUTPUT -o lo -j ACCEPT
allow established connections
* download jar file from https://www.bouncycastle.org/latest_releases.html
* go to jre\lib\security\java.security [/Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home/jre/lib in mac]
* add following to the file : security.provider.{10}=org.bouncycastle.jce.provider.BouncyCastleProvider
* copy downloaded jar to jre\lib\ext
@ttj4
ttj4 / do.txt
Created May 14, 2020 11:05
remove primary key in mysql dump
mysqldump command with db +/- table | sed -e "s/([0-9]*,/(NULL,/g" > 1.sql