Welcome to my blog, For more information about me, visit my website at https://www.kush.com.fj. This blog is mostly just a journal.
3/07/2010
Website Changes
Minor website changes to www.kush.com.fj. Replaced original splash image with new one made using new Hindi script. Also created splash image for Resume page using previous and current business cards. Let me know what you think as well as any more ideas or recommendations for improvements...
3/01/2010
Ubuntu 9.10 does not boot up after hibernate!!!
I've been running Ubuntu 9.10 desktp on my HP nx6120 notebook with some success for a little while now. It performs well for my TeX work, occasional web-browsing, VPN, RDP and e-mails. The GUI is enhanced using Mac4Lin. I loved the hibernate feature until late this afternoon when it refused to bootup after hibernating. I would get the splash screen and then nothing... curses!!!.
I managed to find a work-around but am still not sure what the problem was:
References
I managed to find a work-around but am still not sure what the problem was:
- Boot up the machine with a rescue CDROM
- Confirm the root partition for the Ubuntu install (in my case it was /dev/sda8, although I only have IDE drives)
- Boot up the machine and wait for the GRUB prompt
- Press "e" to edit the entry
- Replace the "root=UUID..." with "root=/dev/..." on the "linux" line entry
- Add the entry "no_console_suspend" on the same line
- Press the "Tab" key to complete the Emacs edit
- Press "Ctrl+x" to continue booting
- sudo vi /etc/default/grub
- Edit the file to uncomment GRUB_DISABLE_LINUX_UUID
- Edit the file to add no_console_suspend in the GRUB_CMDLINE_LINUX
- Save the file and exit
- sudo /usr/sbin/update-grub
References
2/28/2010
Snort sniff honk !
Snort is an open source intrusion detection system (IDS). Its highly configurable and can be run in a number of modes and architectures, There are a small number of freely available rules to use. For more information refer to the Snort home page http://www.snort.org/. Here are some instructions on getting it setup on CentOS, these were adapted from the Snort Documentation by Patrick Harper at http://assets.sourcefire.com/snort/setupguides/Snort_Base_Minimal.pdf;
- yum install mysql mysql-bench mysql-server mysql-devel mysqlclient10 php-mysql httpd gcc pcre-devel php-gd gd mod_ssl glib2-devel gcc-c++ php php-pear libpcap-devel
- vi /etc/httpd/conf/httpd.conf #Edit the httpd.conf file to suit
- /etc/rc.d/init.d/httpd start
- /etc/rc.d/init.d/mysqld restart
- /usr/bin/mysql_secure_installation
- cd /root
- mkdir snortinstall
- cd snortinstall
- wget http://dl.snort.org/snort-current/snort-2.8.5.3.tar.gz
- tar zxvf snort-2.8.5.3.tar.gz
- cd snort-2.8.5.3
- ./configure --with-mysql --enable-dynamicplugin # Fingers crossed it all goes well
- make
- make install
- /usr/sbin/groupadd snort
- /usr/sbin/useradd -g snort snort -s /sbin/nologin
- mkdir -p /etc/snort/rules
- mkdir -p /var/log/snort
- cd /root/snortinstall/snort-2.8.5.3/etc
- cp ./* /etc/snort/
- cd /root/snortinstall
- wget http://www.emergingthreats.net/rules/emerging.rules.tar.gz
- tar zxvf emerging.rules.tar.gz
- cd rules
- cp ./* /etc/snort/rules/
- vi /etc/snort/snort.conf # Edit the snort.conf file to suit
- /etc/rc.d/init.d/mysqld start
- mysql -u root -p mysql # Create the snort database and snort database user and set permissions
- cd /root/snortinstall/snort-2.8.5.3/schemas
- mysql -u snort -p snort < create_mysql
- pear install -a Image_Graph-alpha Image_Canvas-alpha Image_Color Numbers_Roman
- cd /root/snortinstall/
- wget http://downloads.sourceforge.net/project/adodb/adodb-php5-only/adodb-510-for-php5/adodb510.tgz?use_mirror=transact
- wget http://downloads.sourceforge.net/project/secureideas/BASE/base-1.4.4/base-1.4.4.tar.gz?use_mirror=transact
- cd /var/www
- tar zxvf /root/snortinstall/adodb510.tgz
- mv adodb5/ adbodb
- cd /var/www/html/
- tar zxvf /root/snortinstall/base-1.4.4.tar.gz
- mv base-1.4.4/ base
- cd base
- cp base_conf.php.dist base_conf.php
- vi base_conf.php # Edit the file to suit
- # Load http://SERVERNAME/base in a browser and click on the setup link
- # Click on Create BASE AG button
- # Click on the Main Page link
- create database snort;
- create user 'snort'@'localhost' identified by '
'; - grant create, insert, select, delete, update on snort.* to snort@localhost;
- grant create, insert, select, delete, update on snort.* to snort;
2/21/2010
Timing is everything...
Having the correct clock timestamp is very important for logging, maintenance, troubleshooting and even forensic analysis. Timing provides a very important frame of reference for network devices, such as hosts, routers and switches. It would be almost impossible to construct a reliable model of an environment without having a standard and accurate frame of reference, thus timing is everything...
The Hardening Cisco Routers book provides a good reference for Network Time Protocol (NTP) important, and can be found at http://oreilly.com/catalog/hardcisco/chapter/ch10.html. NTP is a very popular way to synchornise system clocks with a central trusted server. Here's a rough guide to getting NTP running on a Linux server;
The Hardening Cisco Routers book provides a good reference for Network Time Protocol (NTP) important, and can be found at http://oreilly.com/catalog/hardcisco/chapter/ch10.html. NTP is a very popular way to synchornise system clocks with a central trusted server. Here's a rough guide to getting NTP running on a Linux server;
- sudo yum install ntp # Install the NTP client
- sudo vi /etc/ntp.conf # Edit the configuration file to use the nearest server pool. Refer to www.ntp.org to get the pools.
- sudo mv /etc/localtime /etc/localtime~ # Backup the locatime file
- sudo ln -s /usr/share/zoneinfo/
/ /etc/localtime # Ensure that the correct locatime file is set for your city - sudo ntpdate
# Set the date using NTP using the pool specified* - sudo /etc/rc.d/init.d/ntp start # Start the NTP client daemon
- ntpstat # Check that the system clock is synchronised
- date # Check that the system date is set correctly
- sudo hwclock -w # Set the hardware clock to the system date
2/20/2010
Linux Jump Box VPN
With the Linux Desktop out of the way, and my impending studies in Network Security coming up, I thought I'd preempt the studies with some initial ground work on my old Linux Server. Previously we had an old server at home, that was used mostly as a web proxy (Squid) and Windows (Samba) server to share files and the home printer.
Well, it was time for a change and I decided to rebuilt it into a bastion jump box, with a restructure of the home network as well. I started off by installing a second Network Interface Card (NIC) on it. Then installed a bare CentOS on it. I did a yum update on it to ensure the latest patches and stable packages we installed. Next went through the services and disabled all the unnecessary stuff.
The idea is to separate the internal network from the De-militarized Zone (DMZ). The purpose of the jump box is to sit on the DMZ between the access and choke routers. The jump box will provide Virtual Private Network (VPN) access into the network, as well as providing proxy services such as web proxy, syslog, ssh and other services.
In the network, both the access and choke router perform Network Address Translation (NAT), Quality of Serverice (QoS), as well as stateful packet inspection (SPI) firewall functions. In addition to SPI, the choke also performs some port forwards to the jump box and the sip phone. All other traffic is dropped.
So to get home from university, I need to VPN in, then use SCP to transfer my files (assignments, reports, etc) and get out again.
To install OpenVPN, perform the following tasks;
Well, it was time for a change and I decided to rebuilt it into a bastion jump box, with a restructure of the home network as well. I started off by installing a second Network Interface Card (NIC) on it. Then installed a bare CentOS on it. I did a yum update on it to ensure the latest patches and stable packages we installed. Next went through the services and disabled all the unnecessary stuff.
The idea is to separate the internal network from the De-militarized Zone (DMZ). The purpose of the jump box is to sit on the DMZ between the access and choke routers. The jump box will provide Virtual Private Network (VPN) access into the network, as well as providing proxy services such as web proxy, syslog, ssh and other services.
In the network, both the access and choke router perform Network Address Translation (NAT), Quality of Serverice (QoS), as well as stateful packet inspection (SPI) firewall functions. In addition to SPI, the choke also performs some port forwards to the jump box and the sip phone. All other traffic is dropped.
So to get home from university, I need to VPN in, then use SCP to transfer my files (assignments, reports, etc) and get out again.
To install OpenVPN, perform the following tasks;
- sudo wget http://centos.karan.org/kbsingh-CentOS-Extras.repo
- sudo yum --enablerepo=kbs-CentOS-Testing install openvpn
- sudo find / -name "easy-rsa" # returns something like "/usr/share/openvpn/easy-rsa/"
- sudo cp -R /usr/share/openvpn/easy-rsa /etc/openvpn/
- sudo cd /etc/openvpn/easy-rsa/2.0/
- sudo mkdir keys
- sudo vi ./vars
- Change the following variables
- export KEY_SIZE=2048
- export KEY_COUNTRY=""
- export KEY_PROVINCE=""
- export KEY_CITY=""
- export KEY_ORG=""
- export KEY_EMAIL=""
- sudo bash
- source ./vars
- ./clean-all
- ./build-ca
- ./build-key-server server #server is the unique name to identify the server
- ./build-key client #client is the unique name to identify the client (repeat for each client)
- ./build-dh
- find / -name "server.conf" # returns something like "/usr/share/doc/openvpn-2.1/sample-config-files/server.conf"
- cp /usr/share/doc/openvpn-2.1/sample-config-files/server.conf /etc/openvpn
- Edit the file to suit
- Copy the Diffie-Hellman pem file (dh2048.pen), the server key file (server.key), and the CA certificate file (ca.crt) to the working directory and start the OpenVPN server (/etc/rc.d/init.d/openvpn start).
12/21/2009
Linux for the Desktop
I have mostly been a Linux from the command line kind of person. I would rarely come across X Windows. Recently I decided to experiment with Linux for the desktop. Needless to say have heard people raving about Ubuntu. Furthermore I have mostly been a Redhat user, and had only used the Debian distribution briefly in the past.
I got the Ubuntu 9.10 Netbook Remix off the Australian PC Authority magazine to have a bit of a play with. It was good because it actually let me resize the existing partitions on my notebook. I had a play, and was moderately impressed by it. The interface was reasonably fluid and the performance was ok. However it was not too my liking. I felt that it lacked a lot of features and flexibility, would would be ideal for the average desktop user, just looking for netbook features.
Needing more features and a complete set of Linux utilities and applications, I downloaded the Ubuntu 9.10 Desktop ISO image and installed off the CD. The first step was to update all the package, for some reason the Austrlian servers were not reachable and the connection timed out. I changed the "Update Manager" "Settings" to "Download from:" the "Main Server". This worked well.
Next step was to make is look like an Apple Mac :) using the Mac4Lin installation. Before running the installation program I had to execute "sudo apt-get install emerald" to make things a bit easier. I previous Google suggested creating the following folders "~/.themes" and "~/.icons". This was done and I ran the install script. So far so good.
Now to get the AWN (Avant Window Navigation) dock working. "sudo apt-get install avant-window-navigation". 10 seconds and a couple of automatic dependency installs later the "Awn Manager" was available under "Preferences", and after adding the Max4Lin theme in AWN, and setting it to auto start, I launched the AWN and there was much coolness to be observed...
To get the complete look you need to go through all the steps in the PDF manual available from Mac4Lin but the end result is quite satisfying in a cheezy sort of way. For people like me who cannot afford to pay for a proper Apple mac, this poor man's mac combines the GUI of (similar to) an Apple and the flexibility of a stable Linux distribution.
I got the Ubuntu 9.10 Netbook Remix off the Australian PC Authority magazine to have a bit of a play with. It was good because it actually let me resize the existing partitions on my notebook. I had a play, and was moderately impressed by it. The interface was reasonably fluid and the performance was ok. However it was not too my liking. I felt that it lacked a lot of features and flexibility, would would be ideal for the average desktop user, just looking for netbook features.
Needing more features and a complete set of Linux utilities and applications, I downloaded the Ubuntu 9.10 Desktop ISO image and installed off the CD. The first step was to update all the package, for some reason the Austrlian servers were not reachable and the connection timed out. I changed the "Update Manager" "Settings" to "Download from:" the "Main Server". This worked well.
Next step was to make is look like an Apple Mac :) using the Mac4Lin installation. Before running the installation program I had to execute "sudo apt-get install emerald" to make things a bit easier. I previous Google suggested creating the following folders "~/.themes" and "~/.icons". This was done and I ran the install script. So far so good.
Now to get the AWN (Avant Window Navigation) dock working. "sudo apt-get install avant-window-navigation". 10 seconds and a couple of automatic dependency installs later the "Awn Manager" was available under "Preferences", and after adding the Max4Lin theme in AWN, and setting it to auto start, I launched the AWN and there was much coolness to be observed...
To get the complete look you need to go through all the steps in the PDF manual available from Mac4Lin but the end result is quite satisfying in a cheezy sort of way. For people like me who cannot afford to pay for a proper Apple mac, this poor man's mac combines the GUI of (similar to) an Apple and the flexibility of a stable Linux distribution.
12/05/2009
CCNA - Frame Relay
It appears I did get it working, but for some reason I cannot ping the local interface on the routers. If anyone is after the config and the network file for dynamips just drop me an e-mail or something, but there are heaps of them on the net already, and there is nothing special about the one I have.
Basically the idea of the lab was to setup static routes to the loopback interfaces on the remote routers. The important concept learnt were;
Basically the idea of the lab was to setup static routes to the loopback interfaces on the remote routers. The important concept learnt were;
- Understand the importance of a route back from the remote router.
- Configure a static route with using a router interface
- Configure a static default route with a next hop router
11/30/2009
CCNA Studies - continued...
I've finally been able to get some time to get back into CCNA studies. Decided to put my GNS3/dynamips setup online, as well as my notes as I make progress. Not sure if it may be useful to anyone as there is already a lot of good resources out there, but I figured this way I'll have access to it online as well instead of getting into the server at home.
Basically at the moment am going through the Training Signal videos that I borrowed off a friend, who is now doing his CCNP. So the labs at the moment are from the videos, by Chris Bryant... he has an awesome blog with lots of videos, tutorials and practise exams -http://thebryantadvantage.blogspot.com.
I started the lab prep work by trying to setup a Frame Relay hub and spoke topology network on GNS3. Speaking of dynamips, its heaps faster to load the IOS if the image has been expanded already. I found Zipeg http://www.zipeg.com quite useful for this purpose.
Anyways, I built a frame relay network on GNS3 and it would not work. So I upgraded to the current version of GNS and tried again. Still no go. Frustrated I posted an angry message on twitter, facebook and linkedin and gave up on this temporarily...
11/29/2009
Make ringtones from your iTunes music
It's really sucky how you cannot use your existing iTunes music as your ringtones. I mean you have already paid for the music so why not let you use it directly. Instead you either need to buy them as ringtones off the iTune Store or convert them.
The simplest way I found was to use iTunes itself to perform the conversion for you. Basically you need to listen to your music and determine how much of it you'd like to use for your ringtone, convert the song, import it into iTunes and then sync your iPhone.
Here's the step-by-step using iTunes 9
The simplest way I found was to use iTunes itself to perform the conversion for you. Basically you need to listen to your music and determine how much of it you'd like to use for your ringtone, convert the song, import it into iTunes and then sync your iPhone.
Here's the step-by-step using iTunes 9
- Launch iTunes 9
- Select Music and listen to the song
- Determine the start time and end time of your ringtone (recommend 30 seconds)
- Right-click the song and select Get Info
- Select the Options tab
- Click on the start and end times and type in the start and end times
- Click the OK button to close the dialog box
- Right-click the same song and select Create AAC version
- Note a new version of the song with the same name
- Right-click the new song and select Show in Windows Explorer
- Select the AAC version of the song and press the F2 key to rename the file
- Rename the file extension from *.m4a to *.m4r
- Close the Windows Explorer window
- Right-click the new song and select Delete
- Left click the File menu and select Add File to Library
- Browse to the file, select it and Click Open
- Finally sync your iPhone
10/01/2009
How to set the Linux date and time from the command prompt
Note: This is a repost of an old website page. It has just been moved it here as a blog.
The Linux machine maintains the date and time, firstly, like all other personal computers on the hardware, this is sometimes referred to as the Basic Input and Output System (BIOS) or Complementary Metal Oxide Semiconductor (CMOS). The second date and time reference is maintained by the operating system, and is updated from the hardware clock during boot-up. During the Linux installation, the hardware clock is configured to be in Coordinated Universal Time (UTC) or Greenwich Meridian Time (GMT) The latter is often referred to as the system clock and the former is usually known as the hardware clock.
During boot-up the system clock is initialised with the date and time on the hardware clock. The advantage of maintaining time in UTC is that the Linux system will automatically account for daylight savings based on your timezone. The timezone information for the Linux box is configured via the /etc/localtime file.
The man page for the hwclock command provides more detailed information on the time keeping features of Linux. The file /etc/localtime is a symbolic link to the timezone data found under the /usr/share/zoneinfo directory.
- To set the timezone, create the appropriate symbolic link
- /bin/ln -sf ../usr/share/zoneinfo/Pacific/Fiji /etc/localtime
- To indicate to the system that UTC time is to be used, the configuration file, /etc/sysconfig/clock needs to be edited. The file should be edited to indicate UTC=true. To use GMT ensure that the file has UTC=false set.
- /bin/vi /etc/sysconfig/clock
- To set the system clock, the date command may be used. To set the date and time enter the following command. If the UTC time is used then the -u, --utc or --universal switch must be used to set the time as UTC.
- /bin/date MMDDhhmm.ss
- Once the system clock has been set, it can be used to re-initialise the hardware clock. Again if the UTC format is used then the -u or --utc switch must be used.
- /sbin/hwclock --systohc
Refrences:
- Linux man page for date
- Linux man page for hwclock
Subscribe to:
Posts (Atom)