Saturday, 27 September 2008


Download hylafax (in this moment the current version is hylafax-4.1.7.tar.gz), such as root
user unzip it and install it:
tar zxvf hylafax-4.1.7.tar.gz
/configure && make && make install
All files will be copied here:
Turn-on the modem.
Once installed like root user start from xterm:
faxsetup and once completed, launched:
Will be required some informations, you will can change them later going to modify files that
you find in /var/spool/hylafax/etc, overall files config and config.ttySx
My file config is composed like that:
LogFacility: daemon
CountryCode: 039
AreaCode: 0583
LongDistancePrefix: 0
InternationalPrefix: 00
DialStringRules: etc/dialrules
ServerTracing: 1
My file config.ttyS1 is composed at least at start like that:
CountryCode: 039
AreaCode: 0583
FaxNumber: 12345678 # I've changed my number of telephone.
LongDistancePrefix: 0
InternationalPrefix: 00
DialStringRules: etc/dialrules
ServerTracing: 1
SessionTracing: 11
RecvFileMode: 0600
LogFileMode: 0600
DeviceMode: 0600
RingsBeforeAnswer: 3
SpeakerVolume: on
GettyArgs: "-h %l dx_%s"
LocalIdentifier: "NothingSetup"
TagLineFont: etc/lutRS18.pcf
TagLineFormat: "From %%l|%c|Page %%P of %%T"
MaxRecvPages: 25
Perfect, now you have only to write at the end of file /etc/inittab the following string:
mo:35:respawn:/usr/local/sbin/faxgetty /dev/ttyS1 # I've my modem on com2 and hence ttyS1
If you want able all clients of your lan and send fax modify the file:
writing how is following:
192.168.1 #I have the computer with ip and hence the lan of belonging will be
how I've written.
Now is possible send fax writing:
hylafax start && faxmodem ttyS1
You can insert this string at the end of file /etc/rc.d/rc.local so, it will be sent at restart of computer without doing write the row every time.
To send a fax write:
sendfax -n -d telephonenumber file
If you want use a graphic client on linux, download gnu.hylafax (works on java), or
(works on python) or for computers with Windows Operating System download Whfc or
About pyla, you need to unzip it (tar zxvf pyla1.0.7.tgz) and to launch it, write:
python /yourhome/pyla/


Thanks to Antonio Mori :
The procedure of damn small linux, a distro based on debian of 50 mb with many fundamental
programs that you find inside big distros.
This is the procedure of installation in few steps, anyone can do it.
1) Copy iso of damn small linux after having downloaded from official web-site on a cdrom
2) Insert you usb stick in your pc, you need only a pen of 128 mb
3) Insert cd with the isd of damn small linux into computer and start it on boot from cdrom
4) On desktop of damn small linux click in a empty point with right bottom of mouse
5) Apps>>Tools>>Install to USB pen drive>>For USB-HDD Pendrive
at this point, it will be required the name device stick, digit sda at the second question type of
card etc... Leave empty and pass beyond with Enter
At required of keyboard digit it and voilĂ  the procedure is done after some minutes, you'll
have the damn small linux on usb stick.
Easy no ???
Try tro believe, it's more difficult to explain that do it.
To start it from usb stick, you need only to boot from your computer is set on pen-hdd

Thursday, 25 September 2008

Postfix Setup

Postfix Admin

Postfix Admin is a Web-based management tool for Postfix. It handles Postfix-style virtual domains and users that are stored in MySQL. It has support for over 20 languages. It was initially released in December of 2002.

Downloads and Documentation


MyPFXAdmin is a set of Web-based PHP scripts that allow easy administration of a Postfix setup. It allows adding and editing of domains, aliases, and users, without direct manipulation of the database.

Downloads and Documentation


AncyraPM is a Web GUI for managing users on a Postfix system. It supports the setting of quotas, limiting POP3, IMAP, and SMTP privileges, and managing forwarding. A logging mechanism is provided.

Downloads and Documentation


MyPos is a Web-based administration tool for easy maintenence of domains, email boxes, and email aliases. It has been designed to work with postfix's maildir support (qmail style), but with some modifications it can be ported to spool dir style. It is known to work with Linux, Apache, PHP, MySQL, and postfix.

Downloads and Documentation


phpMailAdmin is a Web-based mail administration interface, designed to be a full interface to setup domains, accounts, and set password. This interface is specifically designed to work with the PostFix, MySQL, and Courier IMAP installation noted on, done by Lucas Peet



