MIUI upgrade


Today I just upgraded the MIUI to version 7. Actually, it prompted for the  upgrade since some times last week. But I failed to upgrade, expected to be server problem.

So, today I determined to find the solution for manual upgrade. The upgrade version is MIUI 7.0.5.0. I visited the official site and searched the ROM, but the official site does not have this ROM. As a result, just did a search, and found the target ROM in the MIUI official forum. Then everything becomes easy now.

In order to upgrade manually, we have to identify the filename of the target ROM. If we can start downloading the ROM file partially, then we can get the filename from the folder downloaded_rom.

Then to download using our desktop web browser such as Firefox, make a search online for the filename. For my case, it is “miui_MI3WMI4WGlobal_V7.0.5.0.KXDMICI_9830c22421_4.4.zip”. Make sure you are downloading from the official forum, where the file is located in the true MIUI server.

After download the ROM file, copy it to the downloaded_rom folder, run the system upgrade, then the phone will use the ROM directly. The phone skips the step downloading the ROM which may be very time exhaustive.

Finally, reboot, and upgrade success.

今天升级了MIUI 7。事实上,前几天(上个星期那样)就已经有提示让我升级了。不过试了很多次,都升级失败。应该是服务器的问题。

所以,今天我决定要手动升级。升级版本为MIUI 7.0.5.0。尝试了上官方网站找,但找不到这个ROM。结果,就上网搜寻,在官方讨论区找到。接下来就不是什么问题了。

首先,我们必须要知道ROM的文件名。这可以从downloaded_rom文件夹里看下载到一半的ROM。知道文件名之后,就可以用浏览器上网搜寻并下载。我所下载的是miui_MI3WMI4WGlobal_V7.0.5.0.KXDMICI_9830c22421_4.4.zip。为安全起见,所下载的文件应该是由官方讨论区而来,文件也应该是从MIUI的服务器下载。

下载完毕后,就复制到电话里的文件夹downloaded_rom。然后就来个系统升级。这个,就跳过了由电话下载ROM的步骤。

最后,重启,升级成功。

Advertisements

LibreOffice Writer table tips


Preface

LibreOffice Writer is better than Microsoft Word. If you are a web developer, you should understand that there are class and style. Using LibreOffice is tended to using class-like style, instead of direct formatting, which causes a lot of inconsistent, troublesome, and time consuming modification throughout the word processing. And this is happened when the newbies are using Microsoft Word to create templates for the advanced user like me, and causes me full of trouble as being tortured.

The worst thing in Microsoft Word is the Numbering format. Microsoft Word sets the numbering format as properties of a paragraph. But LO Writer differentiates the paragraph style, character style, frame style, page style, and the list style. Thus, it is much more easier to use the list style in LO Writer.

I admit that LibreOffice Writer still has some limitations comparing to some features of Microsoft Word, but for the styles and formatting, it is much more easier than using Microsoft Word.

Now, let me go into the tips of the table in LO Writer. The LO version I am using is 5.0.

Table at the same line of paragraph

In Writer, unlike image, table by default cannot anchor as character. Therefore, it cannot have some text at the left or right of a table. This can be solved by using frame.

Table in the paragraph line
Table in the paragraph line

So, create a frame and set the properties,

  1. Type > Anchor as character
  2. Type > Vertical Top to Row (depend on your preference)
  3. Wrap > Spacing four sides to zero
  4. Borders > Set no border
  5. Insert table inside the frame.

Remove/add the empty line after table

As the image above, you can see within the frame, there is an empty line after the table. This line, you cannot delete or “backspace”. So, in order to solve this, at the last cell of the table, press Ctrl+Shift+Del will delete the empty line. In order to add the empty line, Alt+Enter.

Vertical text in the table

To create a vertical text, it has to create a new style (it can be based on the Table Contents). Then at the new style properties,

  • Position > Rotation / Scaling > 90 degrees or 270 degrees (based on your preference)

After creating this style, just select the content of the cell you want to have a vertical align, apply the created style, than it will work.

Vertical text in the table
Vertical text in the table

There are several things have to take note when using the style to rotate the text. The image above shows two different ways to rotate the text. The left bottom cell is using the method mentioned above, the right bottom cell is using the following method,

  1. Select the text in the cell, and go to Table Properties,
  2. Text Flow > Text orientation >Vertical

By using the Text Flow method, we cannot change the rotation direction as shown in the left bottom cell. But using this way, we can change the alignment and indent easily. When we choose align to the centre, the text will be centre as usual.

However, using the Style method, it is quite confusing. When using Style, if we align the text to centre, it is based on the view of the table, instead of make the text centre itself.

Centre text problem
Centre text problem

As the image above, the first cell has the following properties

  • Table Properties > Text Flow > Alignment > Top
  • Paragraph Properties > Alignment > Options > Centre

The second cell has the same properties as above.

In order to make our text at the left cell start from the left bottom corner, then we have to set

  • Table Properties > Text Flow > Alignment > Bottom
  • Paragraph Properties > Alignment > Options > Left
Align the table
Align the table (they left and bottom).

Padding in a specific cell or customise a cell

As the image above, we want to adjust the left cell of the text, so that the text and the bottom border has some spacing, this have to customise the cell specifically. However, LO Writer does not show any clue for you to edit the properties of a cell, and it only shows you “Table Properties”.

