Auto-Synchronize Over FTP Link (RedHat & Ubuntu)

In a spesific programming case, database synchronization method will needed to accomodate data transfer between 2 or more servers. There are so much techniques we can adopt to make it work. And that's all depends on needs, business requirement, infrastructure availability & of course skill of you're own self.

Anyway, I don't wanna talk about synchronization techniques but actually, this latest article was begun from my previous one - Simple MySQL Replication Using FTP - when I implement automatically SQL file synchronization - using FTP protocol & by the help of crond daemon - between 2 RedHat (RHEL) server. The goal is that both servers having the same databases & tables (server A sending data to server B, server B sending data to server A).

However, the problem arises when one of the server changed the OS from RHEL to debian based (Ubuntu). While the automatic script I made from RHEL won't work on Ubuntu - especially the lines referring to FTP commands - bash shell script.

So, how to make the synchronization running again? No doubt, rewrite the script ASAP! Take a look at below script:

echo machine your.domain.or.ip > /root/.netrc
echo login your_username >> /root/.netrc
echo password your_password >> /root/.netrc
chmod 600 /root/.netrc

ftp your.domain.or.ip <<_FTP_
binary
put name.of.the.file
bye
_FTP_


Above is the code that only work on RHEL. While the FTP account created on separated file named by .netrc, this is not compatible to Ubuntu.

ftp -n -i <<_FTP_
open your.domain.or.ip
user your_username your_password
binary
put name.of.the.file
quit
_FTP_


Somehow, the FTP account initialization right on above script is integrated in the same script. And it just succedded running in Ubunru server. Moreover, there's no script affected in other servers. So, lesson of learning today is: never change server OS except you're ready for the impact. Deal?

Labels: , , , , , , ,

  Post a Comment

Goddard on Acer Aspire One (Part 2)

Thousands of blog writers has been reviewing about how succeeded they were after installing Fedora 13 on their various machine. Anyway, I will not write the same things in this article, sorry. As a runner distro – after Ubuntu at first as listed on distrowatch.com-, Goddard seems to be a more human friendly or might become a future Linux desktop. Don't worry, this is my judgment – as far as I'm concerned after I've proofed my self on my Aspire One AOA 150. It's signed by the whole parts of hardware which had been detected correctly by the kernel without using any tweak or hack. Well, this is not happened even when I using Fedora 10 a years ago.

I still loved Fedora - than Ubuntu – because it's a derivative from the ancestor - Red Hat. However, now my favorite desktop manager has moved to Gnome from KDE. In my opinion, Gnome offering a simple desktop, fast, light & weight than latest KDE. Again, this is relative judgment. But one thing for sure, most users like their desktop because of it's appearance. For example, many users moved to Windows Se7en because of it's skin (but it doesn't works for me since I still using XP for some works & games).

Mac4Lin on Fedora 13
I beat that workers who live with computer (like me, red) is always keep the desktop as useful & unique personalized as it can be. Talking about personalizing desktop – especially on Gnome – lots of themes available to apply. After a day busy on completing package I need – including enabling 3D compiz, now comes a time to personalize my desktop. There's no beautiful desktop as much as Mac OS X did – it remained my using it on my 12” Travelmate. Fortunately, a group of peoples out there has done their job to provide a transformation pack named Mac4Lin project. The goal is to make Linux desktop as closer look as OS X did.

Try to reach the package over this link & following the how to steps. In short, perhaps your desktop maybe similar to mine now.



The package complete with Mac theme, desktop background & icons. And it's absolutely suitable for Gnome, except the GDM which isn't changeable yet (even I had tried to tweak it with Ailurus or GDM2Setup for Ubuntu). Anyway, you can set it to auto-login mode so that it wouldn't display GDM login window anymore. Look at snapshot below, the left side of the screen displaying Nautilus (which is similar to Mac file browser) while the right side is Firefox (with extra add-ons & themes, will make much close to Safari browser appearance).



