Firefox has multiple profiles and I am aware of choosing them by invoking firefox with the -P option. But I find that after one firefox instance under one profile is running, even I choose another profile during starting with -P, the new instance is still running under the existing profile. How to run firefox with
Read more
Author: Eric Ma
Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.How to Add “nomodeset” to Grub2 in Fedora and Ubuntu
Posted onI need to add nomodeset to make my GPU card work on Linux. Latest Fedora and Ubuntu and their derives use grub2. How to add nomodeset permanently to grub2 on Fedora and Ubuntu? The parameters grub2 will use are stored in its grub.cfg file. The grub.cfg file is generated from grub’s default settings file /etc/default/grub.
Read more
How to redirect anything written on a file to another file in linux?
Posted onSuppose we have two files, a.txt and b.txt . If we write anything in a.txt & b.txt, it should be redirected to c.txt. tee may help for this purpose. tee: duplicate standard input You may try a command like this: echo “hello” | tee -a a.txt >>b.txt Both a.txt and b.txt will contain the “hello”.
Read more
How to wrap long lines in a text file on Linux?
Posted onI have some text files which contain some long lines. Now I would like to break lines to at most 80 characters. How to wrap long lines in a text file on Linux? The fold command can wrap lines. fold – wrap each input line to fit in specified width For your purpose, fold -w
Read more
Block Ads in WordPress, while mobile view
Posted onHi there, Quite recently I’ve created a native app (webview app)of my wordpress website and this wordpress site is using responsive theme as well. Now I want to publish this app at play store. The problem is that Adsense are not allowed to be shown in a native android app. So I want to know
Read more
How to enable SSH service on Fedora Linux?
Posted onHow to enable SSH service on Fedora Linux? By default, it seems ssh is not enabled. Fedora may not have sshd service installed/enabled by default. You will need to install and configure it by yourself. The following instructions is for Fedora 22 as an example. First, install the sshd server by # dnf install openssh-server
Read more
How to change the display manager on Fedora Linux?
Posted onThe default display manager on my Fedora 22 is gdm. If I would like to change it to other display manager like KDM, LightDM or other, which is the portable and reliable method? You can use the “system-switch-displaymanager” tools to manage the display manager. This is possibly the most portable way. To install it: #
Read more
How to Passwordless SSH to an OpenWrt Router?
Posted onThe good ssh-copy-id method which works well on common Linux seems not working for OpenWrt router. How to Passwordless SSH to an OpenWrt Router? OpenWrt’s SSH server is Dropbear. It can accept normal RSA keys. But the authorized_keys location is not the same as the openssh “~/.ssh/authorized_keys”. The location for the authorized_keys is /etc/dropbear/authorized_keys What
Read more
How to merge 2 .a libraries to one .a library on Linux?
Posted onWe have 2 static .a libraries and we would like to merge them into a single one for easier usage. How to merge 2 .a libraries to one .a library on Linux? With GNU ar, you can specify the single command-line option -M and control it with a script supplied via standard input, like the
Read more
Windows 7 repetitively tried to update but failed every time I boot Windows 7
Posted onWindows 7 repetitively tried to update but failed every time I boot Windows 7. It will reboot automatically several times itself. How should I fix it? First, you need to identify which update causes the problem. You can find this in the Updates control panel tool as follows. After identifying the failed package (e.g. KB3033929
Read more
How to configure systemd to boot Linux to console mode (runlevel 3)?
Posted onHow to configure Linux (am using Fedora 21) managed by systemd to boot to console (init 3) mode? systemd has the concept of targets as a more flexible replacement for runlevels in sysvinit. Runlevel 3 is emulated by multi-user.target. runlevel3.target is a symbolic link to multi-user.target. You can switch to ‘runlevel 3’ by running #
Read more
How to make Fedora Linux not clean some files in /tmp/?
Posted onOn my Fedora 20, I find that the system automatically clean up file under /tmp/. This is convenient. However, it cause some problems for some programs. For example, HDFS puts its DataNode pid file under /tmp/ by default like hadoop-hadoop-datanode.pid. After it is cleaned up, the hadoop-daemon.sh script will consider there is no DataNode running.
Read more
How to deactivate a LVM logical volume on Linux?
Posted onHow to deactivate a LVM logical volume activated by #vgchange -aay on Linux You may need to make a LVM volume group inactive and thus unknown to the kernel. To deactivate a volume group, use the -a (–activate) argument of the vgchange command. To deactivates the volume group vg, use this command # vgchange -a
Read more
Xterm color codes for Vim on Linux
Posted onVim uses Xterm color codes like 9, 1 and 114 on Linux. What’s the overall mapping from color to codes or codes to color? Xterm color table: You can also find the Xterm color codes here.
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
What’s wrong with the messages like “UnrecovData 10B8B BadCRC” and “failed command: READ FPDMA QUEUED” on Linux?
Posted onI 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
mkfs refuses to make filesystem with message “is apparently in use by the system; will not make a filesystem here!”
Posted onI have a disk from another server installed on a new server. However, when I try to make a filesystem on it, mkfs reports # mkfs -t ext4 /dev/sdd1 mke2fs 1.42.8 (20-Jun-2013) /dev/sdd1 is apparently in use by the system; will not make a filesystem here! This is a new disk to the new server.
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 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 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