BSD Chromium Audio/Mic

If you encounter a problem with microphone in Chromium on FreeBSD (and other *BSD), this is because it uses sndio audio backend and probably default microphone is not the one you want to use. In my case /dev/dsp0 is the HDMI input/output thus no audio input. There is no need to start system wide sndiod. You can use environment variables in ~/.profile to control audio input/output for the local spawning sndio client:

  • export AUDIODEVICE="rsnd/4" sets default input/output device to /dev/dsp4.
  • export AUDIORECDEVICE="rsnd/3" sets default input device to /dev/dsp3.
  • export AUDIOPLAYDEVICE="rsnd/2" sets default output device to /dev/dsp2.

You can simply set AUDIODEVICE="rsnd/4" to switch default input and output device, and/or AUDIORECDEVICE="rsnd/3" to change default microphone source. If you want to have choice to switch between several devices on the fly you will need to use sndiod and provide set of devices with -f flag. See sndio [1] and sndiod [2] man pages for more information.

CED 7000 battery replacement

If you need to replace battery for CED 7000 timer [1] you can either buy a HLP 443450 3.7V 800mAh 2.96Wh accumulator [2] or dedicated inexpensive Power Bank [3] that contains two accumulators inside – one for quick replacement of the timer battery and the other to charge timer over the USB cable – this way you can also safely carry a backup and replacement power source at hand :-) One thing that could be improved here is using both accumulators in the Power Bank so capacity is doubled and both are always charged – that should also prevent self-discharge below safe point of the unused unit.


Make PDF small with GS

With this trick you can make your PDF smaller even 10x with no noticable picture quality loss :-)

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH  -dQUIET -dDownsampleColorImages=true -dColorImageResolution=200 -dColorImageDownsampleType=/Bicubic -sOutputFile=output.pdf input.pdf

Xilinx USB JTAG Platform Cable Vivado Linux

If you work with Xilnx Vivado Design Suite [1] for FPGA development using USB JTAG interface such as Xilinx USB Platform Cable [2] or its cheaper clone from WaveShare [3], everything seems to be connected properly, but it cannot find the Target for programming, you probably need to perform drivers setup manually [4]. Error message looks like this:

ERROR: [Labtoolstcl 44-494] There is no active target available for server at localhost.
Targets(s) ", jsn3" may be locked by another hw_server.

Error message may indicate that another instance of hw_server is running in the background but that is not the case. Check your drivers first [4]. Some hints:

  • Run as root and be careful as this will modify your OS.
  • Install script location is Vivado/2020.2/data/xicom/cable_drivers/lin64/install_script/install_drivers.
  • Platform Cable USB interface is pcusb.
  • Make sure UDEV rules are installed in /etc/udev/rules.d/ (i.e. 52-xilinx-pcusb.rules file).
  • After drivers are set up remember to restart UDEV with service udev restart command and re-attach your USB JTAG cable.



If you are happy user of DSO QUAD pocket oscilloscope from Seeed Studio [1] then probably after all those years you need to replace the accumulator. Because stock model PL384070 3.7V 1000mAh is not available anymore you can safely use CL404070 3.7V 1300mAh that is only 0.2mm thicker but it also fits the scope very well and you gain 30% capacity. You only have to solder the plug from the old accumulator. Enjoy :-)


Synaptics TouchPad on Panasonic CF-MX4

This wulf7 [1] is a really nice guy that helped me run full featured Synaptics TouchPad with FreeBSD on Panasonic Toughbook CF-MX4 [2][3]. Now it works for moused and libinput with all multitouch gestures like two or three finger scroll, scale, etc! The problem was in detection mechanism as device is connected over multiplexer with both PS/2 and SMBus but multitouch works only over SMBus. Although fix requires change and rebuild of FreeBSD Kernel I hope it gets quickly to the upstream [4]. I had a chance to exercise building whole FreeBSD distribution into the USB memstick image, so I could test driver fix on a target computer without even touching its hard drive contents :-)

