bash less resize terminal overflow problem solved
I always have a problem with terminal emulator when using bash but not zsh. The problem can be produced like this,
- Open any terminal emulator (gnome-terminal, xfce4-terminal, etc)
- Run any command with less, such as “ls |less”
- Resize the window to larger size, such as maximize
- Quit less
- Type anything in the terminal, then the text will not wrap to new line if the text length beyond the window size before resie. And it will overflow to the same line and overwrite the prompt.
This problem can be solved by adding “shopt -s checkwinsize” in .bashrc.
Use WiFi router as switch
My workplace uses WiFi everywhere. Yet, my office room has a very poor WiFi signal. I was not sure whether it is poor signal problem or the ISP problem or any other problem, my Internet connection is suffered from the instability. When I use the Internet, or sending email, it is slow like heck and the messenger always disconnected from time to time. This is really annoyance. No Internet is better than slow or unstable Internet, because I need not wasting time to try to check mail or try to search information. Really wasting time.
List installed AUR packages but removed or renamed in AUR
Recently I found that, even the packages in the AUR are renamed, the AUR helper such as yaourt also cannot solve. When I prepared to ask for some solution in the Arch Linux BBS, I just think that it is possible to solve it myself. Finally, I come out with the following script,
[code language=“bash”] #!/bin/bash # # @author Allen Choong # @date 2014-09-04 # @version 0.0.1 # # This script is to identify the installed AUR packages, to check whether they are still # available in the AUR. This is because some packages are renamed or removed.
elinks "Host not found" crash in Arch Linux
I have come across with this problem for quite a long time. Whenever I elinks to a website, such as google.com or yahoo.com, it shows the message “Host not found”. I tried to google about the “elinks host not found”, “elinks resolve problem”, etc, none of them are relevant to my problem.
I thought it is the package error. But when I come across installation of the Arch Linux on a fresh computer, the elinks works fine.
Experience of flashing ROM to Samsung devices
Previously, I wrote my experience about installing CyanogenMod on the old Samsung phone. There are something worth to know before flashing, other than backup the precious data, download the ROM and tools, and take for any risk.
In my experience, it is best to get the stock ROM (that is the original ROM or firmware). This is to prevent some unexpected outcomes. With the stock ROM, at least we can recover to the (true) factory setting.
tcplay script
Recently, when I was using TrueCrypt in Arch Linux to mount a truecrypt container file, it was very slow to mount the container. Furthermore, I also read that the TrueCrypt is discontinued.
Therefore, I decided to use the tcplay. However, it is a command-line. Arch Linux wiki page shows a good tutorial on how to use tcplay.
When using tcplay in Linux, unlike mounting the folder like encfs, tcplay requires losetup for loop device. Thus, it involves 3 steps to mount a truecrypt container: i) setup loop device, ii) setup device-mapper with tcplay, and iii) mount. Consequently, to unmount the truecrypt containter need to reverse these 3 steps.
Experience of installing CyanogenMod to old phone
Recently, my phone (3 years old) is slower and slower. This causes me frustrated, especially if I want to use it to call urgently. Interface changed slowly, the contacts listed slowly, and my urgency becomes meaningless. So, the phone is either to be replaced with a new phone, or hack it!
My old phone, namely Samsung Galaxy S (i9000), to make it reborn, I decided to install CyanogenMod. CyanogenMod is well-known of its performance and reliability. The installation steps can be found in the wiki page.
Create LiveUSB in a general way
We can produce our own LiveUSB manually. The following are the steps that based on Arch Linux distro.
-
Build a kernel that supports AUFS, SquashFS, and optionally vfat support. So that we can mount these filesystems. In Arch Linux, we can build linux-pf for these supports. This package can be found from AUR.
-
Then we can generate the initramfs. In Arch Linux, we can use mkinitcpio to create an initramfs image. For instance,
Preserving text information in LibreOffice/OpenOffice Impress when producing PDF
PDF file is usually my favourite format when distributing the documents to other end users. In Windows, we can install PDFCreator, subsequently there is a virtual printer which can be used to “print” the documents as a PDF format.
In Linux, there is no PDFCreator. Yet the most common alternative is CUPS-PDF. CUPS-PDF is depending on CUPS (Common Unix Printing System). If we want to do any printing in Linux, this is the package that we need.
Joining video parts together
Have you downloaded the videos online, such as Youku, Tudou, or even YouTube? Have you downloaded the videos which the uploaders split the them into several parts?
Whatever your answer is, you may face the same problem as me.
I downloaded the videos to watch later. But the videos are split into several parts. I wish to watch it as a whole (because it should be one big file). So, I created this script to solve the problem. This script requires MP4Box (in the gpac package) and FFmpeg.