SSH connection starts up slowly

The situation is: when connect to a server with SSH session, it starts up slowly (but the web connection is fast). For some tracing and debugging, it is due to the stupid DNS setting by someone.

The reference is – SSH session slow to start? It’s the DNS stupid!, and the solution listing:

1. Check for the DNS settings in /etc/resolv.conf or NetworkManger in Gnome or any management tools on desktop environment. Or
2. Set the ”UseDNS no” in sshd config: /etc/ssh/sshd_config, and then restart sshd.

Enjoy it. 🙂

Solution for android cannot search any wifi access point

The situations are:

1. There are access points but android phone has no result in the list.
2. The access point used in the past cannot be listing too.

The solution is, via the reference – HTC Tattoo WIFI 掃描找不到任何 AP 之解法:

IMPORTANT: ONLY FOR A ROOTED USER.

Using any file manager which can access the /data directory for your phone. Then remove a system generated file: /data/misc/wifi/wpa_supplicant.conf.

Because the file is generated by system which can be regenerated after reboot. So after reboot the wifi function works fine. But the secured network connections should be connected by hand again. Enjoy it. 🙂

How to extract specific file(s) using tar

If we want to extract specific file(s) from a VERY LARGE archive (eg. the file size is 6GB), we also can use tar to achieve this goal.

1. Find out the path name in archive file if you don’t know it via $ tar -tv -f {Archive file} | grep {File name}. And it will show the RELATED file path in the archive file after listing(-t) and filtering(grep).

2. Extract the file via $ tar -xv -f {Archive file} {File path}.

It is very easy, isn’t it?

How to make Apache to rewite correctly with SSL

Well…A strange issue. It is NOT enough just to enable RewriteEngine for correctly rewrite/redirect with SSL in Apache. While I checked the rules, in HTTP, the pattern and its substitution are functional. But in HTTPS, the pattern is malfunctioned. The solution is to enable the SSLProxyEngine for Apache. After that, there are at least THREE main module options in my HTTPS configure:

SSLEngine  On
SSLProxyEngine  On
RewriteEngine  On

If you have the same problem in HTTPS, trying it. 🙂

Some notes of genkernel

Here I listing some notes when I use genkernel in gentoo for the box ‘par’. The reference is Configuring the Kernel. Because I did not copy the configure file as default via # zcat /proc/config.gz > /usr/share/genkernel/arch/x86/kernel-config, the configuration will be reset every time I generated it. Because it is for some historical issue, I’ve found alternative way to it.

1
2
# cp /etc/kernels/{old kernel version} /etc/kernels/{new kernel version}
# genkernel --menuconfig all

Finally, after compiling, the bzImage, modules will be installed into corresponding directories.

Another notice is, we should check the links for the kernel in the /boot directory and the configuration in grub to avoid any configuration issues.