Sunday, December 30, 2012

[Fedora 17] How to disable xscreensaver?

Under LXDE, I have disabled screen saver in KDE System Settings, but why I couldn't get rid of the "xscreensaver"?

It  is because the xscreensaver is not control by the setting in KDE system, but it is control by going to Application Menu > Preference > Screensaver.

Choose Disable Screensaver from the drop down menu. Bingo!

Tuesday, December 25, 2012

Scanning whole network range with Nmap

To scan the whole network IP range, we can use Nmap. It can be installed yum install nmap.x86_64

After installation, run nmap 192.168.0.1/24
* /24 mean scanning the whole range

Monday, December 24, 2012

[Fedora] HDD Benchmark with hdparm

To do a simple reading benchmark of Hdd, we can use hdparm. It may not install by default but we can easily get it by yum install hdparm.

After install, run hdparm -t -T /dev/sda (sdb, sdc, etc) and we can then see Cache Read and Buffered Disk Read speed.

My laptop has pretty poor performance with only 58.3MB/s for buffered disk reads, running on WD Scropio Blue 320GB.

[Fedora] Samba File Sharing Revisit

Update 25/12/12 17:40
Alright, I have much better idea what happen now. The pcmanfm file explorer that come with LXDE does not auto mount network folder, but Dolphin will do the trick.

As for the cifs-utils, that is needed to mount network folder from within the terminal.

So what about samba stuffs? I haven't dig into that, but if you have problem, no harm to install that.

I hope this update will make things clearer.

=======================================

Network file sharing is not easy in Linux. Despite my Xfce works fine with Samba network, but I have no luck on newly installed LXDE.

So what's the problem with it? To be very honest, I did not analyse the problem, initially I work around with mount & umount discussed in previous post. But today I have installed a few stuff from the package manager and it seems to work now directly from within Dolphin.

