Skip to content

Instantly share code, notes, and snippets.

@eencinasq
Last active August 31, 2016 15:26
Show Gist options
  • Save eencinasq/721786452163df9c4c27 to your computer and use it in GitHub Desktop.
Save eencinasq/721786452163df9c4c27 to your computer and use it in GitHub Desktop.
LINUX COMMANDS
#LIST HARD DISKS
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
#FORWARDING OF PORTS
ssh -L 4445:localhost:4444 [email protected]
echo "sss" | nc -l 4444
#COMPRESS FILES
tar -zcvf archive.tar.gz directory/
#DECOMPRESS FILES
tar -xvf file.tar directory/
tar -xzvf file.tar.gz directory/
tar -xjvf file.tar.bz2 directory/
#GENERATE PASSWORDS
date +%s | sha256sum | base64 | head -c 32 ; echo
#change datetime on ubuntu
sudo dpkg-reconfigure tzdata
#Mount a volumen with fstab
vim /etc/fstab
add the line "/home/edwin_encinas/docker/ /var/lib/docker none bind 0 0"
sudo mount -a
# Verify disk space
$ df -f
$ ncdu
#add routes
sudo route add -net 172.30.16.0 netmask 255.255.240.0 gw 172.21.8.6
sudo route add -net 172.30.0.0 netmask 255.255.240.0 gw 172.21.8.6
#win
route ADD 172.30.0.0 MASK 255.255.240.0 172.21.8.6
route ADD 172.30.16.0 MASK 255.255.240.0 172.21.8.6
***create icon access***
Open a terminal (Ctrl-Alt-T) and switch it to root permissions by entering:
$ sudo su
Extract the Eclipse installation package into /opt:
# cd /opt
# sudo tar -xzvf <path_to_the_downloaded_package>
Increase the memory for the Eclipse installation by modifying the /opt/eclipse/eclipse.ini file. See the "easy way" for instructions.
Create a startup script for the Eclipse:
# cd /usr/local/bin
# echo 'ECLIPSE=/opt/eclipse/eclipse' >eclipse
# echo 'exec $ECLIPSE "$@"' >>eclipse
# chmod +x eclipse
Now exit the root mode and start the installed eclipse:
# exit
$ eclipse
Confirm the dialog box asking you to create a workspace.
# Install oracle java
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
# Replace number 8 with 6 or 7
sudo apt-get install oracle-java8-set-default
java -version
*REMOVE ALL PROCESS THAT USE PORT ESPESIFIC
sudo kill $(sudo lsof -t -i:9001)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment