Howto Format Hard Disk on Linux Console

Filed in Linux System Leave a comment

1. Use “fdisk /dev/path-to-your-device” to create new partition
2. “mkfs.ext4 /dev/cciss/c0d1p1″ to create new file system
3. “blkid” to find hard disk UUID
4. Edit “/etc/fstab” to permanently add your new partition
5. Restart server

 

Hard Disk Tune Overriding:

This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

 

Process Management

Filed in Linux System Leave a comment

Check certain process:
ps aux | grep <keyword>

Check what files are being used by a process:
lsof -p

Kill a process
kill -9 <pid>

Package Management

Filed in Linux System Leave a comment

Prevent a package to be installed, upgraded, or removed:
aptitude install <package>=

Reconfigure broken package configuration:
It’s a handy tool if you have libapache2-mod-suphp and libapache2-mod-php installed, but you want to remove one of them, because sometimes Apache doesn’t know what you prefer; PHP or SuPHP.
dpkg-reconfigure <package>

Download a package without install:
apt-get -d install <packageName>

Make A New Partition with FDisk

Filed in Linux System Leave a comment

Assume we have /dev/sda:
1. fdisk /dev/sda
2. Create a new partition: type ‘n’
3. Choose logical or primary partition: type ‘l’ or ‘p’
4. Set the size you want,
5. Write the changes you have made: type ‘w’
6. Exit from fdisk, then make a new file system, for example: mkfs -t ext4 /dev/sda3

Secure Shell – SSH

Filed in Linux System Leave a comment

Dynamic Port Forwarding :

ssh -D 1080 aji@proxy2.bpk.go.id

Date and Time

Filed in Linux System Leave a comment

Set localtime:
#ln -sf /usr/share/zoneinfo/Asia/Jakarta /etc/localtime

Check timezone:
#cat /etc/timezone

Check date and timezone:
#date -R

Using update-rc.d

Filed in Linux System Leave a comment

Remove a service from all runlevel:
update-rc.d -f ssh remove

EXTENDING PHP WITH PHP-GTK

Filed in Information Technology | Linux System Leave a comment

We can use PHP to make a desktop application, by adding GTK extension. These are what we have to do:
1. Prepare the file
Requirement:
- checkinstall
- php5-cli (PHP5 Command Line Interface)
- php5-dev
- libglib2.0-dev
- libgtk2-dev
Download PHP-GTK-20.beta.tar.gz
Continue Reading

Tips for Bash

Filed in Information Technology | Linux System Leave a comment

$ echo {{1,2,3},1,2,3}
1 2 3 1 2 3

$ echo {{1,2,3}1,2,3}
11 21 31 2 3

Continue Reading

Creating application based on PHP-GTK (Scratch)

Filed in Information Technology | Linux System Leave a comment

Requirements:

  • Ubuntu Gutsy Gibbon
  • Additional programs: checkinstall, PHP5, PHP-Devel

Compiling and Installing

  1. Install libgtk2.0-dev and its required packages.
  2. Download PHP-GTK (I use PHP0-GTK 2.0) and then compile it:
    ./buildconf
    ./configure
    make

    If you are asked for phpize, then it means you have to install php-devel.

  3. Continue Reading

TOP