Below are packages that you may try to install to get it works:

  1. cifs-utils
  2. autofs (I guess this one is to deal with USB stick, cd/dvd, rather than network. But if you haven't install, you may try this.)
  3. samba-common
  4. samba Server and Client software to interoperate with Windows machine
Somehow, I feel it is the cifs-utils which do the trick. I would not dig to the root of this issue, perhaps next time. Until then, I hope this will help.

And one last thing, Merry Christmas and Happy New Year 2013!!


Friday, December 21, 2012

[Fedora] Mounting a network shared folder

The command to mount a network shared folder is:
mount -t cifs server:/folder-name /localpath -o username=userid,password=userpass
To unmount it, execute the following:
umount /localpath
It is so funny that the unmount command is 'umount', which is without "n". Wasted my half an hour to figure out this. Might be I really should read fundamental of Linux from scratch, not good to be "plug and play". :(

Run application standalone from terminal with root permission

If you get tired having to turn on many terminal so to run multiple application with root permission, try to add a "&" symbol after the name of application.

This will enable the application to run standalone from the terminal and you can continue to work on the same terminal.

[Fedora] Mounting a network shared folder under LXDE X11 Desktop

Switching from Xfce to LXDE has made me unable to access my network shared folder. The reason is using Nautilus in Xfce will automatically mount the network folder. But in LXDE, the network folder is not mounted by default, and I need to mount it using command line.

The bad thing is as a novice user, command line doesn't work as smooth. Luckily there is a tools namely "Gigolo" to simplify the procedure. It is located under Application Menu > System Tools > Gigolo. In some case it does not come with LXDE installation, then one would need to manually install it, yum install gigolo.x86_64.

Open up Gigolo we can see a connect button, press it and set the following:

  • Service type = Windows Share
  • Server = your server hostname / IP address
  • Share = the shared folder you would like to mount
  • Domain = this can be left blank
  • Username = username to access the server
Once enter / connect is pressed, there could be a pop up dialog (single line field) asking for password. For some reason entering password doesn't get rid of this dialog. Simply close it, then there will be another dialog box pop up, this time with two text field - Domain & Password. Simply ignore the Domain field and key in password. Voila! The network folder is now mounted.

[Ubuntu] Bonding - ALB and 802.3ad

Update 31/07/13: Be sure to install ifenslave before configuring the bonding.

Office network switch was upgraded to layer 3 switch recently, play around with bonding to create link aggregation. This can be done easily under Windows, but in Linux it is really big headache. Not because the steps are complicated and redundant, but you simply can't proof whether the configuration is working or not because Linux doesn't have a friendly way for user to check whether the bonding is up and running fine.

We can check under /proc/net/bonding/bonding, but even if it is up and running, it doesn't mean the networking is actually well connected.

By the time I write this article, I still unable to get it run fine, probably due to the switch is not well configured yet, waiting for technician to do a check on that. Meanwhile, I would like to share my /etc/networking/interfaces configuration here, so whoever encountered Linux bonding problem can refer to here, without the need to search for thousand solutions online but none of those are beginner friendly or prove working.

I would say the configuration below "should be working", due to the fact that such configuration appear working when we do "netstat -i" or "ifconfig". There are a lot of solutions online, some help you to understand the concept but can never get the "bond0" interface up.

Without more words, here we go:

Adaptive Load Balancing, bonding mode=6
 auto lo  
 iface lo inet loopback  
 auto bond0  
 iface bond0 inet static  
      slaves none  
      address 192.168.0.2  
      gateway 192.168.0.1  
      netmask 255.255.255.0  
      dns-nameservers 8.8.8.8  
      bond-mode 6  
      bond-miimon 100  
 auto eth0  
 iface eth0 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth1  
 iface eth1 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth2  
 iface eth2 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth3  
 iface eth3 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
802.3ad Link Aggregation, bonding mode=4
 auto lo  
 iface lo inet loopback  
 auto bond0  
 iface bond0 inet static  
      slaves none  
      address 192.168.0.2  
      gateway 192.168.0.1  
      netmask 255.255.255.0  
      dns-nameservers 8.8.8.8  
      bond-mode 4  
      bond-lacp-rate 1  
      bond-miimon 100  
 auto eth0  
 iface eth0 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth1  
 iface eth1 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth2  
 iface eth2 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth3  
 iface eth3 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  

I hope the above will help one who stuck with bonding. If this doesn't work properly and better solution is found, I would greatly welcome feedback and input.

Enjoy bonding!

========================================

Update 24/12/12:
The bonding configuration above is proven working, the issue I encountered was caused by the Dell PowerConnect layer 3 switch, which has some unknown issue that made the ports reserved for LACP not working properly. Re-configure and restart has get it up and running.

One more matter to take note is that you can actually remove the "bond-primary" under each eth. As for the dns-nameservers, it is advisable to specify that. Without that we have encountered some strange issue with VMs:

  1. the host and guest OS cannot ping and see each others.
  2. there is a "ghost" IP address, 192.168.0.222 appeared and tie with one of the ethernet. Bring up/down the bonding as well as each ethernet cannot get rid of it. Not even after restart.
Issues above being solved once the dns-nameservers is specified.

Now my server is running @ 4 Gbps and the HDDs has now become the bottleneck. Sigh... it's time to upgrade!

Thursday, December 13, 2012

[CentOS] Dependencies problem during DraftSight installation

libaudio.so.2 download for other distribution: http://pkgs.org/download/libaudio.so.2

Installing DraftSight in CentOS 6 with the binary package from official website may give error: 
requires libaudio.so.2
and I cannot find any useful solution from online. So how can we fix this?

It actually not hard to get it done:
  1. Go to http://pkgs.org/centos-6-rhel-6/epel-i386/nas-1.9.1-7.el6.i686.rpm/download/
  2. Download the binary package, install it with Package Manager. This should contain the libaudio.so.2
  3. Run the DraftSight.rpm again
  4. The setup will ask you to install extra stuff before it continues. Click install. Wait until it done.
  5. Once it is  done, navigate to Applications > Graphics.  Voila! DraftSight is running perfectly!

Install Skype 4.0 on Centos 6

Has not seen anyone get Skype 4.1 work on CentOS 6 yet. Here's a step-by-step guide to install Skype 4.0 on CentOS 6.3:

http://www.if-not-true-then-false.com/2012/install-skype-on-fedora-centos-red-hat-rhel-scientific-linux-sl/

Somehow I feel Linux should automatically solve the dependency of major software, else novice users are hardly adopt Linux.. It's great, but it's too cumbersome as well to get a simple task done. Haiz....

Wednesday, December 12, 2012

[Centos 6.3] How to run Nautilus as root from terminal?

If using "su", one might not be able to run Nautilus from the terminal. Instead use "su -" then Nautilus will open.

[Fedora] How to disable C6 Media Repo

There are two methods being discussed online:
  • yum --disablerepo=c6-media
  • yum-config-manager --disable c6-media (this one work for me)

Problem with installing Centos 6.3 on USB Stick

If you ever face "kernel panic" issue when trying to boot Centos 6 from your USB stick, it is due to the EFI bootloader doesn't point to root to your USB stick.

To fix this, simply go under the EFI folder in your USB stick, then find those files end with *.conf, use a notepad to change the "root=" to your USB device. In my case, it is some things like "live:UUID=xxxx".

Another note to take care is instead of install using UNetBootIn or ISO2USB, we can actually use Fedora Live USB Creator. The good thing about use Fedora's is that you can find your USB device's UUID under syslinux\syslinux.cfg.

Wish you will have a smooth boot!