On the bottom of the screen, laid the Avant Window Navigator – A dock similar to Mac desktop. All available in a single package of Mac4Lin transformation pack. All you need to do is follow the instruction, a little yum download & bit of compiling tar balls. After it succeed, I guarantee for your satisfaction. Just try & believe me.

To change Plymouth animation (known as Red Hat Graphical Boot), try to take a look at gnome-look.org or kde-look.org & find one suitable for you. As I've tried, to changed this you need to compiled manually. Please take carefully to do that, once you follow the instruction then your Goddard may be safe.

BURG on Fedora 13
Last but not least is how to modify default GRUB into BURG. Well, a complete hand book I've found on their project website. Like others said that BURG is stand for GRUB, it's a unique name mirrored from GRUB ~ an update model of GRUB bootloader which used high graphic for boot background. I said, this is a revolutionary & pretty cute boot loader than used on Mac or Windows Se7en.

Note that I don't recommended it if you're newbies on Linux since it's totally hand made (manual) but If you dare to do this, than prepare for install all of the dependencies. First, connect to the internet & give below command on terminal:

#sudo yum install autoconf automake bison flex make gcc ruby python gettext-devel freetype-devel


also provide required extra software for the emulated version requires:

#sudo yum install ncurses-devel SDL-devel


To download the source, you need to install bazaar binary package.

#sudo yum install bzr


After it completed, create a folder named burg on your home folder and enter to that folder. While you're on it & for the first time need to downloading the source, from terminal, enter:

#bzr branch lp:burg


Then, let it sync a previously downloaded source tree to the latest version (This still should be run in your burg source directory):

#bzr pull


After each update, you need to regenerate the configuration files by running this command in the same burg source directory:

#./autogen.sh


After that, download themes pack from this link since the original source doesn't include it yet. Those above commands purposed for preparing BURG source code in burg directory on your home folder. Based on the original manual, you should specify BURG compile & install directory. In my experiment, I supply both with different directory, burg_nb for the compilation & burg_install for the target installation. Just follow it & create 2 new directory, then copy all of files from burg directory into burg_nb (except the zipped themes file, we will use it later).

Now enter to burg_nb directory via terminal and get start to compile with commands below:

#$HOME/burg/configure --with-platform=pc --prefix=$HOME/burg_install
#make
#make install


After compilation completed, extract zipped themes pack to folder burg_install. Continuing to create a default configuration file named by burg & save it to $HOME/burg_install/etc/default. Here below is my default burg configuration file:

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_SAVEDEFAULT=true
GRUB_GFXMODE=saved
GRUB_THEME=saved
GRUB_FOLD=saved


Just in case you need a backup, copy burg files to folder /etc/default. Now, tell BURG that you have others OS (eg: Windows) on your machine. To define this, open 40_custom file from $HOME/burg_install/etc/burg.d folder & specify where partition your Windows reside. See my 40_custom modified file below:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
#

menuentry "Acer Recovery" --class windows --class os {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 3ab0e580b0e542cd
chainloader +1
}

menuentry "Se7en" --class windows --class os {
insmod ntfs
set root='(hd0,2)'
search --no-floppy --fs-uuid --set 3ab0e580b0e542cd
chainloader +1
}


As you can see on my example above (first partition contains Acer recovery partition & followed by Windows partition), please make an appropriate to your partition machine. Now, as root, install it to MBR so that it will take effect on the next boot:

#sudo $HOME/burg_install/sbin/burg-install /dev/sda
#sudo $HOME/burg_install/sbin/burg-mkconfig -o /boot/burg/burg.cfg


Then last, copy the extracted themes pack into /boot/burg. To check & re-check, make sure that you have already directory structure like mine below (or repeat from first step if it not the same):



Please note that users directory on picture above is your home directory. If there's no error reported after both commands above resulted, you may safely reboot your machine & get ready to see a changes.



