General Commands

When NTFS is not successfully mounted, then run this command
sudo ntfsfix /dev/sda5

……………………………

Linux Packages:
http://pkgs.org/

gedit .bashrc
source .bashrc
……………………………
changing passowd of root
sudo passwd root
……………………………

sudo apt-get update
sudo apt-get install abc
……………………………

sudo apt-get install ssh
sudo apt-get install samba
sudo apt-get install samba-common

sudo rm /root/.ssh/known_hosts
……………………………………………..

sudo apt-get install gedit
……………………………………………..
……………………………………………..

Normal Copy
cp source destination
cp dir1 dir2
cp -option source destination
$ cp -r dir1 dir2
The -r option if you want to copy a directory with its contents. The -r means “copy recursively”
……………………………………………..
To Remove Data
rm dir1
rm -r dir1
The -r option if you want to remove a directory with its contents. The -r means “copy recursively”
……………………………………………..
To Move Data From On Place to Another or rename folder/file name

mv source destination
mv dir1 dir2
……………………………………………..
Secure Copy:

To copy File:
scp /home/local_username/mydroid remote_username@192.168.2.15:/home/work

To copy Folder:
scp -r /home/local_username/mydroid remote_username@192.168.2.15:/home/work
or
scp -r /home/local_username/mydroid remote_username@192.168.1.6:/home/../media/Personal\ Data_/bahar

……………………………………………………

Checking 32 or 64 bit Operating System Ubuntu
getconf LONG_BIT
……………………………………………………

mIRC:
First Enter NickName, Alternate Name.
for Registeration

/msg nickserv register
/msg nickserv register baharal sparlay_pk@hotmail.com or /msg NickServ@services.dal.net register baharal sparlay_pk@hotmail.com

Password will be sent to your email,

freenode->
Random Server.

If you are register then:
/nickserv identify
/nickserv identify BaharIMS baharal

Now Go to Tool and select channel from channellist. i.e. android-dev, android, ….
_________________________________________________

cd /usr/local/lib/python2.6/dist-packages/openerp-server/addons/base_report_designer/wizard/tiny_sxw2rml/

/usr/local/lib/python2.6/dist-packages/openerp-server/addons/base_report_designer/wizard/tiny_sxw2rml$ python tiny_sxw2rml.py attendance_session_program_semester_subject_report.sxw > attendance_session_program_semester_subject_report.rml

_________________________________________________
Command to Search inside file:
sudo grep -i -n -r ‘mytext’ /home/

will search ‘mytext’ in files of folder home.
_________________________________________________

DBAMP Project Commands Sequence

Goto /lib/modules/2.6.31-22-generic/kernel/drivers/char/tpm
1. sudo insmod tpmd_dev.ko (tpm starts)

2. tpmd -d -f
(if step 2 gives error then: sudo rm /var/run/tpm/tpmd_socket:0)
3. tcsd start. (Trouser Starts)
(tcsd status Checking for service tcsd z running )
4. cd /home/baharali/Desktop/tpm_emulator-0.7.1
then
./build.sh
_________________________________________________

ASP.NET
Registering SQL
C:\Windows\Microsoft.NET\Framework\v2.0.50727>Aspnet_regsql.exe
_________________________________________________

Inter Process Communication
http://code.google.com/p/openmobster/wiki/InterAppCommunication
_________________________________________________

Aft upgrating ubuntu VirtualBox does not run OS properly to solve this problem

Add this line to .bashrc, this will run this command whenever Ubuntu is started.
/etc/init.d/./vboxdrv.dpkg-bak setup

or

run this command, but it will make VM to run OS only once.
/etc/init.d/./vboxdrv.dpkg-bak setup

_________________________________________________

How to findout IP of Anroid Phone.
Go to
Dev Tool -> Terminal

Enter the following commands
su
ifconfig eth0
_________________________________________________

How to view .trace file using Traceview: A Graphical Log Viewer

Go to
android-sdk -> tools
Enter command
./traceview /home/baharali/Desktop/ab/calc.trace

_________________________________________________

Using the Traceview graphical log viewer tool

The Traceview graphical log viewer tool is useful for viewing the execution logs of an application and for application performance profiling.
To use this tool effectively, select the program area or piece of code that you want to monitor or profile. Enclose the code with the following statements.

// start tracing to “/sdcard/mymethod.trace”
Debug.startMethodTracing(“calc”);

// … Code goes here

// stop tracing
Debug.stopMethodTracing();

These statements instruct Android to create the “tracefile” in the specified location.

$ traceview mymethod

How to view .trace file using Traceview: A Graphical Log Viewer
Go to
android-sdk -> tools
Enter command
./traceview /home/baharali/Desktop/ab/calc.trace

_________________________________________________

chown is used to change user and/or group ownership of files/directories.

