My program reports that the port is already used. How to find which program or process is listening on a certain port in Linux? You can use netstat to do this. netstat can print network connections. For example, to find which program is listing on port 9999 netstat -pln | grep 9999 You will need
Read more
Category: QA
Questions and answers.
How to move all the files under Users for a user to another drive on Windows?
Posted onUnfortunately, my C: drive is almost full. Most of the space are used by the user home under C:Users. How can I move the home directory to another drive while not affecting the user’s usage of Windows. On Linux/Unix, moving the directory to another drive/partition and then keeping a softlink is enough. But how to
Read more
How to redirect WordPress search query to Google CSE?
Posted onHow to redirect WordPress search query to Google CSE? You can configure Google CSE to read the query variable (by default, it is q). Then, in your WordPress’s .htaccess file, add these 2 lines RewriteCond %{QUERY_STRING} ^s=(.*)$ RewriteRule ^ https://www.google.com/cse/publicurl?cx=xyz&q=%1 [R,L] Here, “https://www.google.com/cse/publicurl?cx=xyz” is your CSE’s public URL or the webpage that contains the Google
Read more
VirtualBox report “Kernel driver not installed” on Fedora 21
Posted onVitualBox is installed on Fedora 21 by # yum install VirtualBox The following packages are installed kmod-VirtualBox-3.18.7-200.fc21.x86_64-4.3.20-4.fc21.4.x86_64 VirtualBox-4.3.20-3.fc21.x86_64 There is the kernel modules package installed. However, when running virtualbox (after reboot), it reports: [zma@laptop:~]$ virtualbox WARNING: The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel (3.18.7-200.fc21.x86_64) or
Read more
How to limit the network rate used by scp in Linux?
Posted onI am using a shared network and scp to upload files. I do not want to use most of the bandwidth available. How to limit the network rate used by scp in Linux? You can use the -l option of scp to limit the rate of bandwidth. -l limit Limits the used bandwidth, specified in
Read more
How to quite VirtualBox scale mode?
Posted onHow to quite VirtualBox scale mode? Use this hot key shortcut to quit VirtualBox scale mode Right_Ctrl + c
How to use OpenVPN together with Ovpn Spider on iPhone?
Posted onBut.. how to use the OpenVPN together with Ovpn Spider on iPhone? You can check OpenVPN + Ovpn Spider: Free VPNs for iPhone Users.
How to configure interface bonding in Linux?
Posted onHow to configure interface bonding to bound to 2 eth interfaces together in Linux, specifically CentOS/RHEL? This tutorial Configuring Interface Bonding on CentOS/RHEL/OEL 6.x introduces setting up interface bonding well on CentOS / RHEL / OEL 6.
How to resolve a domain name from a specific DNS server instead of the configured one in Linux?
Posted onI would like to check whether the domain name’s IP has changed in the authoritative DNS server. The system’s configured DNS server may still cache the old IP, which is fine. The question is how to query from the authoritative DNS server the new IP? You can use dig – DNS lookup utility to query
Read more
HDFS stays in safe mode because of reported blocks not reaching 0.9990 of total blocks
Posted onAfter a node failure and restarting the HDFS, the NameNode reports: “The reported blocks 1968810 needs additional 5071 blocks to reach the threshold 0.9990 of total blocks 1975856. Safe mode will be turned off automatically.” in the log. Why this happens? And how to fix it? About why the NameNode stays in the safe mode:
Read more
Any good Web browser in command line in Linux?
Posted onWhat suggested web browser in command line? This will be very useful for browsing the Internet from a command line via SSH. You may use Lynx, a fully-featured World Wide Web (WWW) client for users running cursor-addressable, character-cell display devices, in Linux. Homepage: http://lynx.isc.org/ Lynx is a fully-featured World Wide Web (WWW) client for users
Read more
How to reset iOS / iPhone password?
Posted onI host lost the password of my iPhone. How to erase or reset it? Check Forgot passcode for your iPhone, iPad, or iPod touch, or your device is disabled from Apple for how to reset the passcode. As all methods will erase your iPhone, the “Recovery mode” method may be the most easier and reliable
Read more
How to disable the coredump function of systemd on Linux?
Posted onI do not want to have coredump for the developing machine using systemd on Linux? How to disable the coredump function of systemd? You can disable coredump function of systemd by adding this line Storage=none to /etc/systemd/coredump.conf For your reference: Storage= Controls where to store cores. One of “none”, “external”, “journal”, and “both”. When “none”,
Read more
Un-exporting an Exported Variable in Bash in Linux
Posted onHow to un-export an imported variable in Bash on Linux? For example, first, I export a variable MODE like export MODE=debug but I want to unexport the MODE (not turn to be `””`, should be truly non-defined). You can export -n MODE or unset MODE For your reference (from the [`bash` manual](https://www.systutorials.com/docs/linux/man/1-bash/)): export [-fn] [name[=word]]
Read more
How to use iPhone to browse blocked websites in mainland China?
Posted onHow to use iPhone to browse blocked websites in mainland China? FYI: on iPhone, these 2 Apps are the favorite combination I am using for visiting blocked websites in mainland China: Check OpenVPN + Ovpn Spider: Free VPNs for iPhone Users for how to use them together. OpenVPN is for setting up OpenVPN VPN connection.
Read more
Maximum allowed file path length for C programming on Linux?
Posted onWhen programming in C on Linux, it is common to allocate a buffer for storing the full path of a file. How to get a safe maximum size for allocating buffers for file paths? The header <linux/limits.h> includes macros for the path and file name length limits. On my system (Fedora 21), it is located
Read more
How to automatically post blog RSS feed to Google plus pages?
Posted onI have a blog with RSS feeds. Feeding to twitter and facebook is supported by many tools. But for the Google plus page, it seems not straightforward. How to automatically post blog RSS feed to Google plus pages? You can use Hootsuite to post blogs through RSS feeds to your Google plus pages. First, register
Read more
How to get the directory path and file name from a absolute path in Bash on Linux?
Posted onHow to get the directory path and file name from a absolute path in Bash on Linux? For example, with “/foo/bar/baz.txt”, it will produce: “/foo/bar/” and “baz.txt”. You also have the basename and dirname commands besides of the basename and dirname C API in Linux: [zma@laptop:~]$ p=”/foo/bar/baz.txt” [zma@laptop:~]$ dirname $p /foo/bar [zma@laptop:~]$ basename $p baz.txt
How to get a free Web server SSL/TLS certificates for my websites?
Posted onCan I get a non-self-assigned and free Web server SSL/TLS certificates for my https websites? Asking the users to accept the self-assigned SSL certificates for my websites is not very convenient. Please check https://letsencrypt.org/ . PS: StartSSL used to provide 1 year free SSL. But StartCom CA is closed since Jan. 1st, 2018.
Decrypting a Password Protected RSA Private Key
Posted onI got a password protected RSA private key with headers like (I have the password): —–BEGIN RSA PRIVATE KEY—– Proc-Type: 4,ENCRYPTED DEK-Info: AES-256-CBC,… How to decrypt a password protected RSA private key? You can use the openssl command to decrypt the key: openssl rsa -in /path/to/encrypted/key -out /paht/to/decrypted/key For example, if you have a encrypted
Read more