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!

Wednesday, October 31, 2012

Ubuntu starting in low graphics mode?

If you ever encountered Ubuntu starts in low graphics mode, it could be due to the following:
  1. your "/" or "/boot" partition are full. Do a check with df -h, if it is the case then clean out some useless stuff and do a reboot
  2. the lightdm or gdm is corrupted. Uninstall it completely with sudo apt-get purge gdm or sudo apt-get purge lightgdm, then reinstall with sudo apt-get install gdm. Select lightdm or gdm from the menu. (you might try lightdm first, if it still give problem, go with gdm)
  3. the desktop might have corrupted. If you are using XFCE4 like I do, continue with sudo apt-get purge xubuntu-desktop and sudo apt-get install xubuntu-desktop. Same method work for ubuntu-desktop.

Tuesday, October 30, 2012

Things to take note when sharing files


  • Using Webmin as interface to configure the sharing, it is very important to set valid users beside the read/write permission. Leaving the valid users input blank will give chance for other unauthorized user to bypass the read/write permission and gain access to the folder with read only permission.

LVM with RAID

http://home.gagme.com/greg/linux/raid-lvm.php

Monday, October 29, 2012

Removing Ubuntu Unity 3D?

I will share the resources I gather in regard removing the annoying Unity 3D and run only your favorite windows manager:

Ubuntu 12.10 - Remote desktop from Win7 give blank screen

There is always problem here and there with fresh install Ubuntu. It is really unlike Windows 7, no matter what you have install things will normally work just right away without much configuration.

XRDP session in Ubuntu can't escape as well. I believe a lot have experienced login from Windows 7 to Ubuntu will see only the wallpaper without any taskbar. There are many many work around online and most of them required a lot of command line input and even some require reinstallation / removal of certain piece of software inside.

Gathering info from all those advices, one can realize it actually something to do with what is being loaded up upon login from remote. The gnome-session-fallback seems not working on Ubuntu 12.10 possibly due to Unity-2D is completely gone out of 12.10. And if you are like me who prefer xfce4 than any other, then the solution is as simple as below:
  1. locate the startwm.sh in /etc/xrdp
  2. you can do vi or simply fire up leafpad with sudo privilege. the last line of it should be ./etc/X11/Xsession
  3. replace it with xfce4-session (or you can simply add a "#" in front of the "xsession" line to disable it and enter xfce4-session in a new line)
  4. now login again from remote desktop connection and voila!
Configuring different desktop session:

  1. Lubuntu: lxsession -s Lubuntu -e LXDE
  2. Gnome Fallback: gnome-session --session=gnome-fallback

Thanks to NuxIT from linuxquetions.org for the idea of such a simple solution. The original discussion thread can be found here:
http://www.linuxquestions.org/questions/linux-networking-3/problems-connecting-to-xrdp-xfce-desktop-after-ubuntu-upgrade-943189/

Additional resources:

Bandwidth Monitor - Bandwidthd


Download: http://bandwidthd.sourceforge.net/

How to install:
  • http://community.spiceworks.com/how_to/show/1261-how-to-use-bandwidthd-to-monitor-your-network
  • http://infodotnet.blogspot.com/2008/02/install-and-configure-bandwidthd-per-ip.html

Sunday, October 28, 2012

Check / Rebuild RAID in Ubuntu?

Come across a command that at least can tell me something about my RAID10.

Original URL: http://ubuntuforums.org/showthread.php?t=1844859

The command:
sudo dmraid -sa to get a report on the array
sudo dmraid -rebuild "name from above" to rebuild it.

Bonding / Teaming in Ubuntu 12.10

For those who has 4 x Gbe (Intel NIC) configuration with 1 x IPMI network, here is what you can do:

  1. Install ifenslave
  2. Load up the driver for bonding (will add in info later, check reference link as for now)
  3. Locate "interface" /etc/network
  4. Change the content accordingly based on this sample:
=============================================
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# Adaptive Load Balancing Teaming
auto eth0
iface eth0 inet manual
bond-master bond0

auto eth1
iface eth1 inet manual
bond-master bond0

auto eth2
iface eth2 inet manual
bond-master bond0

auto eth3
iface eth3 inet manual
bond-master bond0

auto bond0
iface bond0 inet static
address 192.168.0.11
gateway 192.168.0.1
netmask 255.255.255.0
bond-mode balance-alb
bond-miimon 100
bond-slaves eth0 eth1 eth2 eth3
=============================================
  • then use command sudo ifdown XXX to bring down all your existing network connection
  • next, sudo ifup bond0
  • in certain circumstance, you might need to do sudo -s, then bring up all the four Gbe LAN by using ifup eth0, ifup eth1, etc
  • to check whether the bonded network loaded up properly, you can go /proc/net/bonding/ and check the bond0
Some useful references:

Windows Files Sharing with Linux

Configure sharing for Windows under Linux is really a headache for linux beginner like me. There are a lot of tutorials out there to teach you how to do it but none of that really give a quick and straight forward solution to new learner.

After a day of hunting for solution, finally I come across Webmin. This is really life saver for windows based user who just embrace Linux, as all settings can be done within web browser. It makes configuring Linux as easy as working with NAS web configuration.

However, the pain to share file for windows doesn't get lesser even with that. In windows we can easily bring up Advanced File Sharing dialog and set permission based on per individual user. Afaik in Linux the file permission cannot be set based on individual user, there is only 3 permission if you right click > properties.

