Skip to content

Instantly share code, notes, and snippets.

@adgon92
adgon92 / java_tips.txt
Created February 26, 2017 20:25
Java tips
1. String Deduplication of G1 Garbage collector to Save Memory from Duplicate String in Java 8
String deduplication is not enabled by default in Java 8 JVM. You can enable String deduplication feature
by using -XX:+UseStringDeduplication option. Unfortunately, String deduplication is only available for the
G1 garbage collector, so if you are not using G1 GC then you cannot use the String deduplication feature.
It means just providing -XX:+UseStringDeduplication will not work, you also need to turn on G1 garbage collector
using -XX:+UseG1GC option. String deduplication also doesn't consider relatively young String for processing.
The minimal age of processed String is controlled by -XX:StringDeduplicationAgeThreshold=3 option.
The default value of this parameter is 3.
@adgon92
adgon92 / Install_python.sh
Last active February 26, 2017 21:10
Install python 3.6 as a side python version on Ubuntu
#/bin/bash
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus
sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev
sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev libbz2-dev libreadline6-dev ncurses-dev
sudo apt-get install tcl-dev tk-dev python-tk python3-tk blt-demo tix python-tk-dbg python3-tk-dbg
sudo apt-get install libssl-dev openssl
@adgon92
adgon92 / install_java.sh
Last active February 18, 2017 16:49
Install java
wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.tar.gz
sudo mkdir /opt/jdk
tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk
ls /opt/jdk
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_05/bin/java 100
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_05/bin/javac 100
java -version
update-alternatives --install /usr/bin/java java /opt/jdk/jdk.new.version/bin/java 110
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk.new.version/bin/javac 110
@adgon92
adgon92 / install_opencv.sh
Last active February 18, 2017 17:11
OpenCV 3.1 installation on Ubuntu
# KEEP UBUNTU OR DEBIAN UP TO DATE
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
#INSTALL THE DEPENDENCIES