David Andrzejewski https://davidandrzejewski.com Tue, 24 Jul 2018 14:26:11 +0000 en-US hourly 1 6435647 Dovecot Fails to Start after Enabling MySQL https://davidandrzejewski.com/2018/07/24/dovecot-fails-to-start-after-enabling-mysql/ https://davidandrzejewski.com/2018/07/24/dovecot-fails-to-start-after-enabling-mysql/#respond Tue, 24 Jul 2018 23:24:45 +0000 https://davidandrzejewski.com/?p=745 If you get the following errors after installing Dovecot with MySQL support on FreeBSD 10:

Jul 24 10:17:28 ramrod dovecot: auth: Error: auth: environment corrupt; missing value for DOVECOT_
Jul 24 10:17:28 ramrod dovecot: auth: Fatal: unsetenv(RESTRICT_SETUID) failed: Bad address
Jul 24 10:17:28 ramrod dovecot: master: Error: service(auth): command startup failed, throttling for 60 secs
Jul 24 10:17:28 ramrod dovecot: imap-login: Disconnected: Auth process broken (disconnected before auth was ready, waited 30 secs): user=<>, rip=209.17.40.27, lip=206.125.173.30, TLS, session=<iWLbar9xXuLRESgb>
Jul 24 10:17:28 ramrod dovecot: imap-login: Warning: Timeout leak: 0x1171cdb0 (auth-server-connection.c:397)
Jul 24 10:17:38 ramrod dovecot: imap-login: Warning: Auth process not responding, delayed sending initial response (greeting): user=<>, rip=209.17.40.27, lip=206.125.173.30, TLS, session=<WbKjbL9xX+LRESgb>
Jul 24 10:17:58 ramrod dovecot: imap-login: Error: Timeout waiting for handshake from auth server. my pid=90189, input bytes=0
Jul 24 10:17:58 ramrod dovecot: imap-login: Disconnected: Auth process broken (disconnected before auth was ready, waited 30 secs): user=<>, rip=209.17.40.27, lip=206.125.173.30, TLS, session=<WbKjbL9xX+LRESgb>

Try reinstalling the mysqlXX-client package from ports.

 

]]>
https://davidandrzejewski.com/2018/07/24/dovecot-fails-to-start-after-enabling-mysql/feed/ 0 745
Grandstream Phones: Specify TFTP Path with Option 66 https://davidandrzejewski.com/2017/05/20/grandstream-phones-specify-tftp-path-with-option-66/ https://davidandrzejewski.com/2017/05/20/grandstream-phones-specify-tftp-path-with-option-66/#respond Sat, 20 May 2017 22:32:42 +0000 https://davidandrzejewski.com/?p=716 If you want to specify DHCP option 66 to point your Grandstream phones to a subdirectory on the TFTP server, simply use a value like the following in option 66:

‘192.168.1.1/grandstream’ – note there is no protocol.  Only use a protocol for HTTP or HTTPS.

]]>
https://davidandrzejewski.com/2017/05/20/grandstream-phones-specify-tftp-path-with-option-66/feed/ 0 716
Import an OVF into VMWare Fusion https://davidandrzejewski.com/2016/12/10/import-an-ovf-into-vmware-fusion/ https://davidandrzejewski.com/2016/12/10/import-an-ovf-into-vmware-fusion/#respond Sat, 10 Dec 2016 16:28:19 +0000 https://davidandrzejewski.com/?p=713 First, install the OVF Tool.

Then, run the tool. The syntax looks like this:

/Applications/VMware\ OVF\ Tool/ovftool --acceptAllEulas /path/to/file.ovf /Users/username/Documents/Virtual\ Machines.localized/vmname.vmwarevm/vmname.vmx

If you see errors about virtual hardware not being supported, you can add the –lax parameter to the command line.

]]>
https://davidandrzejewski.com/2016/12/10/import-an-ovf-into-vmware-fusion/feed/ 0 713
Generate Self-Signed SSL Key Pair with OpenSSL https://davidandrzejewski.com/2016/12/08/generate-self-signed-ssl-key-pair-with-openssl/ https://davidandrzejewski.com/2016/12/08/generate-self-signed-ssl-key-pair-with-openssl/#respond Fri, 09 Dec 2016 00:29:02 +0000 https://davidandrzejewski.com/?p=711 openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout key.pem -out cert.pem -sha256

 

]]>
https://davidandrzejewski.com/2016/12/08/generate-self-signed-ssl-key-pair-with-openssl/feed/ 0 711
Subversion: Revert Previous Commit https://davidandrzejewski.com/2016/05/24/subversion-revert-previous-commit/ https://davidandrzejewski.com/2016/05/24/subversion-revert-previous-commit/#respond Tue, 24 May 2016 23:31:54 +0000 https://davidandrzejewski.com/?p=703 To revert to your previous commit in Subversion, you’ll need the current revision number and the previous revision number, then:

