Migrating Arch Linux from 32-bit to 64-bit
These days, I decided to migrate my Arch Linux from 32-bit to 64-bit. There are several reasons that make me to make such decision.
Firstly, in Arch Linux official site, there was an announcement that Arch Linux will drop 32-bit. And in the wiki page, it mentioned that Arch Linux user should use 64-bit if the processor supports.
Secondly, new distros such as KaOS and Evolve OS only support one architecture 64-bit. That means 32-bit is considered less targeted.
电脑图形文件格式(image file format)需知
这篇用中文,赠给有缘人。
JPEG vs PNG
很多人在工作时,都会用到图形文件(image file)。甚至有时还需要制作图形(图画)。当图形完成时,一般人都会使用JPEG格式。JPEG格式,就是在文件扩展名(file extension)后,加入 .jpg,或 .jpeg,甚至 .jpe。一般遇到的都是 .jpg。若是Windows用户,就未必会看到这些文件扩展名。
除了JPEG格式,还有一种格式是必须知道的,即使PNG。PNG和JPEG是有极大的差别的。以下是例子:
[caption id=“attachment_1063” align=“aligncenter” width=“147”]
hello.jpg[/caption]
[caption id=“attachment_1064” align=“aligncenter” width=“147”]
hello.png[/caption]
这两种格式,乍看之下是没有差别。因为hello.jpg用了90的压缩质量(类似90%之意)。就是这个压缩级别(compression level)带来了很大的差别。虽然压缩质量90,但是现在我将它们放大后做比较,
[caption id=“attachment_1065” align=“aligncenter” width=“300”]
放大后的JPEG[/caption]
[caption id=“attachment_1066” align=“aligncenter” width=“300”]
放大后的PNG[/caption]
这里我们可以看到两个差别。就是PNG的字非常“干净”,而JPEG的则有些“脏”。那是90的压缩质量的结果。若使用者想要把文件压缩成更小的file size,而将压缩级别调成90以下,那图形会变得更“脏”。原因是JPEG的压缩方式是lossy compression,即“有损压缩”。就是在压缩的时候,将不重要的讯息摈弃,好让文件大小减少。相反地,PNG用的是“无损压缩”。
更惨的是,若把JPEG文件打开,再储存一次,就会再次“有损”图形。储存越多次,“有损”也越多次。
因此,本人的基本原则就是,类似照片的图形文件,本人都用JPEG。而自制的海报类,有文字的图形,电脑绘制的图形,本人都用PNG。
Raster vs Vector
这两个东西比较少人懂。即是raster image(位图)和vector image(矢量图形)。以上的JPEG和PNG都是属于raster image。而vector image一般人比较少接触到。最普遍的vector image的格式本人知道的就是SVG。一般的绘图软件(image editor)是无法编辑SVG的,必须用专用的软件,如Inkscape。
Raster image和vector image的最大差别就是,当raster image的品质越好的时候,file size就会越大;而vector image是没有如此的问题。正如我们拍照,若用13MP的质量和5MP的质量相比,file size是有很大的差别的。然而,vector image的file size不会随着图形的大小而有多大的差别。纵然如此,vector image不能用在如照片这类由现实而来的图形上。因此,用vector image的话,图形的大小是没有任何影响的。而用raster image,图形的大小会影响到图形的质量。以下举个简单的例子。
[caption id=“attachment_1067” align=“aligncenter” width=“300”]
放大后vector image的边缘[/caption]
[caption id=“attachment_1068” align=“aligncenter” width=“300”]
放大后raster image的边缘[/caption]
Web, cloud, virtualization, Docker, and Linux
From time to time, I always feel that I have to choose the “best” Linux distro. And I feel that, various Linux distros are somehow annoying, why not just combine all the best features into one powerful OS? (That is why I always struggle for the distro like Arch Linux and Debian.) With the recent trend of the technology such as LXC and Docker, I found that the varieties of the Linux distros is really a good way as it is diverging and exploring the new solutions for our daily problem.
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.
Running multiple Firefox with different versions in Linux
Previously, in my post of the other blog, I mentioned that I have to use command-line to run multiple Firefox with different versions. Now, I found an easy solution to solve this problem. Please note that, running different version of Firefox should using different profile, just to avoid downgrading and upgrading the profile based on the Firefox version.
Assuming we installed Firefox Nightly version,
-
Firstly, using the command-line to create a new profile using ProfileManager,
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.
Machine learning
Machine learning is one of my favourite studies (though I am not very knowledgeable in machine learning). It impressed me very much during my first time entering the lecture of the course. I was wondering how can a machine learn? I know how searching and optimisation work, they are just trial-and-error to get almost all the possibilities. But how a machine learn?
How does it work?
The simplest example is using the perceptron. It is a very basic Artificial Neural Network (ANN) concept. It can be used to learn a very simple pattern. (All the learnings are related to the pattern.) Perceptron simulates the neurons of the brain. In human, when we learn something, the connections of the neurons become stronger. In perceptron, the connections of the neurons are represented as the “weights”. The stronger the weight, the stronger the connection.
Linux containers (LXC) on Arch Linux
Due to a recent Q&A from DistroWatch.com, I am considering the advantages of using the scheduled-release or fixed-release distros, especially Debian which is famed of its stability. The following is the quote from DistroWatch.com,
Rolling releases do tend to have their downsides though. For instance, it is difficult for third-party developers to create software for rolling-releases as a rolling-release distribution is a moving target. It is difficult to target and support an operating system which is changing on a regular basis.
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.