It is actually possible to customise a certain cell.

  1. Select a cell by highlight the content inside,librlibr then hold and move the cursor to next cell. We will discover that the cells are highlighted, instead of the text within.
  2. Since there are two cells being selected, we move our mouse back to the original cell. And we will get something like this,
Select a cell
Select a cell

Now, the cell can be edited with Table Properties (which is actually selected cell properties).

 

So, these are a few tips which are useful to manage the table in the Writer.

WINE and CDemu


Previously I posted about installing software/game with different CD/DVD ISO images in WINE. But this method does not work in some installation ISO images. Because these installation will detect for the CD/DVD. The method above does not solve the problem because the installation does not detect the CD/DVD.

Recently, I found a better solution. It is CDemu. It is similar to DAEMON Tools in Windows. It will emulate the optical disc drive in Linux. As a result, it will produce /dev/sr0, /dev/sr1, and so on. Because it is a virtual CD/DVD, thus we have to load the image. It can be easily loaded by using gcdemu.

Once the image file is loaded, we have to mount the image as root. I mount the image to /mnt/cdrom. Then, in WINE, run the winecfg, then it will automatically appear the CD-ROM in Drives tab. In my case, it is E: drive.

Now, I run the installation from WINE, I can detect the image as CD/DVD.

JDownloader 2 BETA Japanese font


Previously I was reluctant to use JDownloader 2 BETA version. The main reason is that I will see boxes when the files contain Japanese characters. But this problem solved now.

As I am using Arch Linux, the JDownloader 2 is installed at /opt/JDownloader. We have to create two files:

  1. /opt/JDownloader/translations/org/jdownloader/gui/translate/GuiTranslation.en_custom.lng
  2. /opt/JDownloader/translations/org/appwork/swing/synthetica/LanguageFileSetup.en_custom.lng

The GuiTranslation.en_custom.lng is a copy of GuiTranslation.en.lng. So that the interface is still using English language. Then LanguageFileSetup.en_custom.lng is a copy of LanguageFileSetup.ja.lng. So that the font is using Japanese language font instead.

Open the JDownloader, change the User Interface language to “English (CUSTOM)”. Restart. Now, I can read the filenames properly.

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,

  1. Open any terminal emulator (gnome-terminal, xfce4-terminal, etc)
  2. Run any command with less, such as “ls |less”
  3. Resize the window to larger size, such as maximize
  4. Quit less
  5. 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.

Since my office room has an Ethernet cable port on the wall, and I was told by my colleague that using the cable is stabler and faster than using WiFi. Therefore, I decided to install a router in the room for me and my colleague. Without actual networking knowledge, I have to look for the information, and I found this page.

Since I do not have much information about the network topology of my workplace, I just try the solution and it works! In my workplace, when connected to WiFi network, then I can use the network printer and have Internet connection. My computer is assigned with IP address and also DNS servers IP addresses are given.

Thus, in order to install the router, yet can still connected to the network printer, online, and automatically obtain the IP address, I have to disable the NAT and DHCP server so that the router works as bridge or switch only.

I connected the computer to the Ethernet port on the wall to get the IP address of the default route and some other information such as DNS servers.

Since the router was no more acting as a router, and it did not assign IP address to the connected machine, with the available feature, I configured the router to use the remote DHCP server.

Enable the WiFi access point, then I can connect to the router with the wireless network and work as expected.

Since the network is using another IP address class, so I cannot access my router unless I configure my connection to connect to the router.

Though the connection is smooth and stable, there is a drawback. When using some Arch Linux commands such as yaourt or cURL, the connection does not work properly. Yet I have no idea how to solve this problem.

 

2014-10-29

The problem of yaourt and cURL I faced was showing the message such as “port: 80 No route to host” when using yaourt, or “curl error: Couldn’t connect to server” when using cURL, for some domains. After looking for some information from Internet, some forums mentioned that it is caused by IPv6 problem, by disabling it, the problem can be solved.

I have tried to disable it from the Network Manager. Then I found that it is not the solution. To disable the IPv6 effectively, I have to disable it from sysctl too. Now everything works fine.

(Without the router, there is no such problem. I am not sure that whether the router is configured incorrectly.)

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,

#!/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.

#Get the packages
packages=(`pacman -Qmq | sort`)


#For each of the package, check with the AUR
packagesStr=''
for x in ${packages[@]} ; do
  packagesStr+="'$x' "
done

packagesOnAur=(`/bin/sh -c "package-query -A -f '%n' $packagesStr | sort"`)

#As the rule of thumb, the installed packages are more than packages checked in the AUR
for((i=0;i<${#packagesOnAur[@]};i++)) ; do
  j=0
  while [[ $j -lt ${#packages[@]} ]] ; do
    if [[ ${packagesOnAur[$i]} == ${packages[$j]} ]] ; then
      unset packages[$j]
      packages=("${packages[@]}")
      break
    fi
    ((j++))
  done
done

for x in ${packages[@]} ; do
  echo $x
done

The script requires package-query. It will list out all the installed packages which are not found in the AUR. This includes the packages we installed ourselves locally, or deleted or renamed packages in the AUR.