Archive for the 'linux' Category

My Networking Bridge is Back on FreeBSD

I’m glad.

Fixing Bridge
Fixing the bridge in the wee hours- (laptop on the left, pc to be on the bridge in the middle, and console of my BSD server)

I managed to pinpoint the fault and get my network bridge working on the pentium II server again, and the isolated pc in my room is connected to the internet again.

So the PCI slot is damaged, after multiple reboots, and network configuration. So the network card got swapped to another PCI slot.
Pii Server

Here’s what I used to bridge the connections.


ifconfig bridge create
ifconfig bridge0 addm fxp0 addm rl0 up
ifconfig fxp0 up
ifconfig fl0 up
ifconfig fxp0 0.0.0.0 255.255.255.0
ifconfig rl0 up 0.0.0.0 255.255.255.0
dhclient bridge0

So with this I avoided the migration of the server to the pentium 3 hardware, and delay installation of CentOs. Of course, there are tricky issues in FreeBSD, like a changing MAC address for the bridge each time its created. But this all I would like to say for now. If I may, I would go into the details of FreeBSD and the startup configuration scripts like /etc/rc.conf next time.

Java Ftp Client

So for the 2nd part of my networking assignment, we have to create a simple FTP client.

Screenshot of my Worked-In-Progress FTP Client
zz85 Ftp Client

I was hoping…
to create a web server vs a ftp client as I thought
1. a web server could be more practical, simpler to implement, but could pack more features
2. the ftp protocol is old and troublesome, I already spent quite some time in the past trying to understand the protocol, lots of ftp clients exist already

Nevertheless, given the low weightage of the assignment, I didn’t want spend much time on it.
Lots of other work need more focus, but my programming habbits and “chiong project” culture in polytechnic kicked in and I did a little more than the requirements.

Although I believe I must have did quite some amount of work on Swing and networking component, bad memory and the rust affected me and I found myself using some time looking up various stuff. Sometimes I think, “are we letting Google is do all our work?”

Inspired by…
Anyway the product of my implementation was inspired by many many other stuff.
Filezilla as a free good implementation of FTP client. Command line ftp, telnet software. The terminal. Therefore the black screen.
Port sniffers- therefore the debug windows. IDE/Frontends thats why the GUI on the left.

I created a client in Eclipse then migirated to Netbeans trying their new 6.0 Beta1 (and Java 6- I’m must have lagged 2 versions since poly)

My product features…
Created for academic reasons, this software has educational purpose. Raw commands allowed to be typed in quickly on the right side of the screen. Some commands emulate the command line ftp software.

The way is screen is split is also to represent the User-FTP, PI, and DTP architecture as described by the RFCs. (RFCs 959 and rfc1579 were read). It does some upload and download.

Alright the client doesn’t does much, its far from perfect or good, but it shows my attempt trying to be creative.

Download it
here

Try it…
Just double click. If you wish to run from a command line, use
java -jar FtpClient.jar or java -cp FtpClient.jar ftpclient.FtpClientUI

Happy Messing with FTP.

Its a bad day

Failing to be able to do a single question on my maths test, was a demoralized state which span the entire weekend and carried over into the new week. So much for being confident with my maths preparation.

Computers being one of the reasons for my weekend gloom, i decided to dispose a few computer parts:
2x P4 CPUs
1x P4 Mother board
3x CD Drives
3x Hard disk

I tried Ubuntu 7.10, Puppy Linux, and tried installing Suse Linux and FreeBSD.

Novell’s OpenSuse is quite polish to be a business or home desktop, and it can be one of top linux recommendations.
I found a few quires though.

Installation is simple, nice, user friendly, yet I feel some important bits is missing.
For one, the installer is able to make decisions on what partitioning options to use, yet my XP NTFS partition refused to be resize (or the installation). The partition manager didn’t allow me combined fat partitions too. In order not to corrupt the file system, I install on a portable usb hard drive.

