Sunday, September 29, 2013

CSSH on MacOS X 10.8+

I assume that you've already known what CSSH (or ClusterSSH in formal) is. In short, it is a way for control many Unix/Linux boxes in parallel in the same way.

I always use CSSH on my Fedora box at work, but this is the first time I have to use it at my home to control my cluster. And my laptop's operating system is Mac OS X 10.8. That is the problem.

Installation of CSSH on Mac OS X seems to be simple. If you want to do it in a lazy way like me, use port.

sudo port install cssh

Then, you try to connect to some host, for example.

cssh root@somehost

It should works well??? Oh no, some strange error message occur like the one as follows.

Can't connect to display `tmp/launch-P6rxkT/org.macosforge.xquartz:0': Invalid argument at /opt/local/lib/perl5/vendor_perl/5.12.4/X11/Protocol.pm line 2270

If you open file Protocol.pm and go to line number 2270, you will see that it try to use INETSocket (wrong) instead of UNIXSocket (right). That is because $host is not equal to "unix". Now you have to change something here to let it use UNIXSocket by checking whether $host contains "xquartz" or not. You change the line number 2262 (the IF command before the error line) from

if ($host eq 'unix') {

to

if ($host eq 'unix' || index($host, "xquartz") != -1) {

(Ahh, that's the error of Perl 5.12.4 distribution of  Mac Ports.)

That's all. Let's try again and see everything goes well.

Wednesday, August 28, 2013

Supermicro Server: Reset the IPMI Password

You might sometime forget your IPMI password or you get the server from other and want to reset it? There are some options for you. However, first of all, you should try with the default IPMI account, which is ADMIN / ADMIN.

IPMICFG

Supermicro provides a tool for you to manage your IPMI settings named IPMICFG. You can download it from the following location.


It contains tools for DOS, Linux, and Windows.

IPMI Tool

If you have Linux installed on that server, you can install OpenIPMI and IPMI Tool to manage the local or remote IPMI service.

To reset the password, all you have to do is as follows.

# service ipmi restart

If IPMI service could not be started, please stop here. You might not have IPMI support in your server.

First, you have to get the user id of the account "ADMIN".

# ipmitool user list

ID  Name      Callin  Link Auth IPMI Msg   Channel Priv Limit
2   ADMIN            true    false      false      Unknown (0x00)

You might see the output as above with the user id of account "ADMIN" is 2.

Now, you change the password of user with id = 2 to "MATKHAU", for example.

# ipmitool user set password 2 MATKHAU

That's all. Have a nice try!

Tuesday, August 13, 2013

RHEL/CentOS/Fedora: How to Disable CPU Frequency Scaling/Throttling

Attention! Be sure you REALLY want to perform this action! Do it at your own risk!

I assume that you may already know the reason before reaching my post. Run the following command as root. That's all.

echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor >& /dev/null

Have fun!!!

Thursday, July 4, 2013

Some post-installation steps to make Fedora 19 more comfortable

So, as you may now, Fedora 19 (Schrödinger’s Cat) has released for few days. And this time I decided to upgrade my PC immediately, and everything seems to be very smooth.

For Fedora, I have to make some minor changes to make it more comfortable, such as:
  • Install Liberation Fonts (version 2).
  • Fix the font's rendering problem.

Liberation Fonts

Liberation fonts are installed in Fedora by default. However, it is kept at version 1.07 with very poor quality. And to get the much better quality, I always upgrade them to version 2.

You can download compiled fonts from the Liberation Fonts page or RPM packages from Fedora's page. I choose the former method.

$ wget https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-ttf-2.00.0.tar.gz
$ tar -zxvf liberation-fonts-ttf-2.00.0.tar.gz
$ sudo cp -f liberation-fonts-ttf-2.00.1/*.ttf /usr/share/fonts/liberation/
$ sudo fc-cache

Now the Liberation fonts are ready to use. We will fix the font rendering problem before change font settings for GNOME to reflect what we have done so far.

Fix Font Rendering Problem

If you've ever see an Ubuntu screen, you may see a much better font rendering. The problem here is Fedora disable RGBA sub-pixel hinting. All you have to do is to enable such feature by install package freetype-freeworld from RPM Fusion.

$ rpm -ivh ftp://mirror.switch.ch/pool/3/mirror/rpmfusion/free/fedora/releases/19/Everything/x86_64/os/freetype-freeworld-2.4.11-2.fc19.x86_64.rpm

Now, to change the default fonts and default font hinting methods for GNOME, you should install gnome-tweak-tool.

$ sudo yum install gnome-tweak-tool
$ gnome-tweak-tool &

Change the default font settings as in the below screen.


To make everything the same as Ubuntu, you should run the following command.

$ echo "Xft.lcdfilter: lcddefault" >> ~/.Xresources

You may need to log out and log in again to reflect the changes.

Saturday, August 11, 2012

SOCKS Proxy over SSH with OpenSSH (Linux) or PuTTY (Windows)

Do you want to use a proxy for surfing Internet without using untrusted proxies? If you have a SSH account to a server with an Internet connection, this article will show you how to create your own SOCKS proxy for above purpose. I will also show you how to do that on both Linux and Windows.

1. Create SOCKS Proxy

Linux

On Linux, all you need is an OpenSSH client which is normally installed by default by almost distros. Open Terminal and run the following command to create a SOCKS proxy which listens for connections on port 1080.

$ ssh -D 1080 username@hostname

A more advantage command which I normally use is as follow.

$ ssh -NCf -o "ServerAliveInterval 300" -D 1080 username@hostname

Please check the man page of ssh for options.

Windows

PuTTY might be the most popular SSH client on Windows. Fortunately, it also supports SOCKS proxy. You should use the latest version which can be downloaded from here.

Open PuTTY an declare information such as host name as normal.

The main window of PuTTY where you can declare host name, port, etc.
The important part is to open a port for listening locally as a SOCKS proxy. Change to "Tunnels" category; fill the port to "Source port" and choose "Dynamic"; click on "Add" button.


Now, you can back to the "Session" category and click on "Open" button to log in to your server.

To avoid session timeout, you should tell PuTTY to send some null packets to the server after some duration. To do that, go to "Connection" category and fill out the number of seconds between null packet sending.


That is enough for proxy. You now have a SOCKS proxy listening on port 1080. It is time to configure web browser redirect every connection via newly created proxy.

2. Web Browser Configuration

Firefox

If you use Firefox, you can set the proxy information by accessing "Options" dialog on Windows or "Preferences" dialog on Linux. Then change to "Advanced" category; choose "Network" tab and click con the "Settings..." button.


Declare the proxy information as in the following screenshot.


Click on OK and OK again. That's all! You now can access to an IP check service to confirm that your web connection routed via the proxy. You can try IP2LOCATION.

Chrome and Internet Explorer

Both Google Chrome and Internet Explorer use the system settings for the proxy. You can declare the information by opening "Internet Options" dialog from Control Panel or Internet Explorer or Chrome.


Change to "Connections" tab and click on "LAN settings" button.


On the "Local Area Network (LAN) Settings" dialog, un-check "Automatically detect settings" and check on "Use a proxy server for your LAN (These settings will not apply to dial-up or VPN connections)." Then click on "Advanced" button.


Declare information as in the above screenshot and click on OK.

On Google Chrome, you can open the system proxy settings by choosing "Settings -> Show advanced settings... -> Change proxy settings..."

Hope this article is useful to you, sometime ;).