To change the user ownership of the directory some-directory to baharali, type:
chown baharali addons/

To recursively change any sub-directories and their contents, type:

chown baharali -R addons/

Actually Ubuntu got a firewall it self named uncomplicated firewall. For any reason you have problem with the firewall means you can simply disable it by running:

sudo ufw disable

Tip: By adding a colon after the user, chown can be used to change the group and user ownership simultaneously, type:

chown user:group -R addons/
chown baharali:baharali -R addons/
sudo chown baharali:baharali -R /usr/local/lib/python2.6/dist-packages/

To recursively change permission to (read/write) any sub-directories and their contents, type:
chmod 777 -R addons/

sudo chmod 777 -R /usr/local/lib/python2.6/dist-packages/

chgrp is used to change group ownership of files/directories. For example:
To change the group ownership of the directory some-directory to group1, type:
chgrp group1 some-directory
To recursively change any sub-directories and their contents, type:
chgrp group1 -R some-directory/

http://www.forwestmedia.com/resources/how-to-guides/linux-file-permissions/

________________________________________________________________________________________________

sudo nano /etc/default/grub
Then look for “GRUB_TIMEOUT=…”. Does it have a number other than “10” next to the equal sign?

If so, change it to “10” or whatever suits you

sudo update-grub
________________________________________________________________________________________________
Change Username

Run the commands create a new password for the root account.

sudo passwd root

Next, run the commands below to unlock the root account.
sudo passwd -u root

After unlocking it, log out and login as the root user from the logon screen.

When it opens run the commands below to change your username.
usermod -c “BaharAli” -l baharali khan

When you have done, lock the root account again and restart.
passwd -l root

Change Group of User
groupmod -n baharali khan
______________________________________________________________________________________________

Ubuntu Password Recovery
Step 1: Select Unbutu Load
Step 2: Press E
Step 3: Then write Single after ….
Step 4: Press Ctrl + X
Step 5: Start
Step 6: Select root, change it Password
Step 7: Now login using root [init to directly go to GUI of root]
_______________________________________________________________________________________________

Switch between console mode and GUI Mode

Ctrl + Alt + F7
OR
Enter Command
startx
OR Try
init 1, init 2, init 3, init 4, init 5(GUI Mode)
_______________________________________________________________________________________________

sudo mkdir /mnt/sharename\A0
sudo chmod 777 /mnt/sharename\A0
sudo mount -t vboxsf -o uid=1000,gid=1000 Example-Shared-Folder /mnt/sharename
ln -s /mnt/sharename $HOME/Desktop/sharename

Note1: ln -s /mnt/sharename $HOME/Desktop/sharename is used for creating shortcut on Desktop.

Note2: if you want to mount the folder as owned and writable only by root, omit the\A0 -o uid=1000,gid=1000\A0 option to the mount command.

For the above command if you get error as

mount: unknown filesystem type ‘vboxsf’

Then just change the\A0vboxsf\A0to\A0vboxfs

If error persist install virtualbox guest utils:

sudo apt-get install virtualbox-ose-guest-utils\A0

end reboot the virtual machine.

To ensure the shared folder is mounted whenever your virtual machine is booted, run the following command:\A0sudo nano /etc/rc.local\A0and enter the command you entered in the last step (without the sudo in front) into this file below the hashes (i.e., #’s) but above \93exit 0\94 (note that the arrow keys move the cursor and ctrl+x is used to exit which will prompt you to save first, answer Y, then hit Enter)

sudo mount -t vboxsf -o uid=1000,gid=1000 Example-Shared-Folder /mnt/sharename

_______________________________________________________________________________________________

Enable Apache Server : Localhost in Ubuntu

Step 1. sudo gedit /etc/apache2/sites-available/default
Setp 2. Change
Redirect / https://openerpweb.com/
To
Redirect /open https://openerpweb.com/

Step 3. sudo /etc/init.d/apache2 restart

Setp 4. Remove Secruity from folder.
sudo chmod 777 -R /var/www/data_migration/

_________________________________________________________________
chmod 777

0 = —
1 = –x
2 = -w-
3 = -wx
4 = r–
5 = r-x
6 = rw-
7 = rwx

To Find Folder Permissions.

stat -c %a /opt/
_________________________________________________________________

You can simply disable Firewall
sudo ufw disable

___________________________________________________________________
Connecting to Server using SSH:
ssh baharali@172.16.30.38
___________________________________________________________________
Mounting Network Drive:
Before mounting install nfs
sudo apt-get install nfs-common
sudo mount.nfs 172.16.100.5:/DataVolume/erp-backup /mnt/nas-drive

You have done
________________________________________________________________

Searching previous Command, containing some text.

To search command (tailf /var/log/openerp-server/erp.log)

Command contain “.log” text, thus to search it, command will be;

baharali@baharali:~$ history | grep .log

Advertisements