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
Category: QA
Questions and answers.
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
Skype crashes because it cannot read data from “C:Documents and SettingsAdministratorLocal SettingsTemp”
Posted onOn my laptop, I install windows xp because it is user-friendly for me. However, Skype cannot be open because “The system is not unavailable”. At last, I find the “Skype” directory under “C:Documents and SettingsAdministratorLocal SettingsTemp” cannot be accessed. “C:Documents and SettingsAdministratorLocal SettingsTemp” is like temporary directory for specific user under Linux OS. Actually, for
Read more
git push error
Posted on$ git push error: The requested URL returned error: 403 Forbidden while accessing https://github.com/HarryWei/hummer.git/info/refs fatal: HTTP request failed Replace (or add) url=ssh://git@github.com/HarryWei/hummer.git with url=https://git@github.com/HarryWei/hummer.git under “[remote “origin”]” section in ~/.gitconfig file. Reference:http://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed
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
git: how to merge upstream with fork repo
Posted onHow to merge upstream into local fork repo with git? Merging an upstream repository into your fork: https://help.github.com/articles/merging-an-upstream-repository-into-your-fork/ Merging an upstream repository into your fork: https://help.github.com/articles/merging-an-upstream-repository-into-your-fork/
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
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 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 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 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
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
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 put AdSense ads in BuySellAds without iframe?
Posted onHi, I noticed that your site serves AdSense ads through BuySellAds and it is not in an iframe. By default, BuySellAds puts the backfill ads in an iframe. Puting AdSense ads in iframe is violation of the terms. How do you make BuySellAds not put AdSense ads in an iframe? Thanks! To inline the ads
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
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
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