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.
Learning in Linux community
If you are using Linux, then you are involved in the Linux community. As in the Linux community, most of the software are open source software, which is about sharing and distributing the source code among the community.
As a Linux user, I am not just learn to use the free software happily without paying money. Using the Linux is more benefit than just saving the money.
As a Linux user, I know that reading manual/documentations is important. There are a lot of questions are mostly answered in the documentations or manual. In order to find the answers, we should read the manual. If the answers are available in the manual, yet a newbie is asking in the forum, he or she will be asked to RTFM.
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,
AlphaOS a really great LiveUSB
These days, want to compile old projects. Firstly, I compiled all my code using Arch Linux. Then I decided to install my project to a LiveUSB, so that I need not to partition or use virtual machine on the target computer.
So I planned to use KNOPPIX. I tried Linux Mint in VirtualBox, since it is based Debian, but failed to compile my code due to the CEGUI version is not the latest as Arch Linux.
Traditional Chinese (BIG5) in the LANG=zh_CN.UTF8 locale
Recently, I tried to play Tecmo Koei Sangokushi 12 PK Traditional Chinese version (三國志12威力加強版繁體中文) on WINE using PlayOnLinux. It works fine, but there is a problem that is the game can only be run in LANG=zh_CN.UTF-8 locale instead of zh_TW.UTF-8 locale (there are some reasons behind). As a result, if I enter some Chinese characters using fcitx, the output will be converted. Such as 一 becomes 珨. This is because when using fcitx in the zh_CN.UTF-8 locale, the character will be encoded as zh_CN.UTF-8. However, because the game itself is Traditional Chinese, the output will be encoded as possibly BIG5. This can be proved by using iconv with the following command,
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.
Arch Linux, Sabayon, Gentoo
Arch Linux
I am an Arch Linux user, and I tried Arch Linux since March 2011. So far, Arch Linux works fine in almost everything. However, sometimes there are some issues which I face.
- Upgrading some libraries especially glibc, may cause Java related software cannot work, because these Java packages is not updated yet. Besides that, library like “icu” also causes LibreOffice cannot work sometimes.
- Sometimes, the latest software with new file format may not be supported in other computers. Similarly, some latest features does not work on other computers. For instance, when using PHP, in the later version we can write a statement such “$item = myFunc()[0];” where myFunc() is a function returning an array, and I want to access the first element immediately. By uploading such PHP script to the web hosting, because of the older version of PHP on the web hosting server, this statement does not work. That is, the best is not the best.
- Bluetooth problem. This is quite a long term problem. Pairing with bluetooth device is not smooth. I cannot mount the ObexFTP on the Android phone. Yet, there was no problem at all during the early time when I just using Arch Linux. Furthermore, I never successfully receive the file sent by phone through the bluetooth. Thirdly, sending the file to the phone through the bluetooth does not work with “blueman”, but only with “gnome-bluetooth”.
- Missed upgrades. I have one netbook, which is installed with Arch Linux but seldom used. When I want to use it, this requires a “great” upgrade. Sometimes this requires some manual configurations. Besides that, sometimes I need to download more than 1G size of packages for the upgrade. Thus, I will copy the cached packages from the frequently used computer to this old laptop. However, since it is a great leap, some dependencies are missing. This can be solved by checking the dependencies with “testdb”. Yet, the process is not easy. Because I experienced once which the upgrade caused the OS unbootable, due to the changes of systemd.
However, there are some advantages that I like about Arch Linux, which make me reluctant to look for alternative.
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.
Gambler's fallacy
Referring to my previous post about gambler’s fallacy, I was totally wrong after I pondering more about this.
In an example of tossing a coin, we know that to get a “tail” is 0.5 probability and “head” is 0.5 probability. That means, each result should fairly appear once. And in the experiment, if we tossed the coin 1000 times, then we will get the result of “tail” appeared around 500 times and “head” another 500 times.