Replex is an administrative tool for managing email on any Unix-like OS. It can handle multiple domains, users, mailing lists, etc. without requiring creation of Unix user accounts for mailboxes or authentication. Replex is written in PHP4 and stores all information in a MySQL database. Replex relies on Postfix for SMTP and Cyrus for IMAP and POP3 accounts

Downloads and Documentation

Qmail Setup


QmailAdmin is a Web control panel for the administration of qmail/vpopmail-based POP, IMAP, LDAP, or Web mail accounts, forwarding, aliases, autoresponders, and mailing lists. It is perfect for ISPs, Web hosting sites, or companies that want to provide a nice interface for managing email accounts. It works with qmail, vpopmail, sqwebmail, and courier-imap.

Downloads and Documentation


qmailWebmin is a Webmin module for administrating a qmail mailserver. Its main feature is the easy virtual accounting with separated POP3 passwords. Based on work found on, it aims to be as standard as possible with a default qmail installation. This Webmin module is aimed at lazy administrators and persons with little knowledge about general UNIX administration.

Downloads and Documentation


Qadmin is an administration tool for Qmail, written in PHP and MySQL.

Downloads and Documentation


QmailAdminWeb is an admin suite for Qmail+MySQL with a Web GUI. It has the ability to add and remove users, change user's passwords, build the forwarding database, and more.

Downloads and Documentation


oMail-admin is a PHP-based Web frontend to qmail and vmailmgrd. It can be used by domain owners and single users to easily administer their mail accounts without bothering the sysadmin. Its features include mailbox/alias management, auto-responder (vacation-like) support, support for changing passwords, and translations for the French, English, Swedish, Chinese, Japanese, Spanish, Italian, Russian, Danish, Romana, Czech, Nederlands, and German languages

Downloads and Documentation

Setting SNMP

What is net-snmp ?

Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment (eg. routers), computer equipment and even devices like UPSs. Net-SNMP is a suite of applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.

Net-SNMP Tutorials

Download Net-SNMP

Net-SNMP Documentation

Installing SNMP Server in Debian

If you want to install snmp server in debian you need to install snmpd package using the following command

#apt-get install snmpd

This will complete the installation process.

Configuring SNMP Server in Debian

Default Configuration files are located at /etc/snmp directory this contains the following files.

snmpd.conf snmptrapd.conf

/etc/snmp/snmpd.conf - configuration file for the Net-SNMP SNMP agent.

/etc/snmp/snmptrapd.conf - configuration file for the Net-SNMP trap daemon.

Now we need to concentrate on snmpd.conf file for our configuration. If you want to see the default snmpd.conf file.

Before doing any changes to your /etc/snmp/snmpd.conf file take a copy of original file using the following command

#cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig

Set up the snmp server to allow read access from the other machines in your network for this you need to open the file /etc/snmp/snmpd.conf change the following Configuration and save the file.

first step

# source community
com2sec paranoid default public
#com2sec readonly default public
#com2sec readwrite default private


#com2sec paranoid default public
com2sec local localhost public
com2sec localNet /24 public
#com2sec readwrite default private

you can define the source whichever way you want like only allow from local machine for that you need to add under source and you can define your community in this case we are using public as our community.

Second Step

# Second, map the security names into group names:

# sec.model
group MyROSystem v1 paranoid
group MyROSystem v2c paranoid
group MyROSystem usm paranoid
group MyROGroup v1 readonly
group MyROGroup v2c readonly
group MyROGroup usm readonly
group MyRWGroup v1 readwrite
group MyRWGroup v2c readwrite
group MyRWGroup usm readwrite


group MyROSystem v1 local
group MyROSystem v2c local
group MyROSystem usm local
group MyROGroup v1 localnet
group MyROGroup v2c localnet
group MyROGroup usm localnet
group MyRWGroup v1 local
group MyRWGroup v2c local
group MyRWGroup usm local

Third Step

# Third, create a view for us to let the groups have rights to:

# incl/excl subtree mask
view all included .1 80
view system included

Don't chnage anything here leave this one as default setting

Final Step

# Finally, grant the 2 groups access to the 1 view with different
# write permissions:

# context sec.model sec.level match read write notif
access MyROSystem "" any noauth exact system none none
access MyROGroup "" any noauth exact all none none
access MyRWGroup "" any noauth exact all all none

Don't chnage anything here leave this one as default setting.

Optional Configuration

# System contact information

syslocation Unknown (configure /etc/snmp/snmpd.local.conf)
syscontact Root (configure /etc/snmp/snmpd.local.conf)


syslocation MainDatacenter

Now the above configuration able to access local and /24 network machines to use full functionality of MIB's this is very important if you want to collect the information from existing machines in above network.

Now you need to restart the snmp services using the following command

#/etc/init.d/snmpd restart

Now the SNMP server configuration is active and running.

Testing your Configuration

#snmpwalk localhost -c public -v1

SNMPv2-MIB::sysDescr.0 = STRING: Linux sritest 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
SNMPv2-MIB::sysUpTime.0 = Timeticks: (656698) 1:49:26.98
SNMPv2-MIB::sysContact.0 = STRING:
SNMPv2-MIB::sysName.0 = STRING: debiantest
SNMPv2-MIB::sysLocation.0 = STRING: Maindatacenter
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORID.2 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.4 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.7 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.8 = OID: SNMP-MPD-MIB::snmpMPDCompliance

If you want more options and how to use snmpd.conf file you need to check snmpd.conf man page

If you want to monitor your server or desktop machine resources like disk capacity,load,process check here

SNMP Client installation in debian

Now we have seen how to configure SNMP server in above section now we need to install client in other machines for this you need to install snmp or scli packages

#apt-get install snmp scli tkmib

This will complete the snmp client installation.


The system wide configuration file is /etc/snmp/snmp.conf check the community name is same as server if not you need to change the community name and you need to restart the snmp service.Edit the /etc/snmp/snmp.conf file and change the following settings and save the file

com2sec paranoid default public
#com2sec readonly default public
#com2sec readwrite default private

#com2sec paranoid default public
com2sec readonly public
#com2sec readwrite default private

Now you need to restart the snmp service using the following command

#/etc/init.d/snmp restart

Testing your Configuration

#snmpwalk -v 2c -c public remotemachineipaddress system

SNMPv2-MIB::sysDescr.0 = STRING: Linux sritest 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
SNMPv2-MIB::sysUpTime.0 = Timeticks: (168871) 0:28:08.71
SNMPv2-MIB::sysContact.0 = STRING:
SNMPv2-MIB::sysName.0 = STRING: debiantest
SNMPv2-MIB::sysLocation.0 = STRING: maindatacenter
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORID.2 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.4 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.7 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.8 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module to describe generic objects for network interface sub-layers
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.3 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.6 = STRING: View-based Access Control Model for SNMP.
Alternately, you can use scli,

#scli localhost

and then type in show or monitor.

This will confirm the SNMP service is active and working properly.

Command Linux

mkdir - make directories




Create the DIRECTORY(ies), if they do not already exist.

Mandatory arguments to long options are mandatory for short options too.

-m, mode=MODE set permission mode (as in chmod), not rwxrwxrwx - umask

-p, parents no error if existing, make parent directories as needed

-v, verbose print a message for each created directory

-help display this help and exit

-version output version information and exit

cd - change directories

Use cd to change directories. Type cd followed by the name of a directory to access that directory.Keep in mind that you are always in a directory and can navigate to directories hierarchically above or below.

mv- change the name of a directory

Type mv followed by the current name of a directory and the new name of the directory.

Ex: mv testdir newnamedir

pwd - print working directory

will show you the full path to the directory you are currently in. This is very handy to use, especially when performing some of the other commands on this page

rmdir - Remove an existing directory

rm -r

Removes directories and files within the directories recursively.

chown - change file owner and group




chown [OPTION] --reference=RFILE FILE


Change the owner and/or group of each FILE to OWNER and/or GROUP. With --reference, change the owner and group of each FILE to those of RFILE.

-c, changes like verbose but report only when a change is made

-dereference affect the referent of each symbolic link, rather than the symbolic link itself

-h, no-dereference affect each symbolic link instead of any referenced file (useful only on systems that can change the ownership of a symlink)


change the owner and/or group of each file only if its current owner and/or group match those specified here. Either may be omitted, in which case a match is not required for the omitted attribute.

-no-preserve-root do not treat `/' specially (the default)

-preserve-root fail to operate recursively on `/'

-f, -silent, -quiet suppress most error messages

-reference=RFILE use RFILE's owner and group rather than the specifying OWNER:GROUP values

-R, -recursive operate on files and directories recursively

-v, -verbose output a diagnostic for every file processed

The following options modify how a hierarchy is traversed when the -R option is also specified. If more than one is specified, only the final one takes effect.

-H if a command line argument is a symbolic link to a directory, traverse it

-L traverse every symbolic link to a directory encountered

-P do not traverse any symbolic links (default)

chmod - change file access permissions


chmod [-r] permissions filenames

r Change the permission on files that are in the subdirectories of the directory that you are currently in. permission Specifies the rights that are being granted. Below is the different rights that you can grant in an alpha numeric format.filenames File or directory that you are associating the rights with Permissions

u - User who owns the file.

g - Group that owns the file.

o - Other.

a - All.

r - Read the file.

w - Write or edit the file.

x - Execute or run the file as a program.

Numeric Permissions:

CHMOD can also to attributed by using Numeric Permissions:

400 read by owner

040 read by group

004 read by anybody (other)

200 write by owner

020 write by group

002 write by anybody

100 execute by owner

010 execute by group

001 execute by anybody

ls - Short listing of directory contents

-a list hidden files

-d list the name of the current directory

-F show directories with a trailing '/'

executable files with a trailing '*'

-g show group ownership of file in long listing

-i print the inode number of each file

-l long listing giving details about files and directories

-R list all subdirectories encountered

-t sort by time modified instead of name

cp - Copy files

cp myfile yourfile

Copy the files "myfile" to the file "yourfile" in the current working directory. This command will create the file "yourfile" if it doesn't exist. It will normally overwrite it without warning if it exists.

cp -i myfile yourfile

With the "-i" option, if the file "yourfile" exists, you will be prompted before it is overwritten.

cp -i /data/myfile

Copy the file "/data/myfile" to the current working directory and name it "myfile". Prompt before overwriting the file.

cp -dpr srcdir destdir

Copy all files from the directory "srcdir" to the directory "destdir" preserving links (-poption), file attributes (-p option), and copy recursively (-r option). With these options, a directory and all it contents can be copied to another dir

ln - Creates a symbolic link to a file.

ln -s test symlink

Creates a symbolic link named symlink that points to the file test Typing "ls -i test symlink" will show the two files are different with different inodes. Typing "ls -l test symlink" will show that symlink points to the file test.

locate - A fast database driven file locator.

slocate -u

This command builds the slocate database. It will take several minutes to complete this command.This command must be used before searching for files, however cron runs this command periodically on most systems.locate whereis Lists all files whose names contain the string "whereis". directory.

more - Allows file contents or piped output to be sent to the screen one page at a time

less - Opposite of the more command

cat - Sends file contents to standard output. This is a way to list the contents of short files to the screen. It works well with piping.

whereis - Report all known instances of a command
wc - Print byte, word, and line counts


bg jobs Places the current job (or, by using the alternative form, the specified jobs) in the background, suspending its execution so that a new user prompt appears immediately. Use the jobs command to discover the identities of background jobs.

cal month year - Prints a calendar for the specified month of the specified year.

cat files - Prints the contents of the specified files.

clear - Clears the terminal screen.

cmp file1 file2 - Compares two files, reporting all discrepancies. Similar to the diff command, though the output format differs.

diff file1 file2 - Compares two files, reporting all discrepancies. Similar to the cmp command, though the output format differs.

dmesg - Prints the messages resulting from the most recent system boot.


fg jobs - Brings the current job (or the specified jobs) to the foreground.

file files - Determines and prints a description of the type of each specified file.

find path -name pattern -print

Searches the specified path for files with names matching the specified pattern (usually enclosed in single quotes) and prints their names. The find command has many other arguments and functions; see the online documentation.

finger users - Prints descriptions of the specified users.

free - Displays the amount of used and free system memory.

ftp hostname

Opens an FTP connection to the specified host, allowing files to be transferred. The FTP program provides subcommands for accomplishing file transfers; see the online documentation.

head files - Prints the first several lines of each specified file.

ispell files - Checks the spelling of the contents of the specified files.

kill process_ids

kill - signal process_ids

kill -l

Kills the specified processes, sends the specified processes the specified signal (given as a number or name), or prints a list of available signals.

killall program

killall - signal program

Kills all processes that are instances of the specified program or sends the specified signal to all processes that are instances of the specified program.

mail - Launches a simple mail client that permits sending and receiving email messages.

man title

man section title - Prints the specified man page.

ping host - Sends an echo request via TCP/IP to the specified host. A response confirms that the host is operational.

reboot - Reboots the system (requires root privileges).

shutdown minutes

shutdown -r minutes

Shuts down the system after the specified number of minutes elapses (requires root privileges). The -r option causes the system to be rebooted once it has shut down.

sleep time - Causes the command interpreter to pause for the specified number of seconds.

sort files - Sorts the specified files. The command has many useful arguments; see the online documentation.

split file - Splits a file into several smaller files. The command has many arguments; see the online documentation

sync - Completes all pending input/output operations (requires root privileges).

telnet host - Opens a login session on the specified host.

top - Prints a display of system processes that's continually updated until the user presses the q key.

traceroute host - Uses echo requests to determine and print a network path to the host.

uptime - Prints the system uptime.

w - Prints the current system users.

wall - Prints a message to each user except those who've disabled message reception. Type Ctrl-D to end the message.

Tuesday, 23 September 2008

Hello World 1st Java

package helloworld;

* @author user
public class Main {

* @param args the command line arguments
public static void main(String[] args) {
System.out.println("Hello World Angelyca!!!");


untuk menjalankan ketik
java -jar HelloWorld.jar

Hello World Angelyca!!!

Array Bilangan Genap Scripts

$ vi genapArr

#declaration Variable Array
declare -a nilai
while[$i-le 4];
let isi=$i*2;
let i=$i+1;
#dengan index berisi "*" atau "@"
echo ${angka[*]};
#destroy array angka
#agar memory yang dipakai dibebaskan
unset nilai

$ ./genapArr

0 2 4 6 8

Looping Contoh Scripts di LINUX

ini contoh yang sering dapat waktu matakuliah program baik Pascal, C++, VB

$ vi cthArray

# Created : David Windarto
echo "Hasil Looping adalah"
for ((i=1; i<=5; i++))
for ((j=1;j<=i;j++))
echo -n "$i"
echo ""



Monday, 22 September 2008

Menjalankan Games JAVA Handphone di PC

Cara Menjalankan Games JAVA Handphone di PC

Yang harus Disiapkan
1. Teh Hangat
2. Kolak Pisang
3. Install Jave Envirotment di PC seperti JDK, JRE, JME
4. ini yang penting INSTALL Wireless Toolkit
5. Buat Shorcut JAR ke MDIP

slamat mencoba

Mirror Repository UBUNTU

di ambil dari forum , penulisan lupa...mudah2x an tidak keberatan ditulis disini
Mirror repository ubuntu sangat dibutuhkan sekali oleh bangsa kita, dan tidak disadari pula telah banyak yang membuat repository untuk keperluan jaringan lokal. Permasalahan yang muncul adalah kesetaraan isi repository milik kita dengan server repository yang lain. ketidaksesuain ini dapat menyebabkan kesalahan update paket2 yang bersangkutan lho!

Bagaimana caranya agar server repository kita dapat singkron dengan Server mirror lain? jawabanya.. kita dapat menggunakan debmirror, rsync atau apt-mirror. dalam kesempatan kali ini saya akan mengajak kita semua untuk membuat mirror ubuntu di server milik kita sendiri. ada pun kelengkapan yang harus dimiliki adalah:

0. Koneksi Internet

1. Bandwidth yang lumayan

2. Freespace di hardisk yang banyak (usahakan 60GB)

baiklah, berikut adalah step by stepnya:

0. buat direktory mirror, saya menggunakan direktory /home/mirror

$ sudo mkdir /home/mirror && cd /home/mirror

1. Install Debmirror

$ sudo apt-get install debmirror

2. Buat direktory mirror untuk ubuntu

$ sudo mkdir ubuntu

3. silakan kopi dan salin skript di lampiran untuk proses mirroring, dan namakan dengan dan simpan di /home/mirror/

4. ubah permisi untuk berkas tersebut

$ sudo chmod +x

5. silakan tunggu karena mirror anda sedang dibangun

6. Install webserver, anda dapat menggunakan apache2 atau lighttpd

$ sudo apt-get install apache2 # jika anda menggunakan apache

$ sudo apt-get install lighttpd # jika anda menggunakan lighttpd

7. Buat link untuk pengaksesan web agar supaya mirror kita dapat diakses dari luar

$ sudo ln -s /home/mirror/ubuntu /va/www/ubuntu

8. singkronkan selalu dengan server repository, dapat menggunakan anacron untuk melakukanya

$ sudo crontab -e

isikan dengan * 5,22,10,15 * * * cd /home/ftp && /home/mirror/

simpan dan repository akan di cek pada jam 5, 10, 15 dan 22

Selesai, mudah bukan?

Lampiran script:

# created by Mahyuddin Susanto
# please give this file exsecution mode
# sudo chmod +x
# i asumsed you run this file at /home/mirror/
# type $ man debmirror for more information about debmirror
if test -e $MIR;
# this is most important :p
echo “Debian/Ubuntu scanning packages for own repository”
echo “Created by Mahyuddin Susanto aka”
echo “Use Your Own Risk”
echo “Currently, package dependency is not installed on your system, please install first”
echo “using apt-get install debmirror”
exit 1
# Server, lets declare your target server, you can add your nearest ubuntu mirror like
# tellme where root server have ubuntu mirror, you can insert like: ubuntu, pub/ubuntu depends your server
# example: ubuntu mirror at foss-id like of course you can type ROOT=ubuntu
# What’s your method to use mirroring? you can use http, ftp, hftp, rsync method
# let’s discuss about release ubuntu, ubuntu have code name release like wathy, breezy, dapper, edgy, feisty, gutsy, hardy, intrepid
# in this case you can mirroring release ubuntu more than one release, or you can mirroring update package, security package, proposed package
# ex: $release-security so you can type hardy,hardy-updates,hardy-security,hardy-backports,hardy-proposed
# section, hm… no more information here :D
# ubuntu section is main, restricted, universe, multiverse
# but you can add more section like debian-installer on the section
# architecture… hm.. what architecture fo you want to mirroring? i386 (32bit), amd64 (64bit, include IA64), sparc or powerpc?
ARCHITECTURE=i386,amd64 #just it?
# okey next you must save mirror file to your directory, but you must declare on here. i save my mirror at /media/mirror/ubuntu
if test -d `pwd`/$TARGET;
then EXISTS=”yes”
echo “it seems you don’t have ubuntu directory, create first!”
exit 1
# hmm…. do you cannocted under proxy? if yes you must add –proxy=http://you-name:your_passwd@url:port
#TMPFILE=`mktemp -t mirror.surat`
#exec > “$TMPFILE”
#echo “From: \”DebMirror Ubuntu\” “”"
#echo “To: isikan yang akan menerima”
#echo “Cc:,”
#echo “Subject: Minta perhatian penggunaan benwit”
#echo “”
#echo “Assalamualaikum”
#echo “”
#echo “Mohon perhatian, server sedang melakukan proses mirror repository ubuntu”
#echo “untuk itu mohon kesediaanya untuk memberi benwit pada server agar cepet selesai mirrornya”
#echo “atas perhatian dan kerjasamanya kami ucapkan terimakasih”
#echo “”
#echo `date`
#echo “wassalam”
#echo “”
#echo “Mirror dengan: $METHOD/$SERVER/$ROOT/$DISTRO $SECTION”
#echo “Untuk arsitektur $ARCHITECTURE”
#echo “Versi: $VERSION”
#echo “”
#echo “–++ DebMirror ++–”
#echo “”
#echo “———————————————————”
#/usr/sbin/sendmail -t -i < $TMPFILE
#rm -f $TMPFILE
debmirror -m --passive \
--host=$SERVER \
--root=$ROOT \
--method=$METHOD \
--progress \
--dist=$DISTRO \
--section=$SECTION \
# if you want to mirroring both of binary package and source you can delete --nosource, i'm not this option because my disk is limiitted.
# and if you don't want to remove previous repositories you can add --nocleanup option
# if you get error messages about gpg files maybe you forget to add gpg ubuntu archive as trusted keys :D
# gpg --keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg --export | gpg --no-default-keyring --keyring trustedkeys.gpg --import
# note: remember your free space and bandwidth :D

Change / Create HOST NAME

Checking your Linux host name
First, see if your host name is set correclty using the following commands:
#uname -n
#hostname -a
#hostname -s
#hostname -d
#hostname -f
If the above commands return correctly with no errors then all may be well;
however, you may want to read on to verify that all settings are correct.
Normally we will set the hostname of a system during the installation process.
Change the hostname on a running Linux system
On any Linux system you can change its hostname with the command ‘hostname‘.
without any parameter it will output the current hostname of the system.
#hostname –fqd
it will output the fully qualified domain name (or FQDN) of the system.
#hostname NEW_NAME
will set the hostname of the system to NEW_NAME. This is active right away and will remain like that until the system will
be rebooted (because at system boot it will set this from some particular file configurations - see bellow how to set this
permanently). You will most probably need to exit the current shell in order to see the change in your shell prompt.
Permanent hostname change on Debian based Linux systems
Debian based systems use the file /etc/hostname to read the hostname of the system at boot time and set it up using the init
script /etc/init.d/
#cat /etc/hostname
So on a Debian based system we can edit the file /etc/hostname and change the name of the system and then run
/etc/init.d/ startto make the change active. The hostname saved in this file (/etc/hostname) will be preserved on
system reboot (and will be set using the same script we used
If you want more details check hostname man page
Use sysctl to change the hostname
use sysctl to change the variable kernel.hostname:
#sysctl kernel.hostname
to read the current hostname, and
#sysctl kernel.hostname=NEW_HOSTNAME
to change it.

Install PostgreSQL in UBUNTU

PostgreSQL is a powerful, open source relational database system. It has
more than 15 years of active development and a proven architecture that has
earned it a strong reputation for reliability, data integrity, and correctness. It
runs on all major operating systems, including Linux, UNIX (AIX, BSD,
HP-UX, SGI IRIX, M ac OS X, Solaris, Tru64), and Windows. It is fully
ACID compliant, has full support for foreign keys, joins, views, triggers, and
stored procedures (in multiple languages). It includes most SQL92 and
SQL99 data types, including INTEGER, NUMERIC, BOOLEAN, CHAR,
storage of binary large objects, including pictures, sounds, or video. It has
native programming interfaces for C/C++, Java, .Net, Perl, Python, Ruby,
Tcl, ODBC, among others.
pgAdmin III is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the
most advanced Open Source in the world. The application may be used on Linux, FreeBSD, OpenSUSE, Solaris,
Mac OSX and Windows platforms to manage PostgreSQL 7.3 and above running on any platform, as well as commercial and
derived versions of PostgreSQL such as EnterpriseDB, M ammoth PostgreSQL, Bizgres and Greenplum database.
pgAdmin III is designed to answer the needs of all users, from writing simple SQL queries to developing complex databases.
The graphical interface supports all PostgreSQL features and makes administration easy. The application also includes a
syntax highlighting SQL editor, a server-side code editor, an SQL/batch/shell job scheduling agent, support for the Slony-I
replication engine and much more. connection may be made using TCP/IP or Unix Domain Sockets (on *nix
platforms), and may be SSL encrypted for security. No additional drivers are required to communicate with the database
Install Postgresql and pgadmin3 in Ubuntu
Howto setup Database Server With postgresql and pgadmin3 -- Ubuntu
PostgreSQL 8.2 version will be installed in Ubuntu 7.10 (Gutsy Gibbon)
sudo apt-get install postgresql-8.2 postgresql-client-8.2 postgresql-contrib-8.2
sudo apt-get install pgadmin3
This will install the /client, some extra utility scripts and the pgAdmin GUI application for working with the
Configuring postgresql in Ubuntu
Now we need to reset the password for the ‘postgres’ admin account for the server
sudo su postgres -c psql template1
template1=# ALTER USER postgres WITH PASSWORD ‘password’;
template1=# \q
That alters the password for within the database, now we need to do the same for the unix user ‘postgres’:
sudo passwd -d postgres
sudo su postgres -c passwd
Now enter the same password that you used previously.
from here on in we can use both pgAdmin and command-line (as the postgres user) to run the database server. But
before you jump into pgAdmin we should set-up the PostgreSQL admin pack that enables better logging and monitoring
within pgAdmin. Run the following at the command-line
we need to open up the server so that we can access and use it remotely - unless you only want to access the database on the
local machine. To do this, first, we need to edit the postgresql.conf file:
sudo gedit /etc/postgresql/8.2/main/postgresql.conf
Now, to edit a couple of lines in the ‘Connections and Authentication’ section
Change the line
#listen_addresses = ‘localhost’
listen_addresses = ‘*’
and also change the line
#password_encryption = on
password_encryption = on
Then save the file and close gedit.
Now for the final step, we must define who can access the server. This is all done using the pg_hba.conf file.
sudo gedit /etc/postgresql/8.2/main/pg_hba.conf
Comment out, or delete the current contents of the file, then add this text to the bottom of the file
# If you change this first entry you will need to make sure that the
# database
# super user can access the database using some other method.
# Noninteractive
# access to all databases is required during automatic maintenance
# (autovacuum, daily cronjob, replication, and similar tasks).
# Database administrative login by UNIX sockets
local all postgres ident sameuser
# “local” is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all md5
# IPv6 local connections:
host all all ::1/128 md5
# Connections for all PCs on the subnet
host all all [ip address] [subnet mask] md5
and in the last line, add in your subnet mask (i.e. and the IP address of the machine that you would like to
access your server (i.e. However, if you would like to enable access to a range of IP addresses, just
substitute the last number for a zero and all machines within that range will be allowed access (i.e. would allow
all machines with an IP address 138.250.192.x to use the database server).
That’s it, now all you have to do is restart the server
sudo /etc/init.d/postgresql-8.2 restart
That’s it you can start using postgresql in Ubuntu
Create a Database from command line
You can also use pgadmin3 for all postgresql related
To create a database with a user that have full rights on the database, use the following command
sudo -u postgres createuser -D -A -P mynewuser
sudo -u postgres createdb -O mynewuser mydatabase

Thursday, 18 September 2008


if you forgot you password for your ubuntu system you can recover using the following steps

Turn your computer on.

Press ESC at the grub prompt.

Press e for edit.

Highlight the line that begins kernel ………, press e

Go to the very end of the line, add rw init=/bin/bash

press enter, then press b to boot your system.

Your system will boot up to a passwordless root shell.

Type in passwd username

Set your password.

boot: Linux init=/bin/sh

This causes the system to boot the kernel and run /bin/sh instead of its standard init. Now you have gained root privileges and a root shell. Since / is currently mounted read-only and many disk partitions have not been mounted yet, you must do the following to have a reasonably functioning system.

# mount -n -o remount,rw /

# mount -avt nonfs,noproc,nosmbfs

# cd /etc

# vi passwd

# vi shadow

(If the second data field in /etc/passwd is “x” for every username, your system uses shadow passwords, and you must edit /etc/shadow.) To disable the root password, edit the second data field in the password file so that it is empty. Now the system can be rebooted and you can log on as root without a password. When booting into runlevel 1, Debian (at least after Potato) requires a password, which some older distributions did not.

It is a good idea to have a minimal editor in /bin/ in case /usr/ is not accessible.Also consider installing the sash package. When the system becomes unbootable, execute

boot: Linux init=/bin/sash

sash serves as an interactive substitute for sh even when /bin/sh is unusable. It’s statically linked, and includes many standard utilities as built-ins.

Solution 2

Boot from any emergency boot/root disk set. If /dev/hda3 is the original root partition, the following will let one edit the password file just as easily as the above.

# mkdir recovery

# mount /dev/hda3 recovery

# cd recovery/etc

# vi shadow

# vi passwd

Scroll down to the line containing the root user’s information, which looks something like


Delete everything between the first and second colons, so that the line looks like


Save the file and exit your editor.Type cd to return to your home directory.

Type umount mountplace to unmount the partition.

#unmount /dev/hda3 recovery

Type reboot to reboot your system

The advantage of this approach over the previous method is one does not need to know the lilo password . But to use it one must be able to access the BIOS setup to allow the system to boot from floppy disk or CD, if that is not already set.

Solution 3

Reseting passwords by mounting on another system and editing the password file is bit more work need to be done.first you need to Shut down the machine after backing up all important data.Now remove you machine hard disk and connect this hard disk as slave drive for another machine(this should be linux OS) and boot this machine.Once the system finishes booting, mount the slave drive’s root partition and edit the password file.If /dev/hda3 is the original root partition, the following will let one edit the password file just as easily as the above.

# mkdir recovery

# mount /dev/hda3 recovery

# cd recovery/etc

# vi shadow

# vi passwd

Scroll down to the line containing the root user’s information, which looks something like


Delete everything between the first and second colons, so that the line looks like


Save the file and exit your editor.Type cd to return to your home directory.

Type umount mountplace to unmount the partition.

#unmount /dev/hda3 recovery

Type reboot to reboot your system

If you want to prevent others from resetting your root password you can use two options first one is protect your bootloader with password i.e your GRUB or LILO boot loaders and second one is protect BIOS with password.

Tags: forgot root password debian, recover debian root password, reset debian root password, Security

You may also be interested in...

* Enable and Disable Ubuntu Root Password

Print This Post/Page | 15,789 Views | E-Mail This Post/Page | | [link]
4 Responses to “forgot root password or reset root password in Debian”

1. KeNt Says:
January 9th, 2007 at 12:39 pm

Solution 4
boot with livecd (i’m using slackware install)
mkdir /d
mount /dev/hda1 /d
chroot /d
passwd (or passwd root)
type your new password
press Ctrl+Alt+Delete and enjoy
2. Itumeleng motshabi Says:
May 16th, 2007 at 9:54 am

I know I’m just one of those newbie in linux and you don’t have time to update the web page every-time.please show me how to do it with grub as it is the most default bootloader.

thanks for hearing me
3. theo Says:
July 23rd, 2007 at 3:07 pm

Yes you can do it from grub as well:

1. Select the appropriate entry in the grub menu and press ‘e’
2. Select the kernel … line and press ‘e’
3. Append ‘init=/bin/bash’ at the end of line
4. Press ‘b’ to boot

Then you will need to remount the system as rw and use the passwd command to change the pass
4. Rick Says:
February 4th, 2008 at 4:28 pm

Thanks Theo… I’ve added the mount command for the likes of me:

mount -n -o remount,rw /