However, where was no option where to place grub and they placed it into the mbr of the internal hdd. So I end up having to boot into suse, install the bootloader on the external hdd, then use MbrFix to repair the MBR on the internal hdd. Anyway it turns out my external hdd didnt boot suse and I’m left stranded to windows xp media edition. Which is good, because my projects are there and I won’t get distracted and have my time divided among the partitions and operating systems.

So much for ignoring an true advice not to try linux until the end of projects and exams, but I’m learning the lessons now- no personal projects till the weekends.

Music Radio Alarm

(I reposted this because of server migrations incase anyone noticed)
6 hours of my lesson-free day was fighting against my >8 years aged server. I lost the battle with some cuts on my fingers.
Instead of a bad configuration, it seems a faulty network card was playing me out. Lesson learned: If it ain’t broke don’t double fix it. If the server ain’t going to work anymore, there’s no point keeping this post as a draft, gotta publish it now.

Back to the topic, my father brought home a portable Philips radio combined with a Cd player and alarm clock years ago. My impression it wasn’t a very good audio player, its features and sound quality was just minimal. However, there was still few interesting and useful features. It served as clock and I also used it to set my morning alarms to interrupt my dreams by either

a) Turning on a FM station
b) Playing tracks of my CDs, or
c) Sounding alarms likes beeps and rings.

You could set to 2 alarms on it, so I usually turn on the 1st alarm to the CD tracks, then blast the noisy alarms 10 to 60 minutes later. The 1st alarms is for switching my body into a light sleep, and starts the engine of my subconscious mind. If I’m still in deep sleep, the loud sounding alarms is the last line of defense not to be late for school.

There were few CD tracks that never fail to wake me up- Carmen’s fantasy, Walton’s violin sonatas, Stravinsky’s Rite of Spring and so on… some tracks made me want to lie in bed to hear the songs- Bach’s Brandenburg Concerto 5…

That’s for waking up. For sleeping, I’ll set the timer to turn off the CD or Radio after a period of time. It seems to me I never get to sleep soon if my mind is actively listening to classical music.

— if you are not a computer geek you can stop reading right here —

Here’s did an equivalent on my server plugged to speakers. 4 linux commands I used: screen, mplayer, sleep, killall.

I start my ssh session with putty to my and run screen -r

1. Play lullaby softly
mplayer http://audio-ogg.ibiblio.org:8000/wcpe.ogg -cache 256 -af volume=-5dB
This plays WCPE, the online classical radio at a softer volume. I move to another screen window for the next step (^A,n)

2. Silence the lullaby
sleep 15m && killall mplayer
Sleep here is used sort of like a countdown timer. Here, 15 minutes later, the mplayer is terminated for silence. We need another window for the next step.

3. Countdown the alarm
sleep 3.5h && radio.sh
This shows I want the radio to be turned on again after 3 and a half hours to wake me up…

Thats not too much sleep isn’t it? La la la… ZzZzZZZzZ

In a Data Center

I’ve been to server rooms, power control stations but a data center feels different.

Data Center

Like in those movies, multiple sliding gates with biometric access control, engineers on shift monitoring screens, plenty of close circuit cameras, air-conditional room, tons of cables running under the floor, rows after rows of racks of servers and wires.

A $2k server rack is slide into place, power and ethernet cables attached. Monitor, keyboard placed on a trolley is rolled near for connection like a life support unit. The power button pushed, the small but powerful fans hums along with the symphonies of fan noise in the data center.

The network installed CentOS, the free enterprise Red Hat Linux, runs the server. Due to my personal discrimination against RH since version 6, I had to adapt to its environment.

/etc/sysconfig/network-scripts was the place where ip, dns addreses and network configurations was. system-config-securitylevel configures the firewall, yum installs, manages and updates the system. Guides exist online. Some other commands to configure and control services. I also discovered write and talk. The rest is usual linux.

http://www.lab4solutions.com is sparkling into life.