Author: MICHAL

Technology

Resize drive and partition on FreeBSD 12 (pfSense)

Recently I described how to increase drive, partition and filesystem on FreeBSD in Azure virtual machine. It turned out that this scenario was little bit different from a virtual machine running on top of VMware. First of all, with or without vm-tools I was not able to get updated drive size: It gives messages that rescanning was successful, but actually it did not apply new values. However we can check new drive size with the following command: If on your system you get same results, then you need to reboot. There is also a difference of having swap space. First

Technology

WordPress migration

After 2 years on DigitalOcean I’ve decided to move out. Not because it’s bad or expensive, but because I need one more feature which is IDS/IPS. By default WordPress installation on DO contains fail2ban, which is fine, but I find Suricata way more powerful. To start with, I’ve created a backup using All-In-One WP migration and Increate Max File Size. Former is responsible for dumping all of the site content, and the latter is giving a ability to upload this dump file into new WordPress installation. But… you also need to edit one file in your need WP setup: With

Hobby

MacPorts installation on 10.8.5

To bring and old MacBookPro up to date you can use MacPorts. First you should download and install MacPorts package from macports.org. There is a pkg file to use specifically for Mountain Lion. That’s the easy one. A little harder would be to grab working XCode with command line tools. You need to have Apple ID, not quite sure if there is different one to access developer.apple.com but mine works just fine. Go and download XCode 5.1.1 and command line tools, file names are as follows: XCode requires accepting licence with the following command: As you will install command line

Technology

Proxmox setting locale failed

If you log in to Proxmox’s shell and see error stating that “setting locale failed“, then execute the following command to get rid of that message: Not quite sure why it happens, but I see it almost all the time.

Technology

Recover pfSense from out of disk space and config.xml corruption

I use NetGate pfSense+ version 22 based on FreeBSD 21. I encountered a problem of running out of disk space because of packet logging enable in Suricata. Out of a sudden there was high traffic and therefore high logs production. Disk space utilization was over 100%. Now there is a problem with /config/config.xml file, there is no VPN, Suricata, pf configuration available from the UI. Dashboard is corrupted also. However there is /config/backup folder with backed up configuration files. I’ve taken the last known good with proper file size and put it in place. After reboot it works just fine.

Technology

Ruby on Rails vs PostgreSQL 14 partitioning primary keys

Starting from PostgreSQL 10 we have available new type of paritioning, which is declarative one. Before we had inheritance which is also good but has some limitations. Now, with declarative partitioning user need not to specify partition name while inserting data. To create partitioned table: There are few things worth explaining. First one is BIGSERIAL data type. It is a bigger form of integer type with automatic sequence creation, which is very convenient. Second thing is PARTITION BY RANGE(columnname). It defined that the data will be spread across paritions based on created_at date range. It positively affects query performance. To

Technology

Allow .local domain suffix to be resolved

On many chances you may need to configure some domains using .local suffix. Unfortunately this is covered by RFC 6762 (multicast DNS). On specific Linux distributions you will not be able to resolv such domains using DNS server you set either in the machine or in the cloud settings (for instance Azure). How to you know that the DNS query is not reaching your desired DNS server? In case you use named, then first enable query logging by the following comman: Now DNS queries from the clients who set that particular DNS server as its resolved will be visible in

Security

Disabling uncategorized internal Suricata rules in pfSense

I want to enable only particular rules categories. Do not want to have all these internal Suricate rules as they cover too broad variaty of cases including loads of false-positive. If one would like to go for deep traffic analysis then they would be fine, but in case you see “STUN Binding Request On Non-Standard High Port” and know that is your P2P camera in the LAN then it’s worth disabling all of that things at once. To disable them it is a little bit tricky on pfSense installation. Go to Interfaces and selected desired one. Be sure to uncheck

Technology

Multiple ZFS pools on single drive

Image a hypothetical scenario having two 512 GB drives and want to use a Proxmox ZFS VM replication onto a second server with one 1 TB drive. Solution is quite simple. By using fdisk, create two primary partitions on the bigger drive and then go to Disks.ZFS.CreateZFS and you will be able to select a partition for the particular pool. One downside of such a setup is that ZFS liks to have whole drive for it’s own, please keep in mind that the performance may vary.