Remove trailing whitespace with VIM

Here’s a quick tip on how to get rid of unwanted trailing whitespace using vim. Let’s say, I have the following code: Open that file with vim. The following command deletes any trailing white spaces. :%s/\s\+$//e Here’s the screenshot of the text after removing the whitespace: In search, \s finds whitespace (a space or tab). \+ finds one or more occurrences. $ matches the end of line, finally e flag means no error is displayed. ...

July 27, 2017 · 1 min · 96 words · kenno

Nvidia Driver on Fedora 25

Fedora 25 has Wayland enabled by default. However, if your computer has a (good) Nvidia graphic card and want to make use of it, you’ll need to switch to Xorg and install the Nvidia proprietary driver. Note that only the Nvidia driver with the version newer than 375.20 works on Fedora 25. Ref: How do I install the Nvidia driver on Fedora 25?

December 17, 2016 · 1 min · 63 words · kenno

Labeling an XFS Partition

Let’s say I have a partition as /dev/sdc1 formatted using XFS file system, and I want to give a label to it as externo. Here is one way to do it: # xfs_admin -L externo /dev/sdc1 writing all SBs new label = "externo" To read the label: # xfs_admin -l /dev/sdc1 label = "externo" Reference: HowTo Rename a XFS-Filesystem (label it)

September 29, 2016 · 1 min · 61 words · kenno

FreeBSD upgrade pool zroot

Today I successfully upgraded my FreeBSD home nas server from 10.3 to 11.0. This is the final release of version 11.0, though the official announcement is expected to be made on September 28. After the system upgrade, I need to also upgrade the 2 zpools (tank and zroot) so they can have new features. Upgrading tank was easy, all I needed to do was running this command: # zpool upgrade tank This system supports ZFS pool feature flags. Enabled the following features on 'tank': sha512 skein For zroot, in addition to running the above command (by replacing the actually zpool name to zroot), I also need to update the boot code. ...

September 27, 2016 · 2 min · 288 words · kenno

Warning: Use of "localtime" without parentheses is ambiguous

While looking at the log produced by Request Tracker (RT) 4.2.12, I noticed there was a warning message about using “localtime” without parentheses. Here’s the actual error message: [warning]: Warning: Use of "localtime" without parentheses is ambiguous at /opt/rt4/sbin/../lib/RT/Interface/Email.pm line 526. The solution which I found from here, fixed the problem: On line 526 of file /opt/rt4/sbin/../lib/RT/Interface/Email.pm, replace: localtime with localtime(). Thanks to the chap who posted the solution.

September 14, 2016 · 1 min · 69 words · kenno