How to detect whether Linux runs in UEFI or BIOS mode inside the Linux?

Posted on

How to detect whether Linux runs in UEFI or BIOS mode inside the Linux itself without needed to boot the the management console of the mother board? You can detect whether Linux runs in EFI mode by checking whether /sys/firmware/efi exist. In bash, you can test by [ -d /sys/firmware/efi/ ] This technique is used
Read more

How to force a USB 3.0 port to work in USB 2.0 mode in Linux?

Posted on

We know that we can disable USB 3.0 in the BIOS. But is there a way to force a USB 3.0 port to work in USB 2.0 mode inside of a running Linux? On Linux on some platforms booted in BIOS modes, you can use the following command to force USB 2.0 modes for your
Read more

How to advertise different gateway ip via DHCP in OpenWRT?

Posted on

How to advertise a different router/gateway ip via DHCP in OpenWRT? In general, you need to configure the DHCP option with code 3 (router). (A list of all options can be found in http://www.networksorcery.com/enp/protocol/bootp/options.htm ) For example, to advise the gateway IP 192.168.1.2, you will send this option: “3,192.168.1.2” Now, for OpenWRT, you have 2
Read more

How to host multiple websites on a Apache Linux web server?

Posted on

I have a Linux web server with Apache (httpd). How to host multiple websites on Apache? To host websites www.example1.com and www.example2.com on a single node with Apache2 on a single IP, you can use VirtualHost as follows. Edit /etc/httpd/conf/httpd.conf and add the following lines: NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /var/www/example1.com ServerName www.example1.com # Other
Read more

How to allow websites’ .htaccess files in Apache2?

Posted on

How to allow websites to use .htaccess files in Apache2 web servers? The AllowOverride directive controls this: http://httpd.apache.org/docs/current/mod/core.html#allowoverride To allow AllowOverride in a directory, add the following rules to the /etc/httpd/conf/httpd.conf or similar configuration file for your apache installation: <Directory “/var/www/www.example.com”> Options FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files.
Read more

How to Add “nomodeset” to Grub2 in Fedora and Ubuntu

Posted on

I 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 enable SSH service on Fedora Linux?

Posted on

How 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

What’s wrong with the messages like “UnrecovData 10B8B BadCRC” and “failed command: READ FPDMA QUEUED” on Linux?

Posted on

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

How to redirect WordPress search query to Google CSE?

Posted on

How 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

Any good Web browser in command line in Linux?

Posted on

What 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

Un-exporting an Exported Variable in Bash in Linux

Posted on

How 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 make Chrome on iPhone (iOS) accept self assigned ssl keys fir websites?

Posted on

This tutorial introduces how to make Chrome accept self assigned ssl keys for websites: https://www.systutorials.com/50204/making-chrome-accept-self-signed-certificates-on-linux/ However, on iPhone, Chrome blocks me from access sites with self assigned keys. How to make Chrome on iPhone also accept the ssl keys? At the time when I wrote this reply, there is no way to add Certificate Authorities
Read more

Good Cinnamon theme for Fedora 21 Linux?

Posted on

Any suggestion on good theme configuration for Fedora 21 Linux? My favorite combination of Window borders, Icons, Controls, Mouse Pointer and Desktop is as follows. All packages and themes are from Fedora repository or the Cinnamon repository. Remember to set the cursor theme for QT application like Google Chrome following: https://www.systutorials.com/4068/configuring-mouse-cursor-style-for-qt-applications-in-gnome-mate-desktop/ For this configuration, the
Read more

How to force a website to use https by htaccess settings?

Posted on

I would like my site to be accessed by https only. How to force a website to use https by htaccess settings by redirecting http requests to the corresponding https ones? You can check the method of redirecting http to https at: https://www.systutorials.com/qa/1033/how-to-redirect-http-to-https-in-apache-with-mod_rewrite If you would like to have a 301 redirect, you can use
Read more

How can I recover data from my crashed hard drive?

Posted on

My laptop’s hard drive crashed. I went to someone else and got the hard drive replaced, but they could not recover my data. You may try PhotoRec as for https://www.systutorials.com/qa/1399/how-can-i-recover-deleted-photos-from-samsung . Although its named with “Photo”, PhotoRec can recover many kinds of files as listed in http://www.cgsecurity.org/wiki/File_Formats_Recovered_By_PhotoRec .

How to install vbetool on CentOS 6.6?

Posted on

I found CentOS 6.6 does not ship vbetool in its default repositories, EPEL or RPMfusion. How to install vbetool on CentOS 6.6? First, download the source package from http://www.codon.org.uk/~mjg59/vbetool/ and unpack the package. Second, install needed packages: # yum pciutils-devel pciutils-devel-static libx86-devel During the building, it will try to find the libpci.a in a different
Read more

How to build mplayer with libdvdnav on Linux?

Posted on

I find the mplayer from rpmfusion does not contain libdvdnav. How to build mplayer with libdvdnav on Linux? I did this on Fedora 21 to build mplayer with libdvdnav: Download mplayer src from http://www.mplayerhq.hu/design7/dload.html and extract the tarball. Install needed packages (you will need more if you need more features): # yum install gcc make
Read more

How to merge git branches quickly and correctly

Posted on

Suppose I have following branches harryxiyou@common_vm ~/forest/sqle/sqle/scripts $ git branch * dev-harry master rc After I did some changes on dev-harry branch, I wanted to merge dev-harry into rc branch. 1, git checkout rc 2, git merge dev-harry References:http://stackoverflow.com/questions/24147169/merge-two-remote-branches-in-githttps://www.atlassian.com/git/tutorials/using-brancheshttp://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging I usually add –no-ff during git merge to force git to add a commit for the
Read more