So how do we set file share permission based on individual user in Linux? The answer is by using the read-list, write-list in the smb.conf (samba sharing configuration file). Here's a simple guideline:
  1. Log into Webmin
  2. Create share folder under Samba Windows Files Sharing
  3. Under Security & Access Control, assigned the user into appropriate field (for example, User A in read-only, User B in Read-Write)
  4. You might want to add user(s) under Invalid User in order to prevent unauthorized access to the shared folder.
  5. Once you are done with this, open up Nautilus / Thunar / Dolphin, locate the folder you gonna to share, right-click > properties > under "Others", set to Read/Write, and enable Recursive for sub-folder and files under same directory.
  6. Next restart samba service.
  7. Now you should have setup the file sharing properly.
If you don't, please do not hesitate to drop me a comment, I will try to answer as my steps listed above might miss out something, and due to very limited experience now, I might mislead in certain aspect, but don't worry, let's figure it out together.
 

Ubuntu installed on Xeon E3 shutdown out of sudden?

In recent installation of Ubuntu 12.10 on Intel Xeon E3-1200 V1 system, I have encountered random shutdown out of no reason. The most obvious symptom I can observe is the HDDs running on RAID10 would first go down before the system is completely power off.

Steps that I have done to troubleshoot including:
  • unplug & plug all the HDDs.
  • relocate all SATA cables
  • relocate the RAM to another slot
  • change power cord
  • check CPU temperature
Nothing solved the problem. I then reset the BIOS.

Before power up the server, reading the manual of motherboard I realize the Execute Disable Bit seems not officially supported on Ubuntu. I then disable the function.

Everything seems working fine afterwards. I have not tested whether it is the BIOS which caused the problem or the Execute Disable Bit create the problem, but if you do encounter the same problem like I did, try disable it. May save your day. =)

Saturday, October 27, 2012

Mount disk

To mount & read NTFS you have to install yum install ntfs-3g

As far as I know the best GUI tool to mount a disk is come with Gnome, which is the Gnome-Disk-Utility. If you want to run it from terminal, the name is kinda weird as it is completely different from its name - palimpsest

By using Gnome-disk-utility, mounting a disk is just two steps:

  1. select the partition
  2. click on the "Play" button shown on the right screen.
  3. Voila! (well, this is not a step, so... two steps, ok? =P)

The best file manager

Personally I find Nautilus to be the most powerful file manager, second with Thunar, especially when it comes to browse network. Dolphin is very handy, with the split panel button shown on the toolbar, but it seems to be the slowest when accessing network resources.

The only thing Nautilus annoying is the default icon display at the location. To permanently change it to location bar without clicking Ctrl+L everytime, simply:

  • install yum dconf-editor.x86_64
  • fire up dconf-editor
  • under org > gnome > nautilus > preference > "always use location entry"
  • be sure to have your existing Nautilus instance close, else you will find the check box cannot be ticked.

Friday, October 26, 2012

Working with Samba

Things to install

  1. yum install samba
  2. yum install samba-client


For beginner, it is much much easier to configure Samba with SWAT. Here's how:
  1. First you need to yum install xinetd.
  2. Next, yum install samba-swat.x86_64
  3. You will then need to edit the file under /etc/xinetd.d/swat, change the disable=yes to disable=no
  4. Instruction in Arch Linux might have ask you to run "xinetd daemon", but I have run into trouble with that. Instead, I do "xinetd" and successfully log into SWAT configuration page in web browser.
Some important things to take note when configuring shares for access from Windows:

  • for every changes made to share, samba server need to be restart. This is very different from share within Windows, whereby all changes are made effective immediately



Some useful reference:

Editing a file belong to root

This is actually fairly simple, but for a Windows user like me I suffer quite some time to figure out.

It is fairly simple to do this, say you want to edit a configuration file under /etc, fire up Terminal, and run as "su", then under 'su' run leafpad (I'm using XFCE). This leafpad is different from what you launched from app menu, it will allow you edit and save the file as root user.

Easy isn't it? I spent almost half an hour to figure out this though. =)

Getting started with Linux (Fedora)

Migrating from Windows to Fedora could be a dilemma. I have tried many times install Fedora but give up before success.

This post contain pool of resources one should read when first started with Linux:

Thursday, October 25, 2012

Samba for Windows Shared Files

To access windows shared files, one would need to install Samba and configure it properly. Resources below would guide you throughout the process, and there are a lot more resources that would help you understand Linux better:
  • http://www.reallylinux.com/
  • http://www.reallylinux.com/docs/sambaserver.shtml

Installation of Libre Office

To install LibreOffice 3.6 properly under Fedora 17, you will need to do two steps:
  1. Download and yum install all the rpm come with the download package
  2. yum install "freedesktop" rpm under the "Desktop Integration" folder. Someone mentioned that desktop integration specify for Fedora has no longer available since the freedesktop work well under Fedora.
It's done then!

How to improve font rendering in Fedora?

Here's a collection of links related to font rendering:

Easy installation of basic & 3rd party apps

There are a few tools that provide easy installation:

  1. Fedora Utils - fedorautils.sourceforge.net/
  2. EasyLife - sourceforge.net/projects/easylife-linux/
  3. AutoPlus - this is generally unreachable now since dnsmouse.org has down

XFCE's keyboard customization


Original content from:
http://alensiljak.blogspot.com/2012/04/windows-key-for-applications-menu-in.html

Windows Key for Applications Menu in xfce

If you want to use Win key to open the Applications menu in xfce, follow the instructions here and, instead of typing "xfce4-popup-menu", use "xfce4-popup-applicationsmenu".


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

How to "Show Desktop" in XFCE?

The Show Desktop icon can be enabled by right-clicking the task panel > "Add New Items".

To configure keyboard control, go to Settings > Windows Manager > Keyboard Tabs & look for "Show Desktop". Default key combination is Ctrl + Alt + D.

I personally prefer it to use Windows + D, which is identical to how we use it in Windows.