Showing posts with label Operating-System. Show all posts
Showing posts with label Operating-System. Show all posts

How to Auto Mount Partitions and Secondary Hard Drives in Linux with fstab file

If you are familiar with Linux based system and you have multiple partitions or Hard drives then you know that the Linux OS will only mount the root partition where the File System has been installed. And in order to mount the other partition or hard drives you need to click on their Tabs on File manager or just mount with mount utility in command line. But we can automatically mount these partitions and Drives at startup, just by editing the fstab file on the file system.

Read more »

Setting up Metasploitable2 (Linux) VM on VirtualBox



The Metasploitable virtual machine is an intentionally vulnerable version of Ubuntu Linux designed for testing security tools and demonstrating common vulnerabilities. First download metasploitable2 VM from here :
Read more »

How to Repair INITRAMFS Problem in Ubuntu


The initramfs problem occur during the boot process in ubuntu. if you are facing this problem during start-up of system then follow the below steps :

Step 1 : Boot from the Ubuntu Live CD/USB

Step 2 : Open Terminal
Read more »

How to setup Static IP Address on Ubuntu Server 16.04 over LAN (Also works on other Linux Dist.)



Open up /etc/network/interfaces file

    sudo nano /etc/network/interfaces
 # The primary network interface  
 auto ens18  
 iface ens18 inet dhcp  
now change your primary interface 'ens18' from dhcp to static
 # The primary network interface  
 auto ens18  
 iface ens18 inet static  
Note: the primary interface ens18 will be different in your system(for example 'eth0'). Now add the following options just below the above lines
 address 192.168.0.151  
 netmask 255.255.255.0  
 network 192.168.0.0  
 broadcast 192.168.0.255  
 gateway 192.168.0.1  
 dns-nameservers 192.168.0.1  
now the configuration is look like this
 # The primary network interface  
 auto ens18  
 iface ens18 inet static  
 address 192.168.0.151  
 netmask 255.255.255.0  
 network 192.168.0.0  
 broadcast 192.168.0.255  
 gateway 192.168.0.1  
 dns-nameservers 192.168.0.1  
where the address is static ip, and at network put your router's ip address and replace '1' with '0' in in right-most place of IP address. For example 192.168.0.1 => 192.168.0.0
In broadcast put 255 at first place of your router's IP, and in gateway and dns-nameservers put your gateway (router) IP address. Now press Ctrl + O to save the file and Ctrl + X to exit. Now we need to edit the /etc/resolv.conf file.

    sudo nano /etc/resolv.conf

at this file put your gateway address in the 'nameserver' option.
 nameserver 192.168.0.1  
now save the file and restart the networking components

    sudo /etc/init.d/networking restart

Note: if by running above command the changes does not take place then just reboot the machine.

and thats it.
Read more »

Enable Core Dump in current working directory for C/C++ programs on Ubuntu 16.x

Check the '/proc/sys/kernel/core_pattern' file

    cat /proc/sys/kernel/core_pattern

if the output of above command is

    |/usr/share/apport/apport %p %s %c %P

then you need to edit the 'core_pattern' file and replace

    |/usr/share/apport/apport %p %s %c %P

with

    core.%e.%p

to do this by below command

sudo su -c 'echo "core.%e.%p" > /proc/sys/kernel/core_pattern'

it will ask you for root password, and its done. At the string 'core.%e.%p' %e means the executable file name and %p denotes the processID. Now to test the core dumping first run below command

ulimit -c unlimited

then compile below code and run it.
test.c
 #include<stdio.h>  
 int main()  
 {  
      char buff[20];  
      int i;  
      for(i=0;i<40;i++) {  
           buff[i] ='\x41';  
      }  
 }  




Read more »

Installation and Configuration of Ubuntu 16.04 LTS


First install a fresh copy of ubuntu 16.04 LTS (Note : It also works on other version of ubuntu 16.x) on your system then run the following commands on terminal.
  • Update the repository
                 sudo apt-get update
  • Install the new packages 
                 sudo apt-get upgrade
  •  Install the Development tools with build-essentials packages
                 sudo apt-get install build-essential
  •  Install Restricted-Extras packages(audio-video codecs, flash players etc.)
                 sudo apt-get install ubuntu-restricted-extras
  • Install vim editor
                 sudo apt-get install vim
  • Install gparted 
                 sudo apt-get install gparted
  •  Install clementine music player (my favorite one)
                 sudo apt-get install clementine
  • Also install vlc player
                sudo apt-get install vlc
  •  Install Zim Desktop Wiki
                sudo apt-get install zim
  • Installing Wine
         If you have 64bit machine installed, then first run below command

                sudo dpkg --add-architecture i386

         after that type following command

                sudo add-apt-repository ppa:wine/wine-builds

                sudo apt-get update

                sudo apt-get install --install-recommends winehq-devel

when the installation process is done, then type 'winecfg' command in terminal and hit enter, it will automatically configure wine. During configuration process it will ask you to install 'MONO package', then click on install button.

  • Installing  VirtualBox
                sudo apt-get install virtualbox

                sudo apt-get install virtualbox-ext-pack


Thats it.
Thanks...
Read more »