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.
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.