svn update
svn merge -r 756:742 .
svn commit -m "Rolled back to previous commit (r742)"

 

]]>
https://davidandrzejewski.com/2016/05/24/subversion-revert-previous-commit/feed/ 0 703
Make Any Printer AirPrint-compatible on FreeBSD https://davidandrzejewski.com/2015/12/26/make-any-printer-airprint-compatible-on-freebsd/ https://davidandrzejewski.com/2015/12/26/make-any-printer-airprint-compatible-on-freebsd/#respond Sat, 26 Dec 2015 16:41:29 +0000 https://davidandrzejewski.com/?p=685 AirPrint is a cool technology, but what if you have printers that aren’t officially supported?  Here’s how to make it work.  Note that this was done on FreeBSD 10.1.  This may work on other operating systems, but package installation and filesystem paths will be different.

Install cups via ports, I selected both Python and Perl bindings, and Avahi for advertisement (since we’ll be using Avahi to advertise the services anyway):

portmaster -dbH print/cups print/hplip

After going through the various package configurations, grab a cup of coffee because there are many dependencies to install.

Enable cups:

sysrc cupsd_enable=YES

Set up cupsd.conf.  Note that this isn’t the most secure configuration, if this system is on the internet, please make adjustments accordingly.

SystemGroup sys root
# Allow remote access
Port 631
Listen /var/run/cups/cups.sock
Browsing On
BrowseLocalProtocols dnssd
DefaultAuthType Basic
WebInterface Yes
FileDevice Yes
ServerAlias *
DefaultShared yes
DefaultEncryption Never

  # Allow remote access...
  Order allow,deny
  Allow all




  AuthType Basic
  Require user @SYSTEM

Start cups:

service cupsd start

Head over to http://[IP]:631 and set up your printer.  This varies by printer, so I’ll leave this up to you.  Make sure to print a test page to ensure that cups itself is working.

Next, let’s add the needed AirPrint MIME types:

echo "image/urf urf string(0,UNIRAST<00>)" > /usr/local/share/cups/mime/airprint.types
echo "image/urf application/vnd.cups-postscript 66 pdftops" > /usr/local/share/cups/mime/airprint.convs

All that’s left to do now is add the actual services to Avahi.  We’re going to run a Python script that does this, but first, I had to add the cups package to Python manually.  You may not need to do this:

CPATH=/usr/local/include pip install pycups

Download airprint-generate.py:

fetch https://raw.githubusercontent.com/tjfontaine/airprint-generate/master/airprint-generate.py

I modified airprint-generate.py based on a forum post, I am not sure if this is needed, but it doesn’t appear to hurt: In the section setting ‘DOCUMENT_TYPES’, add a new line just under “‘application/postscript’: True,” that says “‘application/vnd.cups-postscript’: True”.

Next, run it:

python airprint-generate.py

This will create a .service file in the current directory for each of the printers you have set up in CUPS.  Put these service files into the Avahi service directory:

mv *.service /usr/local/etc/avahi/services

Finally, restart avahi-daemon:

service avahi-daemon restart

At this point,  you should be able to AirPrint from your iOS devices.

]]>
https://davidandrzejewski.com/2015/12/26/make-any-printer-airprint-compatible-on-freebsd/feed/ 0 685
When fail2ban just won’t match… check the time and time zone. https://davidandrzejewski.com/2015/10/23/when-fail2ban-just-wont-match/ https://davidandrzejewski.com/2015/10/23/when-fail2ban-just-wont-match/#respond Fri, 23 Oct 2015 16:59:26 +0000 https://www.davidandrzejewski.com/?p=680 I was trying to set up a fail2ban jail for wordpress inside a FreeBSD jail, but I just couldn’t get the rules to match.  The fail2ban instance was running on the host machine, checking a log inside the jail.  Turns out the time zone in the jail was incorrect, and fail2ban was not matching log entries because the time was different.

