Friday, July 26, 2013

Common Linux Command

tar -czvf myarchive.tgz mydirectory/

tar -xzvf mystuff.tgz

mount cdrom
wodim --devices : find the cdrom device
 if wodim not found : apt-get install cdrecord
mkdir /media/cdrom  
mount -t iso9660 /dev/scd0 /media/cdrom : mount cdrom
mount -t iso9660 /dev/hdc /media/cdrom0/  : mount audio cd
kill gnome screen saver :
 ps -ef | grep amanda | grep gnome-screensaver
 kill -9 {screen saver id}
logout user from gnome :
   pkill -u username   
1. arch

This command will show you the architecture of your system.

2. uname-m

This is another command to view the architecture of the system.

3. uname-r

This command is used to check the kernel version that is being used in the system.

4. dmidecode-q

This command give you the hardware components in your system.

5. hdparm-i / dev / hda

This is the command that shows the characteristics of your hard disk.

6. hdparm-tT / dev / sda

This command is used in order to conduct tests readings on hard drives.

7. cat / proc / cpuinfo

These commands can help you in getting CPU information.

8. cat / proc / interrupts

These commands are used to interrupt a process.

9. cat / proc / meminfo

This command verifies the memory usage in your system.

10. cat / proc / swaps

These commands are used in order to swap files.

11. cat / proc / version

These three commands can display the kernel version for your system.

12. cat / proc / net / dev

These four commands are used to view the network adapters and display statistics of the system.

13. cat / proc / mounts

This command shows you the mounted file system.

14. lspci-tv

If you need to view the PCI display devices then this is the command to use.

15. lsusb-tv

This is the command for displaying USB devices.

How to use tcpdump to detect Network Port Traffic
tcppdump dst and tcp port 587
tcpdump port 80tcpdump -i eth0
tcppdump -i eth0 dst port 25

Ubuntu New Installation & moving from previous ver

Ubuntu Clean Installation & moving data

1. Install lamp
   apt-get install tasksel
2. Moving /var/www
2. Moving database

     a. Stop mysql service
         sudo /etc/init.d/mysql stop
     b. Backup current database
         cp -Rp /var/lib/mysql /var/lib/mysql.backup
     c. Copy the database
         cp -Rp /mountpoint/var/lib/mysql /var/lib/mysql
     d. Start mysql service
         /etc/init.d/mysql start

    cp /etc/my.cnf  or /etc/mysql/my.cnf 

3. Install & moving FTP
    apt-get install vsftpd
mkdir /srv/ftp
usermod -d /srv/ftp ftp 
/etc/init.d/vsftpd restart
vi                 /etc/vsftpd.conf
touch /etc/vsftp.chroot_list 
vi /etc/vsftp.chroot_list

service vsftp restart
create user
useradd  it
usermod -d /home/it/ftp it
usermod -G ftp,it it
4. Moving vitualbox
 apt-get install virtualbox
cp /home/vm/xp_pro.vdi

5. Install Teamviewer

6. Moving Thunderbird
cp -Rp /home/fadabi/.thunderbird /home/new/

10.  Copy firefox
cp -Rp /home/fadabi/.mozila/firefox/*.default /home/fadabi/.mozila/firefox/
vi profiles

7. Moving Mysql database
/etc/init.d/mysql stop
cp -Rp /var/lib/mysql /home/newdb
rm /home/newdb (to remove file, leave only dir)
vi /etc/mysql/my.cnf  (chang to new datadir to /home/newdb)

8. Install teamviewer

9.Install virtual box
apt-get install virtualbox
cp -r /old/vmbox /new/vmbox

Ubuntu Essential Application / Program

Ubuntu essential application / program

tasksel is a Debian/Ubuntu tool that installs multiple related packages as a co-ordinated "task" onto your system.
    • apt-get install tasksel

chgrp www-data /var/www/html/
chmod 775 /var/www/html/

logs files


gedit /etc/apt/sources.list
deb maverick partner
deb-src maverick partner
apt-get update
apt-get install skype
Installing TeamViewer on Ubuntu 10.10
#1 : Download the *.deb package/installer from the website.
teamviewer for ubuntu 10.10

#2 : Open the downloaded file with Ubuntu Software Center and click on install to proceed.
#3 : Wait for the installation to complete,then go to Applications->Internet->TeamViewer 6.
apt-get install wine
link http folder
mv nedi /opt/
ln -s /opt/nedi/html/ /var/www/
apt-get install filezilla
apt-get install youtube-dl
youtube-dl "URL"
youtube-dl ""
apt-get install gimp
hack your website with nitko
apt-get install nikto
(after host you can put host name or IP address of the target web server)
-port : TCP port(s) to scan.You can put by using comma e.g (80,443) or by giving the range of port such as (80-100)
-cgidirs : For scanning specified cgi directories.
-dbcheck : Check the scan databases for syntax errors.
-update : Updates the plugins and databases fr0m
-tunning : this option is used to tune the scan test against the target.
-format : It is used to specify the file format of the output.
apt-get install acroread
web dev tool quanta
apt-get install quanta
calibre – book library
apt-get install calibre
setting up ftp
apt-get install vsftpd
change ftp dir
mkdir /srv/ftp
usermod -d /srv/ftp ftp 
/etc/init.d/vsftpd restart
To configure vsftpd to authenticate system users and allow them to upload files edit /etc/vsftpd.conf
/etc/init.d/vsftpd restart
notepad++ equivalent
apt-get install scite

alias sagi='sudo apt-get install'

Mysql Workbench
apt-get install libctemplate0 libzip1 python-pysqlite2 mysql-client python-crypto python-paramiko
dpkg -i mysql-workbench-gpl-5.2.27-1ubu1004-i386.deb

install Internet explorer
vi /etc/apt/sources.list
deb feisty universe
eb edgy main
apt-get update
Install mysql work bench 
  apt-get install mysql-workbench    

poEdit is gettext catalogs editor, also known as .po files.  
apt-get install poedit     

Ubuntu clean up apt :
sudo apt-get clean 
sudo apt-get update 
sudo apt-get upgrade     
sudo rm -rf /var/lib/apt/lists 
sudo mkdir /var/lib/apt/lists 
sudo mkdir /var/lib/apt/lists/partial

Tuesday, July 9, 2013

Orangehrm 3.x : Adding new fields

For adding a new field in personal details u should add some changes to the following files also:

1. ViewPersonalDetailsSuccess.php (symfony->plugins->orangehrmpimplugin->modules->pim->templates)
2. BaseEmployee.class.php (symfony->lib->model->doctrine->base)
3. BaseEmployeeForm.class.php (symfony->lib->form->doctrine->base)
4. EmpInfo.php (lib->model->hrfunct)
5. EmployeeDao.php (symfony->plugins->orangehrmpimplugin->lib->dao)
6. EmployeePersonalDetailsForm.php (symfony->plugins->orangehrmpimplugin->lib->form)
7. EXTRACTOR_EmpInfo.php (lib->extractor->hrfunct)

And also add corresponding field in database (hs_hr_employee)