On Linux, how to force systemd to refresh or reloaded a changed /etc/fstab file? To force systemd to reload the changed /etc/fstab file content, run $ sudo systemctl daemon-reload To, further, make systemd auto remount any new entries, do $ sudo systemctl restart remote-fs.target local-fs.target
Author: David Yang
How to find the hostname of an IP using /etc/hosts if it has the mapping on Linux?
Posted onCommon DNS queries like ping will first get the IP of a hostname if it exists in /etc/hosts. How to find the hostname of an IP using /etc/hosts if it has the mapping on Linux? Multiple tools on Linux can do the “reverse” checking using /etc/hosts file. For example, if we have a line 192.0.2.1
Read more
How to check last boot’s systemd journal log in CentOS 7 Linux?
Posted onThe command to check last boot’s journal log shows nothing on CentOS 7: # journalctl -b -1 Failed to look up boot -1: No such boot ID in journal Is the log stored and where it is? The reason this happens on CentOS 7 is that CentOS 7 by default does not enable the persistent
Read more
How to show N entries in result of a select SQL query to MySQL?
Posted onHow to show only N entries in the result of a select SQL query to MySQL? The select SQL query is: select * from qa_users; To limit the N entries (say N = 10), we can use the limit clause as follows. SELECT * FROM qa_users LIMIT 10; Note that it is for MySQL. For
Read more
How to get all the keys in an associative array in Bash?
Posted onHow to get all the keys of an associative array in Bash? There are at least 2 ways to get the keys from an associative array of Bash. Let’s start with an example associative array: $ declare -A aa $ aa[“foo”]=bar $ aa[“a b”]=c We can use the @ special index to get all the
Read more
How to get the one character’s next character in ASCII table in Bash?
Posted onHow to get the one character’s next character in ASCII table in Bash? For example, if I have ‘a’ in variable i, how to get ‘b’? First, we need to get the integer value for the character. char=’b’ charint=$(printf “%d” “‘$char'”) Then, we increase the integer by one let charint=$charint+1 Last, we can get the
Read more
How to delete or get the number in the tail from a string in shell script?
Posted onHow to delete or get the number in the tail from a string in shell script (bash script)? Okay to call other tools. For example, from “/dev/sda8”, I want to get “/dev/sda” and “8” separately. This can be achieved by using sed as follows. To get the string after deleting the tailing numbers, we can
Read more
How to Set up or Disable Call Forwarding in iOS for iPhone
Posted onCall forwarding is useful if you are expected to be unavailable for receiving calls or lose cell phone coverage for some time. Call forwarding is not something that is “new” to modern phones. It is a feature which is invented in 1960s (the patent expired in 1980) of some telephone switching systems. But with iPhone/iOS,
Read more
Reference: Special HTML Characters
Posted onHTML supports many characters/symbols such as mathematical symbols, and currency symbols. They are not present on a normal keyboard. And some of these characters may have special meanings for formatting text. To add such characters / symbols to an HTML text, you can use an HTML entity name or an entity number in decimal or
Read more
How to Get Rid of DTS/AC3 Audio using ffmpeg on Linux to Play MKV Files on iOS or Android
Posted onI encountered the problem on iPhone that MKV video files with AC3 are played with no sound. The OPlayer reports to me that “According to DTS patent, DTS is forbidden to play , None of the media player on iPhone/iPad can play DTS”. However, the video file can be played in MPlayer on Linux just
Read more
Changing iPhone Holiday Calendar to Your Local One
Posted onI usually use iPhone in the English language. However, I find the iPhone calendar app includes a US holiday calendar subscribed while I am not in US and displaying US holidays in the iPhone calendar is no use and kind of annoying to me. After some investigation, I find the way to set the iPhone
Read more
How to Play YouTube Video in Background on iPhone
Posted onThis post introduces how to play YouTube video in background on your iPhone. With this tip, you will need not to keep the YouTube app opening all the time. So you can use other apps on iPhone while listening to the music or talk or others from YouTube. This tip should also work on other
Read more