How to unban IP from PF firewall

This post is probably more relevant to my use case of PF firewall running on FreeBSD 11.1, and I need to remind myself how to unblock an IP from the block list. Here’s a snippet of what’s in /etc/pf.conf: table persist # Don't send rejections. Just drop. set block-policy drop # Exempt the loopback interface to prevent services utilizing the # local loop from being blocked accidentally. set skip on lo0 # all incoming traffic on external interface is normalized and fragmented # packets are reassembled....

November 17, 2017 · 2 min · 269 words · kenno

Set the HostName and Computer Name via command line on OS X

Work recently acquired a few MacBook laptops to be used and shared by staff. Though the computing staff is not expected to have immense knowledge about OS X, when things break down we are the first point of contact. The last time I used a Mac machine extensively was around 2007. Then I switched to Debian and could never look back. Anyway, there must be lot of new things and I’ll try document or post snippets here as I learn new things....

November 17, 2017 · 1 min · 114 words · kenno

How to list all installed R-packages

I don’t use R, and nor I do know much about it. However, I maintain R’s installation on linux machines at work. Today, I learned a new trick to list all installed R-packages. Here it is: ip = as.data.frame(installed.packages()[,c(1,3:4)]) ip = ip[is.na(ip$Priority),1:2,drop=FALSE] ip And here is the sample output: Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors....

October 5, 2017 · 1 min · 201 words · kenno

Install Grub on GPT

I came across a problem with grub being broken recently on a system running Ubuntu 16.04. This happened after the grub2 package got upgraded. This post will explain how I solved the problem. If you have similar issues, please do not just copy and paste the commands and execute on your machine. First read on, and try to understand it. Usually, when this happened in the past, we just need to chroot into the system and reinstall grub....

September 25, 2017 · 4 min · 690 words · kenno

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