Search This Blog

Sunday, 21 August 2016

HOW REMOVE USB SHORTCUT VIRUS Windows

HOW REMOVE USB SHORTCUT VIRUS

To remove sub shortcut virus you first scan it with antivirus to clean any infected files then type cmd in windows run now type the following commands in DOS,

attrib -h -r -s /s /d X:\*.*, (Where, X is the USB drive letter) and press Enter. 
(For example: If your drive letter is D, then the command is attrib -h -r -s /s /d D:\*.*)

After you run the command , hopefully it has resolved the shortcut problem you need to copy all files to your computer, then format the usb drive. Secondly we need to download and install a usbfix software to solve this problem for that click the following link 



Thanks! Keep commenting.....

Friday, 19 August 2016

ADD NEW USER IN UBUNTU AND GIVE RIGHTS IN Ubuntu Linux

ADD NEW USER IN UBUNTU AND GIVE RIGHTS


Sign in as root user and then add new user by following steps,


  1.  adduser newusername

    Give password to newuser
  2. To grant access rights use the following command,

    sudo visudo

    this will give the following script,

    root ALL= (ALL:ALL) ALL


    see the command pattern and add your new user ,
          root ALL= (ALL:ALL) ALL

          newuser ALL= (ALL:ALL) ALL

HOW TO UNLOCK SUPERUSER AND LOGIN AS ROOT IN Ubuntu

HOW TO UNLOCK SUPERUSER AND LOGIN AS ROOT

To unlock root us the following command,


  1. sudo password root

    you will be asked to enter password root password two times.
  2. Then unlock root user by following command

    sudo password -u root
  3. To lock it again use the following command

    sudo password -l root
  4. To login as root use the following command

    su root

    you will be asked for given root password
  5. To login interactively use the following command

    sudo -i

    username:  root
    password : ********

Wednesday, 17 August 2016

HOW SET IP OF WLAN INTERFACE UBUNTU 14.04

HOW SET IP OF WLAN INTERFACE UBUNTU 14.04

  1. First goto path /etc/network open file by typing
    sudo nano /etc/network/interfaces
     you will see the following,

    auto lo
    iface lo inet loopback
    auto eth0
    iface eth0 inet dhcp

    Change these settings and add the following line script,

    remove the eth0 lines and add wlan0 config commands,

    allow-hotplug wlan0
    auto wlan0
    iface wlan0 inet dhcp
    wpa-ssid "MYFI"
    wpa-psk "Passwd"
  2. Restart network anagement by typing following command script,

    sudo service network-manager restart
    sudo service networking restart
    sudo service resolvconf restart

    we can also try commands,

    sudo ifacedown wlan0
    sudo ifaceup wlan0
  3. If you want to add static wlan ip write the following lines,

    allow-hotplug wlan0
    auto wlan0
    iface wlan0 inet static
    address x.x.x.x
    netmask x.x.x.x
    network x.x.x.x
    boradcast x.x.x.x
    gateway x.x.x.x
    wpa-ssid "MYFI"
    wpa-psk "Passwd"

    save these configurations in interfaces file.
  4. Now after writings command script restart the network management service

    sudo service network-manager restart
    sudo service networking restart
    sudo service resolvconf restart

    sudo ifacedown wlan0
    sudo ifaceup wlan0

    check ip address by ifconfig -a









Monday, 15 August 2016

HOW TO SET IP ADDRESS IN UBUNTU 14.04

HOW TO SET IP ADDRESS IN UBUNTU 14.04

