Technology

Technology

Coil

Energy in a magnetic field [209] Just as a capacitor works by storing energy as an electric field, an inductor stores energy as a magnetic field. The energy stored in the coil is calculated in terms of current. The capacitor acts as an insulator of the circuit while the inductor acts as its conductor. The coils have inductance expressed in henry [H]. The coils are plugged into the circuit in series with the powered device. The coils are characterized by a maximum current, as their windings have a certain resistance, therefore the flow of current causes a voltage to accumulate

Technology

WordPress quirks and features

I will start with the werid experience with one of WP themes – Polite and Polite Grid. I was wondering why my website make double requests on every page. One for the document and other for content. This was annoying as I was unable to measure traffic properly. It turned out that it was because of the theme I’ve been using for some time. Changing it to different one fixed it. Second of all to make NGINX logs easier to handle I’ve created separate location entry for all the WP things, so the “real” traffic goes only to particular log

Technology

Voltage divider

Lowering the voltage value [202] The next example I want to present in practice is a popular voltage divider. It allows the output voltage to be reduced to the desired value due to the properties described a little earlier. Bearing in mind the above formula, we can assume that we want to reduce the input voltage of 5V to the expected 2.5V at the output. So we use two 1K resistors connected in series. Examples available at https://github.com/michalasobczak/simple_hpc/tree/master/SeriesPartOne

Technology

Kirchhoff’s law

Theory and practice [W] One of the basic principles of current flow is the first law of Kirchhoff, which says that for the electric circuit node, the algebraic sum of flow rates is zero. The sum of currents flowing into the node is equal to the sum of currents flowing out of this node. This law results from the principle of keeping the load. Kirchhoff’s second law says that the sum of voltage drops in a closed circuit is zero, assuming that the voltage drop is its negative increase. [202] For the purposes of illustrating the law of Kirchhoff, I

Technology

Capacitor

Signal filtering [202] Capacitors are divided into polarized and non-polarized depending on whether the direction of their inclusion in the circuit is important. Generally speaking, capacitors filter the waveform of the power source. It is assumed that the longer lead from the capacitor is the positive pole, which is sometimes reflected in the marking in the diagram. Electrolytic capacitors consist of a metal cover and an electrolyte lined with paper. Non-polar (non-polarized) capacitors can be made of ceramic elements or foil. There are also tantalum capacitors which both offer high capacitance and relatively low losses. The physical size of a

Technology

growfs fsck required (pfSense)

In case you’ve managed to overcome other issues with system unable to boot, disk size not updated then there might be still one problem left. Sometimes resizing with gpart works fine but file system resize does not. I’ve encountered such issue and frankly speaking I’m not quite sure what is root cause of it. Is says that file system is dirty and I should run fsck which can be executed from console selecting number 5 and then F letter. System reboots and makes file system check. It says that the file system is fine, so it’s quite confusing. Solution for

Technology

Azure FreeBSD (pfSense) not able to pick boot partition after disk resize

Following previous struggles on pfSense FreeBSD on Azure. After resizing disk Microsoft starts at some point adding an another drive which is temporary one. I do not need this by any means. It seems that NetGate pfSense template is also not quite compatible with cloud-init as the platform tries to execute systemctl which is not present here. The problem with this is that FreeBSD will not be able to pick which partition it should start from. Fix for this is pretty simple. Just go and edit /etc/fstab and instead of pointing to some virtual labels. In my case it was

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