See that, now GRUB has disappear replaced by BURG bootloader interface. To change themes, press “T” keyboard or “F3” to change the screen resolution or you can do some tweaks from configuration files modification (icons or backdround image) by reading the manual. Now, I have my favorite OS on my netbook, but I don't know how long it can stand. As the final words from this current article, I order to Fedora developer to enable GDM setup anymore (like previous GDM version) & add BURG as default bootloader on future release of Fedora. Please, share your own experience on Goddard on below comments box before leaving this blog. Thanks for passing by.

Labels: , , , , , ,

  Post a Comment

Goddard on Acer Aspire One (Part 1)

It's been a long while I had Open Solaris 2008.11 on my Acer Aspire One ~ it's particularly 2nd generation model AOA150 got from Google with 8.9” screen & 120 GB hard drive. I think it's enough to play through with Open Solaris & need to try to get back to Fedora which I passed it for last 5 major version.

Now, I have Goddard – a codename of Fedora 13 – iso & a brand new Western Digital Passport (an external hard drive with 320 GB capacity) I bought from bhinneka.com. Since I don’t have an external optical drive, I always used USB mass storage to installing OS on my netbook. This time, I'd like to try my external 320 GB hard drive as the iso master installation rather than my 8 GB USB.

At first, I had unboxing the hard drive & let it parted with a free partition kit named by EASEUS Partition Master 6.1.1 Home Edition. After that, I'll have 4 partitions on it. See it on partition table illustration below:



On that table, I'm planning to store out my data into partition #2, #3 & #4 – so we can ignore it from now. Let focus on first red partition table (10 GB) which I prepared for Fedora 13 iso with FAT32 partition type. Like usual, I also use Fedora LiveUSB Creator to make USB flash disk boot-able. I thought that it would be succeed either on USB external hard drive but it wasn't!



On picture above, none of drive letters shows up on Target Device combo. Why was that happened? Explained on a FAQ WIKI pages, that Windows sometime detects certain drives as NOT being removable devices – perhaps a different device class between USB Mass Storage & USB Removable Drive. But with a clue on that, that kit can force the 1st mode. Don't run it from double click icon, just open up a DOS command prompt on active directory where that software placed & type:

liveusb-creator.exe --force X:


where X refer to your drive letter on your external hard drive. Look at the picture below, i used G: as the target partition. Hit enter on the prompt window & vice versa... the Fedora LiveUSB Creator now shows the G: drive letter.



As soon as this way succeed, i then continue to the rest of process which was #1) burning iso to the external drive (X:)



#2) copying also the iso to X: #3) and last, stand by for the first reboot to boot to the external drive from BIOS. Once it booted smoothly, you ain't have no trouble for more. Just follow the on screen wizard to complete your Fedora 13 a.k.a Goddard installation or you can found the manual documentation elsewhere over the internet. I'll be back for the next part of Goddard; the complete Mac OS X Gnome themes until change GRUB into BURG boot loader. Stay tune on this channel...

Labels: , , , , , ,

  Post a Comment

Universal Stopwatch for UNIX Shell

How to calculate application performance? This is not a brand new question since there’s lots of benchmark software available on each purposes. For example, we can reckon a web based application performance from Firefox add-in named lori (Life of Request Info). This add-in do some basic statistic such as counting downloaded bytes & elapsed time from first click to load the application until it finished rendered to the browser – a simple tool than YSlow (of-course with different purpose), AFAIK. The best is, both of tools above support multi-platform in a Firefox browser. The image below is picture of lori & YSlow inside Firefox running over OpenSolaris 2008.11 on my netbook.



To counting how long process on a non-web based application will take time, perhaps you can try stopwatch application. For some OS, this kit is a build-in feature or at least it’s available on repositories. Below picture explain kind-of stopwatch application on Ubuntu 10.04 downloaded from default repository.



In a meantime you need to perform benchmark on an application but don’t have any internet connection to get those stopwatch (or you have forget to carry-up your watch or cell-phone), you can try to build your own stopwatch kit. The sample below, explain you how to make it from bash scripting shell & absolutely this is a universal kit for multi-platform on UNIX.

