I keep seeing messages in dmesg as follows with “exception Emask 0x10” -> “SError: { UnrecovData 10B8B BadCRC }” -> “failed command: READ FPDMA QUEUED” -> “hard resetting link”: [ 7395.936692] ata4.00: exception Emask 0x10 SAct 0xe000 SErr 0x280100 action 0x6 frozen [ 7395.936701] ata4.00: irq_stat 0x08000000, interface fatal error [ 7395.936703] ata4: SError: {
Read more
Tag: Linux
How to mount LVM volume from an external hard disk on CentOS?
Posted onOn Fedora, after inserting/plugging in an exteranl hard disk with LVM partitions on it, the partitions will appear under /dev like /dev/lvm-group/lvm-partition. However, on CentOS 6, the LVM volumes do not appear automatically. How to mount LVM partitions from an external hard disk on CentOS? What you need on CentOS is to activate the LVM
Read more
How to encode spaces in curl GET request URL on Linux?
Posted onThe problem is like this: I would like to send a GET request using curl and the content has spaces, such as curl “http://example.com/send?msg=hello world” The space and the “world” will be left away if this command is executed directory on Linux. How to encode spaces in curl request URL? You can use the –date-urlencode
Read more
How to run screen on a Linux host reporting “Cannot make directory ‘/var/run/screen’: Permission denied”?
Posted onI want to run screen on a remote host on which I do not have root/sudo privilege and screen is not installed. I can compile or copy the screen program that can run on the host. However, it reports: “Cannot make directory ‘/var/run/screen’: Permission denied” As screen is not installed on the host, the directory
Read more
How to make curl request pass the Squid proxy?
Posted onI use curl to send requests to remote servers like following command. curl http://example.com/send –date-urlencode “data=hello” However, it is blocked by the network proxy squid in some networks with message like (some info anonymized with “…”): ERROR The requested URL could not be retrieved POST /… HTTP/1.1 Proxy-Authorization: Basic … User-Agent: Mozilla/4.0 (compatible;) Host: …
Read more
how to install older version gcc/g++ in Ubuntu (other linux distro are similar)
Posted onWhen we compile some project, it needs older version gcc/g++ version. So how to insall older ones in ubuntu 16? Install older gcc/g++ version sudo apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib Set gcc/g++ version to be used automatically sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.4 50 sudo update-alternatives –install /usr/bin/g++ gcc /usr/bin/g++-4.4 50 You may need
Read more
How to find a network adapter’s speed in Linux?
Posted onI have a Linux box and it is connected to a network through a network adapter, say gate. How to find what is the current speed (10Mbps, 100Mbps or 1000Mbps) of the adapter? You can find the network adapter speed by the ethtool command: ethtool: query or control network driver and hardware settings For example,
Read more
How to find a wireless network adapter’s speed in Linux?
Posted onHow to find a wireless adapter‘s speed in Linux? ethtool does not show the speed of the wireless adapters. For finding the configured speed of wireless adpaters in Linux, you can use the iwconfig tool. iwconfig: configure a wireless network interface For example, to find the speed of the wireless adapter wlp8s0: # iwconfig wlp8s0
Read more
Implementation of strstr in glibc
Posted onWhat is the implementation of strstr in glibc? Implementation of STRSTR in glibc (string/strstr.c): /* Return the first occurrence of NEEDLE in HAYSTACK. Return HAYSTACK if NEEDLE is empty, otherwise NULL if NEEDLE is not found in HAYSTACK. */ char * STRSTR (const char *haystack_start, const char *needle_start) { const char *haystack = haystack_start; const
Read more
How to disable SSH reverse DNS lookup on Linux?
Posted onHow to disable the reverse DNS lookup by the SSD server on Linux? To turn off reverse DNS lookups of the SSH daemon, log on the server and add UseDNS no to /etc/ssh/sshd_config. And remember to restart the sshd service by service sshd restart or systemctl restart sshd.service or other commands depending on your system.
Printing “powernow-k8 transition frequency failed” after install XEN
Posted onAfter I installed XEN hypervisor, the tty0 (CTRL+ALT+F1) prints “powernow-k8 transition frequency failed” to STDOUT continously, how to solve it? sudo rmmod powernow_k8 From https://lists.debian.org/debian-user/2013/01/msg00754.html How to make the settings persistent (take effect after reboot)? 1, Create script file ‘/etc/init.d/stop_pwoerk8.sh’ as follows. harry2vera@node1:/etc/init.d$ cat stop_pwoerk8.sh #! /bin/sh rmmod powernow_k8 2, Add the full PATH of
Read more
rtnetlink answers file exists
Posted onWhen you replace dynamic IP to static IP, you may need to restart your netwrok on Debian as follows. $sudo /etc/init.d/networking restart … …. reconfiguring network interfaces…rtnetlink answers file exists … However, error happens here “rtnetlink answers file exists”. How to solve it??? Run following commands could solve this problem # ip addr flush dev
Read more
Vim turns to be slow after enabling some plugins, how to find which leads the problem?
Posted onVim itself is very fast. But it turns to be slow after enabling some plugins. How to find which plugin leads the slowness of Vim? You may use the profiling mechanisms in Vim. Please check a tutorial on profiling Vim. For profiling Vim startup: vim –startuptime profile.log For profiling certain actions in Vim: :profile start
Read more
How to exclude last N columns in Bash on Linux?
Posted onHow to exclude last N columns of a string in bash? The point is that the number of columns in each line is uncertain (but > N). For example, I would like to remove the last 2 columns separated by ‘.’ in the following lines. systemd.3.gz systemd.mount.3.gz systemd.mount.f.3.gz The simple cut command cut -d’.’ -f1
Read more
I cannot login Ubuntu Precise desktop
Posted onI cannot login desktop in Ubuntu Precise. It told me following errors: Could not write bytes: Broken Pipe… Check Battery Satte Actually, I tried many ways to solve this problem. It seems that something wrong with my lightdm software so, at last, I use gdm software to replace lightdm to kill this problem. Just install
Read more
How to sort all files recursively by modification time in a directory on Linux?
Posted onHow to sort all the files in a directory and subdirectories recursively by modification time on Linux? You can make use of find (GNU find, or plus stat), sort and sed together to achieve recursively sort files by modification time: find . -type f -printf ‘%T@ %pn’ | sort -k 1 -n | sed ‘s/^[^
Read more
How to edit eps file?
Posted onI have made some eps figures for my paper but now I wanna modify them. How to edit them now? You may try inkscape on Linux: https://inkscape.org/en/ It can edit eps files.
How to find which program or process is listening on a certain port in Linux?
Posted onMy 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
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
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