Friday, September 11, 2015

[How-to] Enable Hibernate in Ubuntu

[How-to] Enable HIBERNATE in Ubuntu

I enabled Hibernate in my Ubuntu 14.04 by following these:

To enable the Hibernate menu
as instructed by http://ubuntuhandbook.org/index.php/2014/04/enable-hibernate-ubuntu-14-04/

~$ sudo vi /var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
   [Re-enable hibernate by default in upower]
   Identity=unix-user:*
   Action=org.freedesktop.upower.hibernate
   ResultActive=yes

   [Re-enable hibernate by default in logind]
   Identity=unix-user:*
   Action=org.freedesktop.login1.hibernate
   ResultActive=yes

   [Re-enable hibernate for multiple users by default in logind]
   Identity=unix-user:*
   Action=org.freedesktop.login1.hibernate-multiple-sessions
   ResultActive=yes



Setup SWAP as space to hibernate
as instructed by https://help.ubuntu.com/community/SwapFaq
 
~$ sudo blkid
   Copy the UUID of swap

~$ sudo vi /etc/default/grub
   Look for the line GRUB_CMDLINE_LINUX=""
   Replace with GRUB_CMDLINE_LINUX="resume=UUID=yourUUID"
 
~$ sudo update-grub

~$ sudo vi /etc/initramfs-tools/conf.d/resume
   Ensure that it contains RESUME=UUID=yourUUID

~$ sudo update-initramfs -u

~$ sudo reboot

Friday, March 13, 2015

Installing JAVA on Ubuntu 14.04LTS

Install Oracle Java in Ubuntu 14.04LTS

9 Sep 2015
My script when I installed JAVA in my Ubuntu 14.04 64-bit
~$ sudo apt-add-repository ppa:webupd8team/java
~$ sudo apt-get update
~$ sudo apt-get install oracle-java8-installer

13 Mar 2015
This was my script when I installed JAVA SE JDK in my Ubuntu 14.04LTS.
  • wget -c http://download.oracle.com/otn-pub/java/jdk/8u40-b26/jdk-8u40-linux-i586.tar.gz
  • cp -r jdk-8u40-linux-i586.tar.gz /usr/local/java/
  • sudo cp -r jdk-8u40-linux-i586.tar.gz /usr/local/java/
  • cd /usr/local/java
  • sudo tar xvzf jdk-8u40-linux-i586.tar.gz
  • sudo gedit /etc/profile      ## and append the following:
            JAVA_HOME=/usr/local/java/jdk1.8.0_40
            JRE_HOME=$JAVA_HOME/jre
            PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$JRE_HOME/bin
            export JAVA_HOME
            export PATH

  • sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_40/bin/java" 1
  • sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_40/bin/javac" 1
  • sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_20/bin/javaws" 1
  • sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_40/bin/javaws" 1
  • sudo update-alternatives --set java /usr/local/java/jdk1.8.0_40/bin/java
  • sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_40/bin/javac
  • sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_40/bin/javaws
  • source /etc/profile
  • cd /usr/lib/mozilla/plugins ## create if none
  • sudo ln -s /usr/local/java/jdk1.8.0_40/jre/lib/i386/libnpjp2.so
  • java -version
  • javac -version
  • sudo reboot

Source: http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux

Thursday, January 29, 2015

[How-to] Mount /home to another disk partition

[How-to] Mount /home to another disk partition

I need to free up some space in my linux(Ubuntu) main partition. I decided to move my /home folder to another partition. So I did the following, as instructed here, https://help.ubuntu.com/community/Partitioning/Home/Moving:

~$ sudo blkid
~$ sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
~$ cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
~$ sudo gedit /etc/fstab
    and appended
    UUID=????????  /media/home  ext4  defaults  0  2 
~$ sudo mkdir /media/home
~$ sudo mount -a
~$ sudo rsync -aXS --exclude='/*/.gvfs' /home/. /media/home/.
~$ sudo diff -r /home /media/home
~$ sudo gedit /etc/fstab
     and edited /media/home to /home
~$ cd / && sudo mv /home /old_home && sudo mkdir /home
~$ reboot
~$ sudo rm -r /old_home
~$ sudo rmdir /media/home

Kali Linux - My Disaster Recovery Script

~# update-rc.d ssh enable

~# cat /etc/apt/sources.list
        deb http://security.kali.org/kali-security kali/updates main contrib non-free
   deb http://http.kali.org/kali kali main contrib non-free

~# echo export http_proxy=\"http://userid:password@proxyaddressordomainname:8080/\" >> ~/.bashrc
~# echo export https_proxy=\"http://userid:password@proxyaddressordomainname:8080/\" >> ~/.bashrc
~# echo export ftp_proxy=\"http://userid:password@proxyaddressordomainname:8080/\" >> ~/.bashrc
~# echo export all_proxy=\"socks://userid:password@proxyaddressordomainname:8080/\" >> ~/.bashrc

~# openvas-mkcert
~# oepnvas-mkcert-client -i
~# openvas-nvt-sync --wget OV_HTTP_FEED
~# openvassd
~# openvasmd --rebuild --progress
~# openvasmd --create-user=openvasadmin --new-password=1234567890
~# openvasmd -p 9390 -a 0~# gsad --http-only --listen=0 -p 9392~# openvas-check-setup

Friday, July 18, 2014

Install SketchUp Make 2014 into Ubuntu 14.04

Install SketchUp Make 2014 into Ubuntu 14.04

This post of Ji M exactly worked for me, http://ubuntuhandbook.org/index.php/2014/06/install-google-sketchup-ubuntu1404/ 

Summary:
1. Configure Wine > Applications > Windows Version
    Select Windows 7

2. Configure Wine > Libraries > New override for library
    Add riched20

3. Install SketchUp

4. Launch SketchUp with no RubyAPI by:
    SketchUp.exe /DisableRubyAPI
    or
    Edit the command on the application's desktop link.


Problem:
The application hangs at start-up immediately after selecting a template. Step no. 4 above corrected the problem.

Saturday, July 12, 2014

Avast Linux Guide

Download Avast Linux here:
http://files.avast.com/files/linux/avast4workstation_1.3.0-2_i386.deb
or from my backup:https://drive.google.com/file/d/0B4CqOxmp5noLNnFUQzFkSUZ0NU0/edit?usp=sharing

WARNING:
 Installation Procedure:
sudo dpkg -i avast4workstation_1.3.0-2_i386.deb 

On Kernel error try this: 
sudo sysctl -w kernel.shmmax=128000000
or to permanently effect the setting
echo sysctl -w kernel.shmmax=128000000 >> /etc/init.d/rcS


Installed Application
Executables from terminal
- avast
- avast-update
- avastgui

Error on Updating
When updating, the /home/[user]/.avast/400.vps will increase in size. If size breaches the size of kernel shared memory, a kernel error will again occur. Increase again the size of kernel.shmmax as instructed above.

References
https://forum.avast.com/index.php?topic=91145.0
https://forum.avast.com/index.php?topic=116665.0

Friday, July 11, 2014