#!/bin/bash
BEGIN=$(date +%s)
while true; do
NOW=$(date +%s)
DIFF=$(($NOW - $BEGIN))
MINS=$(($DIFF / 60))
SECS=$(($DIFF % 60))
printf "\rTotal Waktu: %d:%02d" $MINS $SECS
done


Save the script above on text editor and make it executable. Run it from console & do whatever you want to do after doing that.



Have a great day!

Labels: , , ,

  Post a Comment

Bluetooth Handling Comparison Between Macintosh & Linux

We are now entering a Bluetooth century, a periods where Bluetooth are exist right up next to large numbers of gadgets. From entry level mobile phones to portable multimedia player equipments & now become a standard kit for notebooks or PCs. It’s presents replacing an old IrDA (infra red) data transfer technology. Still remember when I used an old Micron laptop & Siemens SL45i which both are equipped with IrDA link to did some data exchanges. And both too still I keep just for my own personal collections museum box.

Although that Bluetooth is not a modern technology, but it still become a mystery for some Unix based OS (CMIIW). This “mystery” word referring to OS native (kernel) software incapability to handle communication through Bluetooth between devices. I’m not talking about Windows series on this since it already robust & mature. Windows makes Bluetooth complied with main aspects; 3rd party drivers availability, the GUI & ease of use. Especially for Bluetooth, I agree with “Plug & Play” terms in Windows, but most “Plug & Pray” in Linux. Be ready to feel sad when your OS can’t provide a Bluetooth communication to your gadget.

Anyway, the Bluetooth handling in Macintosh is very easy to setup. I did the test with Nokia mobile phone & made a file transfer from and to between my laptop & the phone, just like a Nokia PC Suite software in Windows. First of all, make sure that you have already activate the Bluetooth link on both devices. Next from right upper panel on your Mac, you can see the Bluetooth icon. Make a click on it & select Browse Device… menu.



A Browse Files window will show up & you have to pick one device you want to pair after automatically search process finished. Continued to click Browse button.



Next, it will show the content of the memory on a new Browsing… window. You can decide whether you want to get or send files from this point. Just for example, you may want to get a file from the memory, select one file & click Get… button.



Then, a small window will appear indicate the progress of the process.



When it finished out, the file will be stored on default Documents directory. Just open your Finder from kicker shortcut.



It seem that you have succeeded to make a handshake between your Mac & gadget via Bluetooth. The whole process are quite easy. Just couple of clicks on an intuitive interfaces & it’s done. This Tiger are able to handling Bluetooth devices without 3rd party device driver.

What about Linux? I got to test out Ubuntu 7.10 Live CD with this & here below is the result.



The GNOME interface within Ubuntu 7.10 are similar to Macintosh. You may see the Bluetooth icon on the right upper to the status panel. Select Browse Device… menu from the icon. Anyway, the device search process are succeeded to identify the mobile phone name.



After clicking the Continue button, it raises an error message box saying something about invalid location through OBEX protocol.



Nothing error message are listed in on /var/log/messages & I still confusing about this error. Curious about this, I tried on a Fedora 7 box & still find out that it even worst than Ubuntu 7.10. This Fedora only show 2 menu (Preferences & About) without Browse Device menu in Bluetooth applet kicker.



Finally, I discovered that there are 3rd party software called KBluetooth listed on sourceforge.net for Fedora 7 KDE plug-in but still I failed to compiles the ball packages. Something about KIO (KDE Input Output) failed binding with Qt3 library system. Anyway, the 2 samples above signed that Linux still having a big homework with natively Bluetooth handshaking especially to the OBEX file transfer protocol services. The immature Bluetooth software on Linux restrict common users to gain more advantages playing Bluetooth on their gadgets. This is one of several aspect impacts to the terms that Linux is difficult to learn. Anyone agree with this?

Labels: , , , , , ,

  Post a Comment