Skip to content

Instantly share code, notes, and snippets.

@Leyart
Last active August 15, 2017 21:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Leyart/d5c7513cae07a7225d2ed898f9f7cde4 to your computer and use it in GitHub Desktop.
Save Leyart/d5c7513cae07a7225d2ed898f9f7cde4 to your computer and use it in GitHub Desktop.
Useful Commands for Virtual Machines creation
###INSTALL JAVA EASILY
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
###Fixing locales problems
sudo nano /etc/default/locale
LC_ALL="en_GB.UTF-8"
sudo dpkg-reconfigure console-setup
$ sudo dpkg-reconfigure keyboard-configuration
$ sudo dpkg-reconfigure locales
##REDIRECTING PORT 8080 TO PORT 80
sudo /sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
##JAVA_OPTS parameters for /usr/share/tomcat7/bin/setenv.sh . Fixes Tomcat random number generation issues and lock
JAVA_OPTS="$JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xmx1024m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment