Create a FreeBSD install disk with dd on OS X

I need to create a bootable FreeBSD install disk and the downloaded file happened to be on a Mac laptop. Since OS X is based on BSD, it also comes with dd utility. After a USB is inserted, I need to identify the disk. This can be done using diskutil command: $ sudo diskutil list /dev/disk0 (internal): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme 251.0 GB disk0 1: EFI EFI 314.6 MB disk0s1 2: Apple_APFS Container disk1 250.7 GB disk0s2 /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +250.7 GB disk1 Physical Store disk0s2 1: APFS Volume Macintosh HD 98.6 GB disk1s1 2: APFS Volume Preboot 21.4 MB disk1s2 3: APFS Volume Recovery 509.8 MB disk1s3 4: APFS Volume VM 3.2 GB disk1s4 /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: Apple_partition_scheme *2.1 GB disk2 1: Apple_partition_map 4.1 KB disk2s1 2: Apple_HFS 2.4 MB disk2s2 From the above output, the USB drive is /dev/disk2. Now, I can use dd to copy the image file to the USB drive using the following command: ...

February 9, 2018 · 1 min · 199 words · kenno

How to find the motherboard model on Windows 10

To find the motherboard model number on Windows (10), run cmd, and type: C:\Users\kenno>wmic baseboard get product,Manufacturer,version,serialnumber Manufacturer Product SerialNumber Version Gigabyte Technology Co., Ltd. Z170N-Gaming 5 To be filled by O.E.M. x.x Ref & credit: How to Find Computer and Motherboard Model Serial Number on Windows 10

January 14, 2018 · 1 min · 48 words · kenno

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. scrub in on $ext_if all fragment reassemble # set a default deny policy. block in log all # This is a desktop so be permissive in allowing outgoing connections. pass out quick modulate state # Enable antispoofing on the external interface antispoof for $ext_if inet #antispoof for $ext_if inet6 # block packets that fail a reverse path check. we look up the routing # table, check to make sure that the outbound is the same as the source # it came in on. if not, it is probably source address spoofed. block in from urpf-failed to any # drop broadcast requests quietly. block in quick on $ext_if from any to 255.255.255.255 block in log quick on $ext_if inet from to any In the pf.conf, the blocked IP table is called sshguard. To list all the blocked IPs, run: ...

November 17, 2017 · 2 min · 269 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. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ip = as.data.frame(installed.packages()[,c(1,3:4)]) > ip = ip[is.na(ip$Priority),1:2,drop=FALSE] > ip Package Version akima akima 0.5-12 alr3 alr3 2.0.5 BRugs BRugs 0.8-6 car car 2.1-2 coda coda 0.18-1 colorspace colorspace 1.2-6 DEoptimR DEoptimR 1.0-5 dichromat dichromat 2.0-0 digest digest 0.6.9 distillery distillery 1.0-2 extRemes extRemes 2.0-7 fields fields 8.4-1 ... I don’t have time to explain what each line does. If you’re curious, you can check out using the references below: ...

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. On Ubuntu, assuming you’ve chrooted into the system, and the boot disk is /dev/sda, this could be done by running: ...

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