Cleaning yaourt old files
I have a habit to backup the files. As a result, using the yaourt (Arch Linux pacman helper), I have saved a lot of files in a directory. From time to time I need to clean up the directory manually by deleting old files, because the size is increasing gradually.
So, I finally wrote a script to clean the old files in the directory.
It is available here.
Programming languages re-visit
C
After many years of experience in programming, gradually I have newer perspective towards the programming languages. Previously, I was fervent in C language, which I assumed as a low level, powerful programming language. The OS kernel such as Linux is written in C language. To use C language, we need a lot of computer science knowledge, such as pointer, memory buffer, linked list, and so on. Furthermore, there are a lot of libraries supported in C, and C libraries can be ported to C++. That is why I liked C so much. Moreover, the library such as “glib” can make C written in object-oriented. By the knowledge of C language, learning other programming languages will be easier.
Arch Linux upgrade, downgrade, and rollback
One of the reasons, I recently consider to switch from Arch Linux to Debian which is famous in stability. However, I am very reluctant to do so, because of the greatness of simplicity in package management of Arch Linux, especially creating packages in AUR. Debian, though famous, there is much manual work in packaging such as preparing the “control” file (may be there are some other tools I not yet explored, because I used Ubuntu and Linux Mint before for only a short period). Besides that, Debian does not have the repository like AUR. Installing the packages such as TrueCrypt and XnViewMP in Debian is not as easy as Arch Linux. That is why I am hesitated to migrate.
YouTube automatic captions to .srt subtitle format
If you know how to download the video from YouTube, then you may like to download the automatic captions (in English) as the subtitle. The automatic captions unlike the “closed captions”, “closed captions” can be downloaded using the userscript such as Download YouTube Captions. With the script, we can download the captions as the .srt subtitle format.
However, automatic captions is different. It is created by YouTube based on speech recognition, thus the captions are not very accurate. But I personally feel that it may be a little useful. Therefore, I have done some scripting to solve the problem semi-manually. Semi-manual is because the preparation of the subtitle have to do it manually. I do not spend time to write a userscript to solve it.
Arch Linux manual recovery
Though SystemRescueCD is powerful, if it is system specific, then it cannot work. With the recent changes of the Arch Linux filesystem, I made a mistake that I cannot start Arch Linux after a careless reboot.
The instruction from the official site mentions,
- Fix any non-official packages with files in /bin, /sbin or /usr/sbin to put those files in /usr/bin.
The term “fix” does not give me too much solution about the packages. These packages mostly come from AUR. What can I do to “fix” them? There is no much hint for me. Thus, I ignore this part, though I can list those packages.
Portable OS with Qemu (partially success)
LiveUSB is too nice, especially for recovery. KNOPPIX or Puppy Linux can also be used as OS temporary to do the work and save the file. However, LiveUSB is too distro dependent. Thus, I am wondering how to prepare a portable OS by virtualisation through Qemu.
The advantages of this idea is to
- allow the user to install any OS, meaning that the user can install any packages to do any work.
- have an OS in an FAT32 formatted pendrive where the OS can have the size exceeds 4G.
- be portable as a portable application.
However, there are some disadvantages.
Change a computer but preserve the OS (Arch Linux) and data
This is interesting. Previously, if I want to change a computer, I will (re-)install the OS and other software on the target computer. Then only move the data.
Since Arch Linux is a minimalistic distro, and installation only available with network connection. This will be exhaustive to install the OS on the target computer. Not only wasting time downloading, but also setup the configurations, such as web server, FTP server, hibernation, power save, etc. User’s configurations are easier, because I can just copy all the files in /home/$USER directory to the target computer. The only problem may be the differences of the owner ID and group ID. But that is not really a big deal. So, the main problem is the root (/).
Extracting files from zip which contains non-UTF8 filename in Linux
Previously, I have made a post about extracting SHIFT_JIS filename encoding in zip file.
However, this method does not work when the filenames contain GBK (simplified Chinese) encoding. As a result, I found a general solution for the non-UTF8 encoding.
The method is almost the same, but more generic way.
Firstly, the problem we face is after extracting the files, the filenames are unreadable. Not only that, we cannot convert the filename even we are using “convmv”, “iconv”, or even “uconv”. This is normally caused by our OS locale setting. To make our OS (Linux) more generic to read almost any languages (East Asia languages, right-to-left langues, etc), our OS is normally has the UTF8 locale. It may be en_US.UTF8, ja_JP.UTF8, zh_CN.UTF8, zh_TW.UTF8, en_GB.UTF8, etc.
Stable release, cutting edge scheduled release, or rolling release?
Again, choosing the Linux distro, based on different philosophies, we may choose a different distro, though they are all using Linux kernel.
I would like to use Debian to represent stable release Linux distros, Fedora to represent cutting edge Linux distros with scheduled release, and Arch Linux to represent the rolling release. If you visit DistroWatch.com, you can see the difference of the packages version (Debian, Fedora, Arch Linux), where Debian has very few green colour packages, Fedora has a lot of green colour with some red colour packages, and Arch Linux has a lot of green colour but no red colour packages. The green colour indicates the latest (stable) release version of the package; red indicates the beta version (development or testing).
Choosing Linux distros
Linux is something wonderful, which until today I am still learning. Not only the command-line, but also filesystem, distributions, philosophies, open source, packaging, Linux kernel, desktop environment, etc…
It is very interesting to know why thereĀ are so many Linux distros. As I was a newbie in Linux, I was thinking on how to choose the distros and what are the differences of these distros. Some users state that Linux is the kernel, not a Linux distribution. And even some users say that whatever Linux distribution, it can be customised until identical to the other distribution (interface only).