Remove a file/directory starting with dash/hyphen

I just noticed that in the /root directory, there exists a directory with its name starting with a dash: -p in my FreeBSD box. root@raspbsd:~ # ls -l total 144 drwxr-xr-x 2 root wheel 512 May 5 18:26 -p drwxr-xr-x 2 root wheel 512 May 5 20:45 .byobu drwxr-xr-x 3 root wheel 512 May 5 20:45 .cache -rw-r--r-- 2 root wheel 959 Jan 23 00:59 .cshrc As much as I wanted to get rid of it, I was curious to find out what’s inside that directory. ...

July 7, 2015 · 1 min · 212 words · kenno

ISC Dhcpd Duplicate UID Lease

Someone asked this question in one of his blog posts: Ever see this? dhcpd: uid lease 192.168.1.150 for client xx:xx:xx:xx:xx:xx is duplicate on 192.168.1/24 Yes, I’m seeing something like that now in the my dhdcp logs. Here is the actual message: DHCPREQUEST for 192.168.1.109 from 08:00:27:6e:61:b8 via eth0 DHCPACK on 192.168.1.109 to 08:00:27:6e:61:b8 via eth0 DHCPINFORM from 192.168.1.109 via eth0 DHCPACK to 192.168.1.109 (08:00:27:6e:61:b8) via eth0 uid lease 192.168.1.224 for client 08:00:27:6e:61:b8 is duplicate on 192.168.1.0/24 DHCPREQUEST for 192.168.1.109 from 08:00:27:6e:61:b8 via eth0 DHCPACK on 192.168.1.109 to 08:00:27:6e:61:b8 via eth0 I think I know why this happened. Basically, the machine with MAC address of ’08:00:27:6e:61:b8′ used to have grab an IP address ...

June 25, 2015 · 1 min · 198 words · kenno

PySpark takeOrdered example

Sort by keys (ascending): RDD.takeOrdered(5, key = lambda x: x[0]) Sort by keys (descending): RDD.takeOrdered(5, key = lambda x: -x[0]) Sort by values (ascending): RDD.takeOrdered(5, key = lambda x: x[1]) Sort by values (descending): RDD.takeOrdered(5, key = lambda x: -x[1]) Credit: http://stackoverflow.com/questions/30787635/takeordered-descending-pyspark

June 24, 2015 · 1 min · 42 words · kenno

YUM what provides this file, huh?

This post is primarily written to remind myself, an Ubuntu user, to figure out how to find what RPM package provides a file — for example a header file. Today, I’m trying to compile and install R 3.1.3 on CentOS 6 from source code. This R installation is one of the requirements to install Tessera stack. The instruction from the installation page is: sudo yum install blas blas-devel lapack lapack-devel wget http://cran.r-project.org/src/base/R-3/R-3.1.3.tar.gz tar zxvf R-3.1.3.tar.gz cd R-3.1.3 ./configure --with-blas --with-lapack --with-x --enable-R-shlib make sudo make install Unfortunately, the process failed with ./configure with the complain about missing readline library. To fix it, I had to install readline-devel package. ...

June 24, 2015 · 2 min · 220 words · kenno

Install PostgreSQL server on Raspberry Pi from FreeBSD port

Before I wrote this blog post, I had thought there was no binary package for PostgreSQL server for FreeBSD 11 running on Raspberry Pi. Hmm… how wrong I was! I just wasted the whole night compiling Postgres from source. DOH! Anyhow, here’s the step I took to do it. If you’re familiar with FreeBSD, there’s nothing new here. But, I only use FreeBSD once in awhile, and so I tend to forget a lot what I do. ...

June 18, 2015 · 2 min · 426 words · kenno