/* psm has a special support for GenMouse + SynTouchpad combination */
if (active_ports_count >= 2) {
    for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) {

That 2 above had to be changed into 1 in /usr/src/sys/dev/atkbdc/psm.c. Nice? That’s what I call a one-bit-fix :-)

In addition, when you work with Synaptics Touchpad in Xorg and you want to use its all features like tap-to-click, natural (swapped) two finger scroll, two and three finger gestures, don’t use moused,xmodmap, or xinput as this will produce inconsistent behavior in applications based on different toolkits (i.e. GTK will scroll up while Qt will scroll down etc), instead use the new way of input based on libinput and modify MatchIsTouchpad section of /usr/local/share/X11/xorg.conf.d/40-libinput.conf like:

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event5"
        Option "NaturalScrolling" "on"
        Option "Tapping" "on"
        Option "ClickMethod" "clickfinger"
        Driver "libinput"


Disable Comments in WordPress

You can disable comments for existing posts using Bulk Edit, but this is not possible for existing media files. You can do both with a single SQL command :

UPDATE wp_your_table_with_posts SET comment_status = 'closed';

You can disable comments for all new posts either by hand as administrator unchecking Settings / Discussion / Allow people to submit comments on new posts, or using SQL command:

UPDATE wp_your_table_with_options SET option_value = NULL WHERE option_name = 'default_comment_status';

Panasonic Toughbook WWAN modem unlock

If you have Panasonic Toughbook laptop with no LTE/4G cellular modem and after you attach internal modem but it is still not visible in BIOS Setup nor in the Operating System, go to the Main / Optional Kit Configuration, use toughkit password, then set Wireless WAN ID = 15 (in case you use original Sierra Wireless EC7305 device). WWAN card should be now available both in BIOS Setup and Operating System USB port. Enjoy! :-)

Mounting external ZFS volume

If you need to perform a data recovery from an external ZFS [zfs] volume you may find those hinds helpful:

  1. Attach encrypted partition where ZFS pool resides with:
    geli attach /dev/your_device_partition
  2. Import ZFS pool at given mountpoint (/mnt/zfs):
    zpool import -af -R /mnt/zfs
  3. Modify mount point location for a given dataset that may have mountpoint set to none what marks it as no mount (note this mountpoint will append to parent mount point location):
    zfs set mountpoint=ROOT zroot/ROOT/default
  4. Mount and mount all pool datasets:
    zfs mount -a
    zfs umount -a
  5. Mount/umount given dataset:
    zfs mount zroot/ROOT/default
  6. You can verify if your ZFS pool is active with:
    zpool status
  7. You can see what ZFS datasets are available with mount points with:
    zfs list


macOS Virtual Audio SoundFlower Loopback

SoundFlower [1] is amazing Free and Open-Source extension to macOS BSD that allows you to create Virtual Audio Device in order to Route and Record Applications Audio. This is especially important for activities like Online Streaming and Presentation/Lectures Recording.

If you need more advanced Audio Routing with a nice GUI and lots of options try Loopback [2] from RogueAmoeba [3].

Thank you for this amazing fork and keeping it Open-Source! :-)


Blender Player Python

If you encounter a problem with running Python [python] scripts on a “bare” Blender Player [blender], make sure that both PYTHONHOME and PYTHONPATH are set correctly to match your needs. You can also use native Blender python with a simple shell script:

export PYTHONHOME="/path/to/blender/python/"
/path/to/your/blenderplayer $@


Migrating from MS Office365 to Googe Suite

If you want to move a business from Microsoft Office365 to Google Suite, there is a nice migration utility in Google Suite Admin Console that helps you transfer all accounts data from Exchange Web Server or IMAP.

In case you encounter an error here goes a list of error codes and troubleshooting guide [1].

I did a full migration by granting my temporary user Global Administrator right by current Admin user, then in Exchange Admin Console I had to grant myself an ApplicationImpersonation Admin Role (to access other accounts for migration). After the migration was complete I have rolled back my permissions to a minimum level.