You may need to restart processes after this – I restarted both syslogd and Apache in the jail.

]]>
https://davidandrzejewski.com/2015/10/23/when-fail2ban-just-wont-match/feed/ 0 680
Arduino Repeater Controller: Part 1 https://davidandrzejewski.com/2015/05/10/arduino-repeater-controller-part-1/ https://davidandrzejewski.com/2015/05/10/arduino-repeater-controller-part-1/#comments Sun, 10 May 2015 13:11:29 +0000 https://www.davidandrzejewski.com/?p=667 I’ve decided that I want to build a repeater controller using an Arduino. I’ve been wanting to learn Arduino for a while, and this seems like a great excuse.  There are a lot of great repeater controllers out there already – I am a big fan of the SCOM 7330 – but they’re pricey, and this is ham radio.  We’re supposed to build stuff and experiment!

So, I went to my local Micro Center and grabbed the Inland Uno Learning Kit – it came with a bunch of stuff, but I was mostly interested in the Arduino board, breadboard and jumper wires.

A basic repeater controller only needs to do a few things:

  • Key up the transmit radio when the receive radio is receiving
  • Route the receive audio to the transmit radio
  • Send an ID at least once every ten minutes during a conversation.

And that’s really it.  Sure, you can have more advanced features, like DTMF decoding for functions like turning the repeater on and off, hang timers, courtesy tones, the list goes on.  I am going to start with only the most basic functionality.

To test, I will be using Motorola Maxtrac radios.  They are cheap, readily available, and many have a 16-pin connector on the back that can provide all the connections I’ll need.

Let’s get started.  For Part 1, I will only be connecting a transmit radio – I will use a simple push button for COR input – so I will only need:

For now, the only connections I will be using are:

  • Push-to-Talk output – pulled to ground when the transmitter needs to transmit – Pin 2
  • COR input (which gets pulled to ground when the receive radio is receiving) – Pin 3
  • Morse Code ID Output – Pin 4

That’s it for now.  I will get to audio mixing in a later post – we will eventually need to mix the receive audio in with the morse code ID audio.

 

]]>
https://davidandrzejewski.com/2015/05/10/arduino-repeater-controller-part-1/feed/ 4 667
Apple Internet Recovery and Transparent Proxies https://davidandrzejewski.com/2012/09/26/apple-internet-recovery-and-transparent-proxies/ https://davidandrzejewski.com/2012/09/26/apple-internet-recovery-and-transparent-proxies/#comments Wed, 26 Sep 2012 23:04:03 +0000 https://www.davidandrzejewski.com/?p=585 If you are running a transparent HTTP proxy on your network, you may have trouble with running Internet Recovery and Apple Hardware Test on Macs that support it.  You’ll see a “-4403D” or “-4403F” error.  For some reason, Apple’s servers return a 403 when they see the “via” header that many proxy servers send.  Here’s the configuration I used in Squid to turn off that header.  I also disabled the “forwarded-for” header – essentially, this makes it impossible for servers to determine that the request is coming through a proxy server:

# Be more anonymous
forwarded_for transparent
via off
visible_hostname proxy.local
httpd_suppress_version_string on

]]>
https://davidandrzejewski.com/2012/09/26/apple-internet-recovery-and-transparent-proxies/feed/ 3 585
Mountain Lion Installation Does Not Start in Parallels 7 https://davidandrzejewski.com/2012/08/11/mountain-lion-installation-does-not-start-in-parallels-7/ https://davidandrzejewski.com/2012/08/11/mountain-lion-installation-does-not-start-in-parallels-7/#respond Sat, 11 Aug 2012 14:03:20 +0000 https://www.davidandrzejewski.com/?p=581 I’ve been trying to install Mountain Lion in as a guest in Parallels 7, and I kept getting stuck at the initial grey Apple logo.

To fix it, I just changed the number of CPUs to 2, and it booted right up.  Other documents I’ve seen have indicated that you need to increase the video memory.  I did not need to do that, but it would probably help with performance.

]]>
https://davidandrzejewski.com/2012/08/11/mountain-lion-installation-does-not-start-in-parallels-7/feed/ 0 581