To set ip address in ubuntu using terminal we have to do three things.
  1. Disable graphical management of network connection edit file use the command sudo gedit /etc/NetworkManager/NetworkManager.conf . Do changes like comment out the line dns=dnsmasq using hash (#) sign. secondly change line which says managed=false to managed=true.
  2. Gather information about the static ip (interface, ip to be used , subnet-mask, gateway, DNS). Use the ifconfig -a command to check about the details.
  3. Modify network interfaces to be used goto location /etc/network/ edit give details in file interfaces. Use the following command
  4. sudo gedit /etc/network/interfaces write the following

    auto lo
    iface lo inet loopback
    auto eth0
    iface eth0 inet static
    address x.x.x.x
    netmask x.x.x.x
    gateway x.x.x.x
    dns-nameservers x.x.x.x
  5. Restart ubuntu networking services using the following commands,

    sudo service network-manager restart
    sudo service networking restart
    sudo service resolvconf restart

    This will restart ubuntu network services. you can confirm given ip address using ifconfig command.
  6. You can also make network interface up and down using command,
     sudo ifconfig eth0 down
     sudo ifconfig eth0 up
  7. To check gateway use the command ip route show
  8. To find netmask / subnet use the command ifconfig <iface> | grep mask
  9. DNS is like and index used to resolve hostname to an ip address. Use google public DNS ip addresses 8.8.8.8 8.8.4.4 we can use our your router ip if it does dns lookup and gateway router ip address.

Wednesday, 20 July 2016

MOUNTING DRIVES ON RASBERRY Pi DEVICE

Mounting Dirves in linux rasberry pi

If you want to use flash drive and disk you need to mount the drive in linux manually to that use the following reference commands.

pi@rasberrypi ~$ cd /dev

pi@rasberry /dev$

pi@rasberry /dev$ ls

pi@rasberry /dev$ df

pi@rasberry /dev$

we need see system messages to find out if the device has made available

pi@rasberry /dev$ tail -f /var/log/messages

pi@rasberry /dev$

pi@rasberry /dev$ sudo fdisk -l

to mount this usb drive we need to make a mount point

goto /mnt

pi@rasberry /dev$ cd /mnt

pi@rasberry /mnt$

pi@rasberry /mnt$ sudo mkdir usbstick

pi@rasberry /mnt$ sudo mount /dev/sda1 /mnt/usbstick

The above will mount usb drive for root user , but we need to give permissioin to user pi

we do this like this

pi@rasberry /mnt$ sudo mount -t vfat -o uid=pi,gid=pi /dev/sda1 /mnt/usbstick

goto the drive

pi@rasberry /mnt$ cd /mnt/usbstick

pi@rasberry /mnt/usbstick$ ls -lap

pi@rasberry /mnt$ cd /mnt

pi@rasberry /mnt$ sudo umount /mnt/usbstick

pi@rasberry /mnt$ sudo umount /dev/sda1

for different file system use the following

for windows drive use the following command

pi@rasberry /mnt$ sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/sda1 /mnt/usbstick

pi@rasberry /mnt$

for mac drives use the following mounting command

pi@rasberry /mnt$ sudo mount -t hfsplus -o uid=pi,gid=pi /dev/sda1 /mnt/usbstick

you need to install hfsplus support on pi linux to do that use the following command

pi@rasberry /mnt$ sudo apt-get install hfsplus hfsutil hfsprogs



























LINUX PARTITIONING AND FORMATING IN LINUX SHELL

Linux Partitioning and Formatting in filesystems for Disk Use the following Commands


pi@rasberrypia ~$ fdisk
pi@rasberrypia ~$ man fidsk
pi@rasberrypia ~$ sudo fdisk -l
pi@rasberrypia ~$ sudo fdisk /dev/sda
Command (m for help):m

Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty dos partition table
p print the partition table
q quit without saving changes
s create a new empty sunlabel
t change a partitions systems id
u change display / entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

User the above options to create new partition in /dev/sda
After creating partitions to the drive use w to write changes made to disk

To Format Use the following commands

pi@rasberrypia ~$ sudo mkfs -t ext4 /dev/sda1

 ext 4 linux file system

User the following commands to mount the partition

pi@rasberrypia ~$ cd to /mnt

pi@rasberrypia  /mnt$

pi@rasberrypia  /mnt$ sudo mkdir part1 part2

now mount drives to these created directories

pi@rasberrypia /mnt$ sudo mount /dev/sda1 /mnt/part1

now it by going to the part1 directory and creating a file

pi@rasberrypia  /mnt$ cd part1

pi@rasberrypia  /mnt/part1$ sudo touch test1

pi@rasberrypia  /mnt/part1$ ls -la

to unmount use the following commands

pi@rasberrypia /mnt/part1$ sudo umount /dev/sda1

to Format a Fat32 created Disk Partition Use the following commands

pi@rasberrypia ~$ sudo mkfs apt-get install dostools

Format disk partition sda1 in Fat32 file system Use the following command

pi@rasberrypia ~$ sudo mkfs -t vfat /dev/sda1

we can also make partitions to disk using graphical user interface

sudo apt-get update

sudo apt-get install gparted

run

sudo gparted























Monday, 11 July 2016

LINUX PARTITIONING COMMANDS

To Partition a drive in linux use the following commands,

1. fdisk

use ' man fdisk ' to find about the format of this command

2. sudo fdisk -l

This will give you information about the disc.

3. To change partitions on the drive to make it a native linux type partition from FAT to linux type

goto

sudo fdisk /dev/sda

we are going to work with sda main device

command line will come type m to check options

to print partition tables on this drive type p

to change first delete the windows partition

press d to delete it

to verify type p

now create the new linux type partition type n

now type p to make it primary

now type the size of the partition

type +4G

type p to verifty the partition

now enter n

type also primary this will be primary partition

type partition no.

and default size of the partition if you dont want to or dont have anymore size left

now type p to verify

now type w to alter the partition

sudo fdisk -l

now we will see two partition

now to make file system ext4

use mkfs command

now type

sudo mkfs -t ext4 /dev/sda1

this will format the file system

now do the same for sda2 partition

sudo mkfs -t ext4 /dev/sda2

now we need to mount them

change to /mnt directory

cd /mnt

make two directories name them part01 and part02

sudo mkdir part01 part02

mount sda1 and sda2

for super use root use

sudo mount /dev/sda1 /mnt/part1

for specific user pi

sudo mount -o gid=pi, uid=pi /dev/sda1 /mnt/part1

for second one

sudo mount /dev/sda2 /mnt/part2

to create a file in part 1

cd part1

sudo touch test1

to check

ls -la

this show a file is created in part1 partition

to unmount a partition use

sudo unmount /dev/sda1

sudo unmount /dev/sda2

this will unmount the partition for super user root




















Sunday, 3 July 2016

LINUX FILE SYSTEM AND COMMAND LINE UNDERSTANDING

Unix Command Line Interface

To get around Unix / Linux file system we use the following commands.
But first look at the following Linux file structure,

most files in Linux are stored in directory hierarchy shown here,

                                        root       /
                                                     |
                ----------------------------------------------------------
                 home       usr            etc        bin            var          
                    |              |                 |                            |
                   Pi            bin             X11                     log



for example we have command line,

pi@raspberrypi ~ $  

home directory is

/home/pi

to find home directory use     whoami

to find present working directory use     pwd

to get back to home folder use teldar key    cd ~

to change directory use      cd /   (forward slash)  to goto root directory

to change to etc use    cd /etc

etc  store many of the system configuration files

to see the contents of etc use "  ls  "   list command

list command has certain options

ls -a  list all system files including the hidden files

ls -l will list all files length wise in a directory

ls -p will show a slash after directory so we can easily distinguish a file

from a directory

ls --color will show the types of files via color

to combine more than one option we can use " ls -lap"  option this will

combine all the previous option in one command

to take us back one directory use command " cd . . "

to take us back two directories use command " cd .. / .. "

single dot represent one current directory "  cd . "

to list the root directory component use

to root then type   ls  list command

/bin

this root folder is for commands and binaries

/sbin

sbin is for systems and admin commands

/usr

has usr related stuff it also has its own usr/bin and usr/sbin folder

/var

/var stands for variable it also has var/log folder

/home

is user directory

/mnt

this is for mount this for mounting any external drive we can even mount

folders

/dev

device interfaces for any hardware

/lib

this for programs and libraries

To make a directory
===============

use mkdir dir1

To remove a directory
=================

use rmdir dir1

this will throw an error if their is some file in the directory

but if you know what you are doing then you can do the following,

to create file in the directory use touch command

touch test

to remove and directory that contains file contents use

rmdir -rf dir1

r and f options

r stands for do the removing recursively drilling down the sub files you want to remove

f stands for force this to happen

Moving and copying files and directories
===============================

Use the cp command to copy

create a file

touch filename1

then use cp to copy one file to second file

cp filename1 filename2

To move a file from one file location to other use

mv filename1 filename2

to copy host files in etc to home/pi use

cp /etc/hosts /home/pi

to rename it use

cp /etc/hosts /home/pi/localhost

cp will work but mv will not work because user pi doesn't have permission

to modify files in etc directory

cp -R dir1 dir2

this will copy everything in this folder and beneath it

If you want to find out man command

man mv

Saturday, 18 June 2016

USEFUL LINUX COMMANDS AND DESCRIPTIONS

Linux Useful commands





LINUX UBUNTU DOMAIN JOINING SOFTWARE APP

Use Domain software tool likewise open to join a Linux system to a Microsoft windows domain. Install likewise open in linux. Use the following Linux commands in interface,

likewise open

open add/remove software tool

mark likewise -open5

likewise-open5-gui

winbind     used for installation

cli

centrify dc

domain example.net                \\this is the domain name

from command terminal

sudo domain-join-cli join example.com

restart domain

sudo /etc/init.d/ likewise-open restart

to leave domain

sudo domain-join-cli leave

client

sudo apt-get install openssh-client
server
sudo apt-get install openssh-server

--------------------------------------------------------------
How to install likewise open in linux use the following commands

sudo apt-get install likewise-open
likewise open package
/usr/bin/domainjoin-cli
sudo domainjoin-cli join example.com administrator
sudo /etc/init.d/likewise-opent restart
to leave
sudo domain-join-cli leave
if client have problem in joining add DNS
/etc/resolv.conf
nameserver 192.168.0.1
sudo add-apt-repository

--------------------------------------


For ip address configuration on interfaces in Linux user the following commands,

sudo vi /etc/network/interfaces
edit
auth0 eth0
      ifadd  eth0 inet static
      address 192.168.5.249
      mask     255.255.255.0
      network 192.168.5.0
      broadcast  192.168.5.255
      gateway 192.168.5.1
sudo vi /etc/resolv.conf

     nameserver 192.168.5.254
     nameserver 8.8.8.8
     nameserver 192.168.7.254

------------------------------------------------------
How to install Open fire collaboration chatting server in Ubuntu Linux


sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-software-properties
sudo add-apt-get-repository ppa:webupd8team/java
sudo apt-get update
check java version
#java -version
remove openJDK
sudo apt-get remove --purge openjdk*
install java oraclejava7

sudo apt-get install oracle -java7-installer

install Mysql Database server
sudo apt-get install mysql-server
create new MySQL database of openfire
login to mysql server as root
sudo mysql -u root p
create the database
"dbopenfire", add new user "openfire" and add new password "openfirepwd" for user "openfire"

to change root password

mysqladmin -u root -p password
current password
new password
service mysql stop/start

download openfire chatting and communication server software

create database

download openfire
cd /tmp
/tmp#wget http://download.igniterealtime.org/openfire/openfire_3.7.1_all.deb
install
sudo dpkg -i openfire_3.7.1_all.deb
reboot init 6
edit init.d
/etc/init.d/openfire
line 27
replace java-6-sum with java-7-oracle
sudo apt-get install rpl
sudo rpl '6-sun' '7-oracle'
/etc/init.d/openfire
sudo service openfire start
allow ports for openfire
sudo ufw allow 9090/tcp














Friday, 17 June 2016

Remove DHCP Client in Linux Ubuntu

to remove dhcp client use the following

sudo apt-get remove dhcp-client

sudo /etc/init.d/networking restart

to add linux repository

sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/saucy universe multiverse

sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/saucy-updates universe multiverse"

we can check

in file

/etc/apt/sources.list

deb http://archive.canonical.com/ubuntu saucy partner deb-src http://archive.canonical.com/ubuntu saucy partner


INSTALL GUI IN LINUX UBUNTU AND ASSIGN STATIC IP ADDRESS

To install GUI in linux ubuntu use the following commands,

sudo apt-get update
sudo apt-get install ubuntu-desktop
sudo apt-get install --no-install-recommends ubuntu-desktop
start x
----------------------------------------------------
sudo apt-get install xubuntu-desktop
sudo apt-get install kubuntu-desktop
-----------------------------------------------------

to chance ip address in ubuntu use the following commands,

sudo vi /etc/network/interfaces

for automatic we can use

auto etho

to assign an ip to interface use

iface etho inet static

address 0.0.0.0  
netmask 0.0.0.0
network 0.0.0.0
boradcast 0.0.0.0
gateway 0.0.0.0


DNS

sudo vi /etc/resolv.conf

on the line name server xx.xx.xx.xx
replace the x with the ip of your name server. you can do,
ifconfig/all to find out what they are.







Linux Partitioning Disk & Formatting commands

Linux Partitioning Disk & Formatting commands fdisk man fdisk pi@rasberrypi ~$ sudo fdisk -l