binary file hexdump

Sometimes you need to quickly create a hexeditor like dump of a binary file. HEXDUMP is your friend. It may be a standard Unix application or Python module.

Unix hexdump use example:

hexdump -Cv file.bin
00000000  12 01 00 02 ef 02 01 40  28 0d 04 02 00 10 01 02  |.......@(.......|
00000010  03 01 12 01 00 02 ef 02  01 40 28 0d 04 02 00 10  |.........@(.....|
00000020  01 02 03 01 09 02 82 00  04 01 00 80 fa 09 02 82  |................|
00000030  00 04 01 00 80 fa 09 04  00 00 02 08 06 50 07 07  |.............P..|
00000040  05 82 02 40 00 00 07 05  02 02 40 00 00 09 04 03  |...@......@.....|
00000050  00 02 03 00 00 06 09 21  00 01 00 01 22 21 00 07  |.......!...."!..|
00000060  05 81 03 40 00 01 07 05  01 03 40 00 01 08 0b 01  |...@......@.....|
00000070  02 02 02 01 04 09 04 01  00 01 02 02 01 04 05 24  |...............$|
00000080  00 10 01 05 24 01 03 02  04 24 02 06 05 24 06 01  |....$....$...$..|
00000090  02 07 05 83 03 10 00 20  09 04 02 00 02 0a 00 00  |....... ........|

Python hexdump use example:

python -m pip install hexdump
python -m hexdump file.bin
00000000: 12 01 00 02 EF 02 01 40  28 0D 04 02 00 10 01 02  .......@(.......
00000010: 03 01 12 01 00 02 EF 02  01 40 28 0D 04 02 00 10  .........@(.....
00000020: 01 02 03 01 09 02 82 00  04 01 00 80 FA 09 02 82  ................
00000030: 00 04 01 00 80 FA 09 04  00 00 02 08 06 50 07 07  .............P..
00000040: 05 82 02 40 00 00 07 05  02 02 40 00 00 09 04 03  ...@......@.....
00000050: 00 02 03 00 00 06 09 21  00 01 00 01 22 21 00 07  .......!...."!..
00000060: 05 81 03 40 00 01 07 05  01 03 40 00 01 08 0B 01  ...@......@.....
00000070: 02 02 02 01 04 09 04 01  00 01 02 02 01 04 05 24  ...............$
00000080: 00 10 01 05 24 01 03 02  04 24 02 06 05 24 06 01  ....$....$...$..
00000090: 02 07 05 83 03 10 00 20  09 04 02 00 02 0A 00 00  ....... ........

Added GOBI2000 support to FreeBSD U3G

I have added support for Panasonic ToughBook CF-F9 U3G GOBI2000 to FreeBSD U3G kernel module [1]. I have added firmware for Panasonic CF-F9 and HP EliteBook 2740p along with gobi_loader updates [2] that are required for 3G modems to work.

At first U3G module will create /dev/cuaU0 interface for QDL firmware load, then after successful firmware load device will reload itself to a modem mode and U3G module will provide additional /dev/cuaU0.* nodes for operations (/dev/cuaU0.2 is the AT command intarface).

In order for this modem to work on FreeBSD you also need to tune some configutation files:

  • /etc/devd.conf:
    attach 100 {
     match "vendor" "0x04da";  #adjust your device VID
     match "product" "0x250e"; #adjust your device PID
     action "/usr/local/sbin/gobi_loader -2000 /dev/cuaU0 /boot/firmware/gobi/";
  • /etc/ppp/ppp.conf:
     set log Phase Chat LCP IPCP CCP tun command
     ident user-ppp VERSION
     set device /dev/cuaU0.2
     set phone *99\#
     set redial 5 10
     set speed 115200
               \"\" AT AT-OK-AT ATH OK ATZ OK ATE1Q0 OK \
               AT+CFUN=1 OK-AT-OK \
               AT+CPIN? READY-AT+CPIN=\"YOUR_PIN_HERE\"-OK \
               AT+CGDCONT=1,\\\"ip\\\",\\\"internet\\\" OK \
               \\dATDT\\T TIMEOUT 40 CONNECT"
     set timeout 20
     enable dns
     set ifaddr
     add default HISADDR

You now should be able to use your 3G modem connection with ppp -ddial, after you add your local user to the dialer group with pw groupmod dialer -m your_user_name. Remember to have U3G compiled in. Enjoy the Internets! :-)


Docker and Travis are Linux only solutions

If you wonder to use Docker [1] or Travis CI [2] for build test or more advanced automation, note that these are Linux [3] only solutions and will not work with other operating systems such as FreeBSD [4]. You may want to take a look at old good Jenkins [5] for wider application possibilities :-)



I just did a self-assembly of JTAGulator. This simple and amazing device indeed works and shortens JTAG pinout search from days to seconds. AMAZING! I have some spare devices to sale cheap in EU, if you want one let me know! :-)

JTAGulator is an open source hardware tool, created by Joe Grand / Grand Idea Studio, that assists in identifying OCD connections from test points, vias, or component pads on a target device. All you need is a target device, bunch of tap wires / cables, USB-Mini cable, and serial terminal to operate JTAGulator.

On-chip debug (OCD) interfaces can provide chip-level control of a target device and are a primary vector used by engineers, researchers, and hackers to extract program code or data, modify memory contents, or affect device operation on-the-fly. Depending on the complexity of the target device, manually locating available OCD connections can be a difficult and time consuming task, sometimes requiring physical destruction or modification of the device.

FreeBSD PXE Network Install

Sometimes you need to perform a network installation (i.e. when no USB or DVD drive is allowed to boot, but you can boot PXE). In case of FreeBSD you can use DNSMASQ to serve the DHCP that will assign the initial client address and configuration along with PXE boot image served over tFTP. At this point you will have bootloader running, so you can serve filesystem over NFS to obtain working environment and/or the installer..

  • Create a directory that will hold the target filesystem over network. In my case that was
  • Put OS/Installer files inside above directory
    cd /usr/local/tftp/FreeBSD
    wget http://(..)/file.iso
    7z x file.iso
  • Edit /etc/exports to export the filesystem over NFS
    /usr/local/tftp/FreeBSD -ro -alldirs -network
  • Install the dnsmasq
    pkg install dnsmasq
  • Setup the /usr/local/etc/dnsmasq.conf
  • Restart services
    service nfsd onerestart
    service dnsmasq onerestart
  • In case you get bootloader running but troubles with NFS make sure that mountd is running. Also you can see who is using the NFS shares with
    showmount -a

PXE Boot always use initial DHCP/tFTP to fetch configuration and bootloader, so the first stage is similar and should work with other Operating Systems and Bootloaders as well, the rest is up to bootloader itself..

PIP and Python Modules inside Blender

If you want to install additional Python [1] modules inside your Blender [2] environment, you can install PIP using this recommended script [3], then use PIP to install all modules that you want. Note Blender’s Python Virtualenv location is /path_to_blender/blender_version/python/bin/python and you need to use this particular interpreter to launch the script.


FreeBSD Synaptics Trackpad/Touchpad

Use advanced features of your Synaptics Trackpad on a laptop running FreeBSD [1] with:

  • set in /boot/loader.conf:
  • set in /etc/rc.conf:
  • set in /etc/X11/xorg.conf:
    Section "InputDevice"
        Identifier      "Mouse0"
        Driver          "mouse"
        Option          "Protocol"      "auto"
        Option          "Device"        "/dev/sysmouse"
        Option          "ZAxisMapping"  "4 5 6 7"

If you want to have “MacBook” like two-finger scrolling along with other parameters you can set in /etc/sysctl.conf:









If you want to use NTFS volumes on FreeBSD [1], you need to use FUSE infrastructure andNTFS-3G [2] port. Syntax of fstab is a bit differen in this case:

/dev/ntfs_partition /mnt/ntfs_mounpoint fuse rw,locale=pl_PL.UTF8,mountprog=/usr/local/bin/ntfs-3g 0 0

Also remember to put fuse_load=”YES” in /boot/loader.conf and install the sysutils/fusefs-ntfs port. Do not use hibernated volumes.


FreeBSD on a Hybrid Graphics Laptop

If you happen to get a nice laptop with a powerful graphics card, such as polish HYPERBOOK SL502VR [1], it is highly probable that you will use UEFI boot mode. In that case you need to use SCFB [2] driver instead of VESA. Use the xf86-video-scfb package to get Xorg running.

Hybrid Graphics at first used MUX device that did a LCD connect to a selected video card on boot. Nowadays both cards use common Video Framebuffer [3] to draw over a screen. The simple video card (Intel in my case) is always active, while the more powerful and power consuming video card is started on-demand (nVidia in my case). This however requires a dedicated DMA BUF implementation, which is not yet available on FreeBSD, so none of the cards can see any monitor connected, resulting in “No Screens Found Error” from Xorg.

I have already reported a bug/feature request to nVidia. Also developers of FreeBSD are working on the Hybrid Graphics implementation.


Chromecast / Google Home wizard bug

Google Chromecast is a device that allows you to stream audio-video content over WiFi network from Application to a HDMI enabled display. This works really nice when you want to watch Netflix or show some movies from your mobile device on large screen TV/Projector.

Recently, Google released a new line of Chromecast devices that support audio only and higher resolution displays, renaming Chromecast to Google Home. This rebrand also replaced mobile application for devices management. New application forces user to have working internet connection, use localization, and sign with google account in order to work. There is no way to roll back to old application. Not really cool.

I have found and reported one nasty bug in this new Google Home application (version 1.19.29), that prevents you from discovering and setting up old Chromecast devices after Factory Defaults Reset or WiFi password change (so it can connect to your WiFi again). I only have old device so I am not sure how this affects new devices. You will not be able to discover your Chromecast device over WiFi when Localization Services are disabled and according permission was not granted!! In order to connect to your Chromecast:

  • Reinstall or clear application data/cache.
  • In startup configuration wizard you must grant access to localization services. If you do not enable localization and allow it to work granting permissions, you will not find your Chromecast later on.
  • Search now for a Chromecast device still in setup wizard, you will find it, only if you did previous step correctly.
  • Note that when you find a device that way, you can skip sign in with google account.
  • If you do not grant localization permissions you will not be able to detect your chromecast device anymore.

I hope this has nothing to do with killing old line of devices with a software update. I also hope Google will fix this issue in next releases and they really don’t force users to give up so many personal information (why do they need GPS/Bluetooth running for a simple WiFi connection otherwise)..

Sony Xperia Unlocked Mobile Firmware Restore

Sony Xperia phones are my favorite. Very good and durable electronics, amazing photo camera, nice utilities on top of standard Google Android OS. I have also always respected Xperia for allowing users to unlock their phones for Open-Source Firmware Customization on this amazing hardware..


Unfortunately, Sony seems to have this habit to make a bad decisions, so amazing hardware is not always followed with a good software. This is why Open-Source Customization is so important. I have already found several nice devices with a really bad firmware. What is more, this corruption seems to spread, and Sony blocks factory firmware restore for an unlocked devices with their official Xperia Companion utility. This means unlocking a device does not only Voids a Warranty, but also silently makes it Impossible to Go Back to a Stock Firmware! This is really bad idea.


Luckily smart people tends to predict and help each other out. Developer team of Sony Mobile released EMMA utility (nice name by the way) that allows you to re-flash mobile that is unlocked in case something goes wrong or you simply want to get back to a stock firmware.

Open-Source Firmware Customization will become a standard, even for large enterprises, with mutual benefit to their customers, because looking at the big picture we are part of the same eco(no)system..