Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Saturday, October 13, 2012

Installing Apache Maven-Java tool

Download maven.

Windows OS:


  1. Unzip the distribution archive, i.e. apache-maven-3.0.4-bin.zip to the directory you wish to install Maven 3.0.4. These instructions assume you chose C:\Program Files\Apache Software Foundation. The subdirectory apache-maven-3.0.4 will be created from the archive.
  2. Add the M2_HOME environment variable. [almost similar as this]: adding the M2_HOME variable in the system variables with the value                                                                                      C:\Program Files\Apache Software Foundation\apache-maven-3.0.4. Be sure to omit any quotation marks around the path even if it contains spaces.
  3. In the same dialog, add the M2 environment variable in the system variables with the value %M2_HOME%\bin.
  4. In the same dialog, update/create the Path environment variable in the system variables and prepend the value %M2% to add Maven available in the command line.
  5. In the same dialog, make sure that JAVA_HOME exists in your system variables and it is set to the location of your JDK, e.g.C:\Program Files\Java\jdk1.5.0_02 and that %JAVA_HOME%\bin is in your Path environment variable.
  6. Open a new command prompt and run mvn --version to verify that it is correctly installed.



Linux based/Ubuntu Operating Systems:


  1. Extract the distribution archive, to the directory you wish to install Maven 3.0.4. These instructions assume you chose /home/username/java/tools/maven.
  2. Open terminal and type:  gedit ~/.bashrc
  3. Set environment variable by adding the following lines at the bottom of .bashrc :
    •  export M2_HOME=/home/username/java/tools/maven
    • export M2=$M2_HOME/bin
    • export PATH=$M2:$PATH
    • export JAVA_HOME=/usr/lib/jvm/jdk-default #if JAVA_HOME not exist.
  4. Run mvn --version to verify that it is correctly installed.

Monday, September 17, 2012

Download video from youtube in Ubuntu terminal

First download and install the program youtube-dl from terminal:

sudo apt-get install youtube-dl

After installation, you can download video from YouTube:

youtube-dl -o file_name.flv youtube-video-link

Monday, September 10, 2012

Sudoers - Community Ubuntu Documentation

Shutting Down From The Console Without A Password

Often people want to be able to shut their computers down without requiring a password to do so. This is particularly useful in media PCs where you want to be able to use the shutdown command in the media centre to shutdown the whole computer.

To do this you need to add some cmnd aliases as follows:

Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/halt, /sbin/reboot

You also need to add a user specification (at the end of the file after the "%admin ALL = (ALL) ALL" line so it takes effect - see above for details):

ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS

Obviously you need to replace "" with the username of the user who needs to be able to shutdown the pc without a password. You can use a user alias here as normal.

via Sudoers - Community Ubuntu Documentation.

Thursday, June 21, 2012

grub2 - Grub Error in Ubuntu 12.04 after upgrade from 11.10

Boot into the Ubuntu Live Cd and open terminal.



1. Identify Ubuntu partition:

sudo fdisk -l


2. Mount it ( replace sda1 with the Ubuntu partition number):

sudo mount /dev/sda1 /mnt


3.Reinstall grub:

sudo grub-install --root-directory=/mnt /dev/sda
sudo update-grub

Solution from: grub2 - Ubuntu 11.10 not showing up in GRUB bootloader after update and restart :( - Ask Ubuntu.

Tuesday, April 24, 2012

Ubuntu Command Collection

  • install debian file:
sudo dpkg -i package_name.deb
  • install dependency:
sudo apt-get -f install
  • install software:
sudo apt-get -f install package_name
  • install bundle file:
sudo sh file_name.bundle
  • install bin/sh file:
chmod +x file_name.bin
./file_name.bin
  • Installing WIRESHARK's dumpcap without allowing non-root users to capture packets:
setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/dumpcap
  • Find the MAC address:
ifconfig

References:
  1. WIRESHARK: