Category: Linux (general)

Setting up BandLuxe C179 3.5G modem on Kubuntu 8.10

Recently I just cancelled my fixed line broadband and got my 2Mb mobile broadband plan, as I rarely able to fully utilize the 8Mb bandwidth. With this switch, I manage to save about $30 per month, inclusive of the cost of home telephone line. Bundled with this new plan from SingTel is a BandLuxe C179 […]

Wednesday December 23rd, 2009 in Learning in progress, Linux (general), Sharing | 2 Comments »

Linux security basic

For controlling the remote access, edit the SSH configuration file. For Fedora, this file is located at /etc/ssh/sshd_config # Typically, edit the Authentication section will be sufficient   # Authentication:   #LoginGraceTime 2m PermitRootLogin no Allowusers sysadmin developer1 #StrictModes yes #MaxAuthTries 6   # Once edited the configuration, remember to restart # the SSH daemon […]

Friday June 20th, 2008 in Learning in progress, Linux (general) | Comments Off

Bash shell scripting basic

Having following line at the first line of script file will tells system which program should be use to run this script file #!/bin/bash General stuff # Exit the shell with status n exit [n] # To exit from a function return [value] # To import other source file, similar to #include in C . […]

Thursday June 19th, 2008 in Learning in progress, Linux (general) | Comments Off

Cron job basic

The crontab file contains list of cron job entries, and can be edited by typing command crontab -e Each of the cron job entries will have the following format: * * * * * root echo Executed on `date` # <minute> <hour> <DOM> <month> <DOW> <user> <command> Possible values are: minute – * for every […]

Tuesday June 17th, 2008 in Learning in progress, Linux (general) | Comments Off

Commonly used Linux commands (system)

To display or to set the host name hostname hostname # edit ‘hostname’ variable in /etc/sysconfig/network to take effect permanently # edit/add entry for selected host name in /etc/hosts To get system date and time in specific format, or to set the system date and time date date "+%Y-%m-%d %T" date -s "yyyymmdd hh:MM:ss" To […]

Thursday June 12th, 2008 in Learning in progress, Linux (general) | Comments Off

Commonly used Linux commands (networking)

ifconfig To get the IP address of network interface, or to configure the network interface, such as setting the IP address to a static one. Note: IP address assigned with this command will gone once reboot. To set a static IP address permanently, you will need to edit the interface’s configuration file. ifconfig ifconfig [up/down] […]

Tuesday May 27th, 2008 in Learning in progress, Linux (general) | Comments Off

Network interface config file for Fedora

For Fedora, the network interface configuration file is located at: /etc/sysconfig/network-scripts/ifcfg-<eth0> with <eth0> substituted with corresponding network interface name. Below is an example of configuration file, ifcfg-eth1, that sets NIC eth1 to use a static IP address permanently: # Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] DEVICE=eth1 IPADDR="192.168.19.134" NETMASK="255.255.255.0" BROADCAST="192.168.19.255" ONBOOT=yes BOOTPROTO=static HWADDR=00:0c:29:25:f9:db

Thursday May 22nd, 2008 in Linux (general) | 1 Comment »

Commonly used Linux commands (disk and file)

Display disk space usage of each file system item relative from current directory. Level 1 means current directory only, whereby level 3 will further break down 2 more levels from current directory. Warning: avoid running this command from “/” directory. du -h –max-depth=1 # show the sum of size instead of list items one by […]

Sunday April 27th, 2008 in Linux (general) | Comments Off

Commonly used Linux commands (archive and compress)

For .tar file tar -cvf output_file.tar space_separated_input_files tar -xvf archive_file.tar For .tar.gz file tar -czvf output_file.tar.gz space_separated_input_files tar -xzvf compressed_file.tar.gz For .tar.bz2 file tar -cjvf output_file.tar.bz2 space_separated_input_files tar -xjvf compressed_file.tar.bz For .gz file gzip output_file.gz space_separated_input_files gunzip compressed_file.gz For .bz2 file bzip2 output_file.bz2 space_separated_input_files bunzip2 compressed_file.bz2 For .zip file zip output_file.zip space_separated_input_files unzip compressed_file.zip For […]

Friday April 25th, 2008 in Linux (general) | Comments Off

System-wide and user-specific alias

In two of the posts I had written just few days ago, I utilized “alias” command for replacing vi editor with vim and SafeVI. To apply them in future login session, you can either apply it through out the system by editing following file: /etc/bashrc or apply it to specific user only by setting the […]

Wednesday April 23rd, 2008 in Linux (general) | 2 Comments »