Compiling Unison file synchronizer on CentOS

Many file servers exist on CentOS, and to get much faster performance in WAN environments, it’s better to have unison on the server as well.

If you lack admin access to the server, you can compile Unison manually. but first you have to compile ocaml if it’s not installed.

A) compile OCAML (takes several minutes, maybe half an hour)
.1) wget
.2) tar xvf ocaml-4.01.0.tar.gz
.3) cd ocaml-4.01.0
.4) ./configure -prefix $HOME/ocaml4.01
.5) make world opt
.6) make install
.7) edit your $PATH to include $HOME/ocaml4.01/bin

B) Unison
.1) wget
.2) tar xvf unison*
.3) cd unison-2.40.102*
.4) make
.5) cp unison ~/unison2.40.102/
.6) edit your $PATH to include ~/unison2.40.102

Bluetooth headsets not recognized in Pulseaudio

I have a few Bluetooth headsets, and some PCs recognize them, while some don’t. I’m sure there is a better solution to this, but for now here’s what I do if I don’t see my headset listed in pavucontrol:

sudo pactl load-module module-bluetooth-discover

Note: before playing a sound, open up your Pulseaudio control panel and be sure to select A2DP instead of HSP if you want to listen to stereo music, or you’ll get a low quality monaural audio feed. Conversely, if you intend to use the headset for Google Hangout, Skype, etc. where two way audio is desired, select HSP in Pulseaudio.


nmap with Cygwin

As of this writing, nmap is not built-in to Cygwin. Here is how to install and configure nmap so that you can call nmap seamlessly from Cygwin:

1) Download and install the “self-installer” from

You do NOT need the WinPCap services, I unchecked those options.

2) in cygwin, type nano .bash_profile and add the line:
alias nmap="/cygdrive/c/Program\ Files\ \(x86\)/Nmap/nmap.exe"

3) close and reopen your Cygwin window

Now, when you type nmap in Cygwin terminal you should now see the nmap help text.

Joining PDF files into one

PDF Toolkit pdftk allows joining PDFs simply. let’s say you have three PDF files named one.pdf two.pdf three.pdf. Then type in Terminal:

pdftk one.pdf two.pdf three.pdf cat output joined.pdf

which will join them into the file joined.pdf.

pdftk –help will show you the many other things you can do with pdftk.

Asus P8Z77-M boot device choice

I found that there was no known special hotkey that will allow one to choose which device to boot when powering-up the PC.

What I found was to keep pressing Delete key upon booting, which brings you into BIOS setup. Under the Boot tab, scroll to the bottom, where you will see “force boot” choices. Click the one you want and the PC will do a one-time boot from that device.

Wish that they made it F12 like most other motherboards!

7-zip unavailable in 64-bit Cygwin

At the time of this writing, 7-zip was still not available in 64-bit Cygwin.
Here’s how to work around this issue by using the Windows 7z.exe from Cygwin. NOTE: This method will not show percent complete (no progress report).

1) install the 64-bit 7zip for Windows from
2) in Cygwin, type nano ~/.bashrc and at the bottom, paste in the line:
alias 7z="/cygdrive/c/Program\ Files/7-Zip/7z.exe"
3) close and reopen Cygwin and you’ll find that you can 7-zip files as usual.

Example usage:
say you have a big file named huge.dat. To archive this file type:
7z a huge.7z huge.dat

to extract the file type
7z e huge.7z

Windows PC field checklist

Here’s what to check before fielding a Windows PC.

1) Cygwin SSHD server running
2) Cygwin apt-cyg install (if desired)
3) Windows Firewall open on SSHD port
4) Open Windows Firewall to pinging if desired
5) Depending on your preferences, set Windows Update to not update automatically (since this can make your PC reboot in the middle of good data-taking).
6) Cygwin: install Octave, imagemagick

Pros/cons of LogMeIn, TeamViewer, GoToMyPC

My work involves data collection from remote, inaccessible sites located around the world. I need to have highly-reliable methods of remote control. So I make sure every PC is Intel vPRO enabled, allowing me to power down, reboot, and even reinstall the operating system remotely from a HTTP vPro internal webserver on port 16992.

1) Intel vPro motherboard
2) Clonezilla DVD in DVD drive
3) Clonezilla HDD image on Blu-ray in drive or USB HDD / flash drive
4) Hardware Firewall (e.g. pfSense, m0n0wall) (don’t want to expose vPro ports to outside world).

What about the actual remote control? One can use SSH port forwarding and RDP/XRDP, but what about those who want to use LogMeIn or the like? I had this discussion recently and here were my points:

Pros of LogMeIn, TeamViewer, GoToMyPC commercial services:

  • I would say that commercial remote desktop services such as LogMeIn are typically more secure on a Windows PC than just leaving port 3389 open to the internet. (One can use Cygwin OpenSSH server to SSH port forward to 3389, and/or user pfSense/m0n0wall hardware firewalls)
  • LogMeIn has convenient apps for smartphones and from a web browser (for open source choices, see AfreeRDP and Guacamole)

Cons of LogMeIn, TeamViewer, GoToMyPC commercial services:
The downsides of LogMeIn-type commercial services have philosophical and practical aspects.

  • Commercial services typically use proprietary (non-open-source) technologies for the central server and/or securing the connection. (Open source choices are using perhaps the same technology but open to world-wide security reviewers).
  • The convenience of commercial services (centralized server making the connections) is seen by some as a weakness (could have unknown hackers as employees, could shut down their server, raise prices, etc.).

With open-source software, I can also access my PCs with a “single click” from a phone or laptop, without having a 3rd party server involved, and with all free open-source software that I trust. I can do so from a web page without plugins (see Guacamole). The key point being that I don’t have a 3rd commercial party whom I have to trust and pay.

Some customers do not allow 3rd party remote control software to be used, and so I have become proficient at using open-source solutions for remote control of many systems.