How to remove a newline at end of file

Those who know me know that I don’t like Perl. Sometimes in life the thing you don’t like could be best tool/friend. I need to remove a newline character from a text file: layouts/partials/pagination.html. $ git diff layouts/partials/pagination.html diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html index 00c1124..d8dd981 100644 --- a/layouts/partials/pagination.html +++ b/layouts/partials/pagination.html @@ -15,4 +15,4 @@ </span> {{ end }} {{ end }} -</nav> \ No newline at end of file +</nav> The easiest way to do this is to run the following command: ...

June 9, 2016 · 1 min · 96 words · kenno

Fedora 23/24 gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1

While updating Ansible pip package on Fedora 24 today, I got the following error message gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory I believe I came across this problem before when I installed a ruby gem on Centos 6 a short while back. Unfortunately, I already forgot how I’d solved it. So here’s a note to remind myself or anyone who’s having the same issue. We need to install a package called: redhat-rpm-config. ...

May 15, 2016 · 1 min · 83 words · kenno

Installing Pip with Python 3.5 on FreeBSD

Here is a quick note serves as a self-reminder on how to get pip working or installed on FreeBSD 10.3. First, ensure that Python 3 package is installed. Python 3 is provided by python35 package. # pkg install python35 However, there is no package for pip, at least at the time of this writing, on FreeBSD. To have it installed, run the following command: # python3.5 -m ensurepip We should as well update pip to new version: ...

May 6, 2016 · 1 min · 84 words · kenno

How to renew DHCP lease with NetworkManager

Traditionally, we use dhclient to release and renew DHCP lease on Linux. It probably still work with modern Linux distros nowadays. However, most distros come with NetworkManager which provides nmcli command line interface to manage networking. Here’s how to renew DHCP lease using nmcli performing on my machine. Your output when running these commands could be different. First, let’s list the connections managed by NetworkManager. # nmcli con NAME UUID TYPE DEVICE virbr0 2c2c7c4f-15e9-439b-be1d-e1d0131fb41c bridge virbr0 Wired connection 1 5c9000c5-2635-4b09-90d7-71c3783c6626 802-3-ethernet enp0s25 enp0s25 70ee0b94-8341-46ec-953d-f2c3ca34285a 802-3-ethernet -- virbr0-nic aafaa95e-6ced-4ea9-bd4f-7c8d10fb51b6 generic virbr0-nic Next, we can find out the current IP associated with enp0s25 by running command: ...

March 17, 2016 · 1 min · 208 words · kenno

របៀបប្តូរ​ time zone ពីខំម៉ាន​ឡាញ​ក្នុង​អ៊ូប៊ុនធូ

ថ្ងៃ​នេះ ខ្ញុំ​បានទទួល Odroid-C2 ដែល​បាន​ទិញ​ពី​ Hardkernel កាលពីអាទិត្យ​មុន។ OS ដែល​អាច​ដើរលើ​វាបាន ​ក្នុង​ពេលនេះ​​ មាន​តែ Ubuntu Mate 16.04 LTS ដែល​ជាបេតា នៅឡើយ។ Time zone ដែល​មាន​ស្រាប់ជាដើម​គឺ EST (American Eastern Standard Time)។​ ខ្ញុំ​ត្រូវការ AEST (Australian Eastern Standard Time) ព្រោះខ្ញុំ​នៅ​ស៊ីដនី។ នេះ​ជាខំម៉ាន​ដែល​អាចប្តូរ Time zone បាន ដោយ​វាយ ពី ធើរមិណល់។ មុន​ដំបូង ឆែក​មើលមុនសិន៖ odroid64:~# date Fri Mar 11 08:13:04 EST 2016 ប្រើខំមាន នេះ​ដើម្បី​ប្តូរ​ time zone៖ odroid64:~# dpkg-reconfigure tzdata ជ្រើសយក​ប្រទេស រួច​ទីក្រុង។​ នេះជាលទ្ធផល៖ Current default time zone: 'Australia/Sydney' Local time is now: Sat Mar 12 00:13:57 AEDT 2016. Universal Time is now: Fri Mar 11 13:13:57 UTC 2016. Reference: ...

March 11, 2016 · 1 min · 85 words · kenno