OH Noooo … mysqld_safe is missing after upgrading Raspberry Pi from Raspbian Jessie to Buster and MySQL 5.5 !!!

This happened while upgrading my Raspberry Pi mail server from Jessie to Buster. The upgrade went with hiccups of course, I won’t be covering that here though, maybe later when I have quality time to write again.

During the upgrade, at some point package installations began to complain not being able to access their databases. Aha! MySQL is the culprit! Easy peasy fix right?

Sure enough, MySQL wasn’t running. I issued sudo service mysql restart, /etc/init.d/mysql restart and countless others. I must have tried every troubleshooting article on the net. None started MySQL. Reboot? Didn’t help either. Something about upgrading to MySQL Server 5.5 borked MySQL from starting.

Syslog showed MySQL mumbling something about checking if there was another MySQL server running? Nope! Also that it couldn’t find its mysqld.sock socket. Uh oh … that’s bad.

I disabled AppArmor, thinking that had blocked MySQL from starting. Nope! Ayyy, I have to go back and enable it now.

I checked which configuration MySQL 5.5 was using with sudo mysqld –help –verbose (it has several different folders it checks for the existence of my.cnf). Once MySQL has started the command sudo mysqladmin variables -uroot -p lets you see what values it has picked up from it’s configuration file wherever it found its my.cnf file.

By default MySQL checks the following my.cnf locations in the order listed:

  1. /etc/my.cnf
  2. /etc/mysql/my.cnf
  3. /usr/etc/my.cnf
  4. ~/.my.cnf 

Using the sudo mysqld command, looking at the log, I was able to see which of those my.cnf files is in use.

  1. Removing obsolete conffile /etc/mysql/conf.d/.keepme …
  2. Obsolete conffile /etc/mysql/my.cnf has been modified by you.
  3. Saving as /etc/mysql/my.cnf.dpkg-bak …
  4. update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
  5. Moving /etc/mysql/my.cnf.dpkg-bak to /etc/mysql/my.cnf.migrated
  6. Using your previous configuration through /etc/mysql/my.cnf.migrated
  7. update-alternatives: using /etc/mysql/my.cnf.migrated to provide /etc/mysql/my.cnf (my.cnf) in auto mode

Finally! The last line tells me it’s using the /etc/mysql/my.cnf configuration file.

I check that my.cnf to see where the socket file is supposed to be. The peculiar thing is if I run mysqld directly on the command line in the foreground with sudo mysqld it runs perfectly fine. The socket file mysqld.sock is created by itself when it starts running (which is how it’s supposed to work) and deleted when it shuts down. MySQL is listed in the process list as it should be too.

When I attempt to run it with sudo service mysql start I don’t see a socket file created. Nothing was happening at all. Running sudo service mysql status to get status information from mysqld shows it was active (exited) meaning there is a process for it, but it had already quit running. If I stop it using sudo service mysql stop the status shows inactive (dead). Even curiouser.

So, socket configuration is correct. MySQL will run with that configuration. Now it’s just the matter of starting and stopping it as a service.

sudo service makes use of the /etc/init.d/mysql script to do the work of managing the mysql service. Ah, something interesting to see how it does that, troubleshooting.

Opening the mysql script shows runtime commands the script uses. It calls a command mysqld_safe which in turns launches mysqld in the background.

I hit up locate mysqld_safe to see where it is to troubleshoot further. Confusion ensues … locate doesn’t find anything, which mysqld_safe doesn’t find it either! No wonder MySQL never launches with sudo service mysql start !!! Baaaad news, how do I reinstall the missing mysqld_safe? I almost went into a tailspin at this point.

Well, no need to despair, google to the rescue. I searched for mysqld_safe and found it was an obsolete command, no longer included much less installed with new MySQL packages.

Ok, but what do I replace it with? Another almost tailspin moment … Recall that I was able to run MySQL in the foreground using mysqld? I edited /etc/init.d/mysql to call mysqld instead of mysqld_safe and hope for the best not to manage to bork it futzing around with system service scripts.

I ran sudo service mysql start and voila … MySQL came to life again to my relief. It only took me from 8am to 4pm to figure it out, and 1 hour to write this down 🙂

So, if you find this post in the wee hours trying to fix the same issue, you’re welcome.

Cheating Uber

As I’ve written before, I drive Uber once in a while to save funds for pet projects. In that time, I’ve noticed a few ways that riders cheat Uber.

The first is requesting a trip for a short destination. This gets the passenger an inexpensive ride. While en route, the passenger changes the destination to the actual intended destination which is further away. Uber accepts this without changing the original fare, woohoo.

The second is a refinement of the first one but instead of changing the destination once, the passenger changes the destination multiple times to make multiple stops. The passenger would enter destination 1, on arrival tell the driver to wait a few (“3 minutes tops, just to pick up my bag”), once back the passenger changes the destination to another stop and so on. Uber accepts this as well without extra fares.

For me, the driver, I get paid by the mile and time, it doesn’t matter whether riders do this or not. So long as I don’t get stiffed on my fare.

Now don’t try this on your own. Uber and Lyft might have fixed cheating this way. You could get banned from riding them.

Mailbird email client, comparable to Outlook or Mac Mail? Not!

I recently had a need to find an alternative email client on Windows 10. The Mailbird web site is all jazzy and lists many features. Other blog posters also reviewed Mailbird. Short is they claim Mailbird compares favorably with mainline Mail and Calendar.

They missed one huge thing. Nowhere in Mailbird is there a little thing called a CALENDAR. They promised it’s in development. What they have is a connected calendar which only works if you connect Mailbird to Google’s Calendar, or another calendar service, but not on its own.

It would be great if it came with a working calendar and a syncing service.

Hah, I’ll be pleasantly surprised when I see a CALENDAR.

There! I wanted to be sure the Internet has someone with integrity to point that out.

Referral codes for Uber Riders and Drivers

I recently became an Uber driver part time to supplement my income for my gadget toy fund. The results have been great, there’s money for the toys and additional left over. The additional income could potentially be used to buy a car.

However, I’ve calculated the budget and Uber driving is definitely not something that is feasible to do full time (at least here in Seattle). It works well only part time where you already have a primary job.

Uber drivers can provide referral codes for riders and drivers. For riders, the codes can provide a discount when first registering an account with Uber. For divers, the codes can provide a guaranteed amount of money when first registering an account with Uber.

You can only use this code once and when you sign up as a rider or driver.

For drivers Uber says you can potentially earn a guaranteed earnings of $300 per this site (note that the link is generated, it may stop working at some point): Driver Sign-Up Guaranteed Earnings.

For drivers a minimum amount of trips are required. Based on information on the web the guaranteed earnings can be between $500 – $1300. I would assume UberX is $500.-

For riders the bonus is less rewarding but pretty cool if the rides are short. Sign up with the code and Uber says the rider get $2 off the first 3 rides. Once the rider take the first ride they get $5 off the next ride.

Note that these codes only work for first time drivers and riders.

Enjoy your ride! My referral code is u93xh

Google’s new “Hold Command + Q to quit” Chrome feature on Mac (turn it off!)

It boggles my mind why Google has added a new but unwanted feature that is a default behavior on Chrome browsers. It disrupts the flow of quitting an app that is standard across all Mac applications.

There’s just no benefit to this approach. Even Google has not come up with a reason for this feature. No explanation, scenario, or information of this significant change whatsoever.

Is it an attempt to stiff Apple’s upper lip? If so that’s a really stupid move because the real victims are all Mac Chrome users that are impacted by this new procedure, not Apple. It really feels like an unseasoned developer added this hodgepodge feature, most likely an inexperienced intern.

Mac users are used to simply do Command + Q keypress to quit an app. The point of any GUI is to have a uniform behavior for its apps and OS (which includes window behavior that is now impacted by Google).

If apps start say requiring Command + A through Z to quit, the Mac app ecosystem will be sorely irate.

Thankfully you can go to the Chrome menu and uncheck “Warn Before Quitting” to remove this stupid feature.

If such a stupid feature passes muster by Google’s Product Management team, that really speaks of a low calibre team (please read “low” as stupid).

Amazon Prime – isn’t it now really just Free Shipping no matter how long it takes?

I’ve been noticing how Amazon Prime has changed whether recently or have for a while I don’t recall.

Amazon Prime has really been ubiquitously associated with Free 2 Day shipping. No matter where you are, no matter how many goods you ordered, 1, 2, 3, 5, etc. I suppose there’s an upper limit somewhere. Well, there are exceptions to the 2 day delivery, but for the most part, metropolis and goods are within a 2 day delivery reach.

It turns out there are some fine prints now that delivery times are dependent on where the goods and the destinations are. Those factors may cause the delivery time to exceed 2 days.

In my case a very simple can of “Scotchgard Water and Sun Shield with UV Protector, 1 Can 10.5 Ounces” will arrive Friday Oct 5th, 2018. However, it was a Prime goods and supposedly guaranteed to deliver in 2 days. It was ordered Oct 1st. So Oct 3rd, no?

Well, no, it turns out it is still free shipping but the delivery date is now Friday Oct 5. 4 days later from the order date.

So Amazon, what else might you have changed? Breaking contracts as you slip in these changes?

The solution for me is simple, filter and choose the “Get it today”, or “Get it tomorrow” options for shipping. I now never filter by “Prime” anymore. You never know when you’re gonna get your order.

Another solution for me is to buy locally than wait for Amazon to deliver in 5 days. I can just go take my car and get it in 10 minutes. Hey now, isn’t buying locally Amazon’s market to take away? Its competitor? The reason many small stores go under and close?

For a particular Prime order, I now still have an order in transit for 2 months still out there somewhere. I think it’s time I pulled the plug on that one and let Amazon and the seller figure out what the heck happened 🙂 This is nuts.


How to enable startup chime sound in Mac OSX El Capitan

OK, OK, I’m late to the upgrade party. But if it works just fine for me why upgrade?

Well in my case I needed to run Quicken for Mac which requires El Capitan <grumble, grumble>

In fact, El Capitan runs faster than Yosemite, so I’m thankful. But not for the Disk Util app, that’s a severe downgrade from Yosemite’s.

Most of all, they turned off the startup chime. I use that when walking away waiting for the 5 minute boot cycle (I wonder if there’s a boot argument to make that shorter 🙂

Anyway, I wanted this article available as at least one place where someone can google and find a way to enable or turn on the chime for El Capitan.

It’s pretty easy:

  1. Launch Terminal
  2. Enter the following command

sudo nvram SystemAudioVolumeDB=”%d0″
sudo nvram SystemAudioVolume=”%100″

Exit/quit from Terminal and reboot, if all went well the chime should sound on startup!

Amateur (Ham) Radio (Yaesu FT-991A) in Digital Mode (FLDigi) on Mac OSX (Yosemite)

I picked up transceiver radios several years as a new hobby. Well OK the year was 2008. The impetus was really the Katrina storm event, seeing all communications grid disrupted except for radio and satellite communications.

I have no satellite equipment and thought that would be too specialized and limited in usage. I wanted a general purpose way to communicate during normal and emergency times that could reach most of the population in the USA. Naturally, I gravitated to Amateur Radio, commonly known as Ham Radio. Ham Radios can communicate globally using Radio Frequency Waves, and as I found out, surprisingly they can also communicate via satellite (if you so choose, I didn’t).

You don’t need a license to get a radio and listen to Ham Radio, but you must have a license to transmit using Ham Radio. There is an exception that allows the use of Ham Radio without a license in life/death emergency situation to call for help.

My license is categorized as a “General” license. Simply put it allows me to use a larger amount of frequency than a “Technician” might have (which is an entry level license). “Extra” license gives you all the frequencies Amateur Radio operators may operate in.

I made my first contact with voice a long time ago. From Seattle,WA area to Sacramento, CA. It was a tremendous feeling to have that freedom to talk with someone a long ways away and free too!

My first contact suggested I try digital mode communications. That is where the voice signal is converted into a digital signal, transmitted, received, and decoded back to a voice signal to be heard by the receiver.

The advantage is lesser power is required to communicate. The disadvantage is it’s comparatively slower than speech. There are many digital modes in use today but the most popular is PSK31.

I tried it for a while back then but could not make a good contact with anyone. At the time, digital mode was achieved with a string and tin cans …

I’ve since sold my initial rig (that’s what radios are called in Ham Radio) and purchased a rig that has more capabilities and has a digital audio receiver & transmitter board in it. I no longer have to create connection cables from the computer to the radio to achieve digital mode.

Equipment configuration:

  1. Yaesu FT-991A transceiver radio
  2. A BuddiPole used vertically, aka BuddiStick (40m: 2 regular arms then 2 regular coils with no taps, an antenna whip with 2 sections out, then tune either with the radio’s internal tuner or with MFJ-269 antenna analyzer)
  3. MFJ-269 antenna tuner. I connect this to the end jack that is to connect to the radio. I use a duplexer, do not connect to the jack prior to the duplexer, the results are misleading. I set the tuner to 7.000 MHz (or whatever frequency you like) and look at the SWR meter. Pull or push on the whip section to lengthen or shorten it. The longer the whip, the lower in frequency you go and vice versa. Anyway tune the whip section until you get an SWR reading of 1.5-3. After this I let the radio’s internal tuner tune it more if necessary
  4. An alternative is to hook up the antenna and use FT0991A’s internal tuner.
  5. FLDigi software to perform encoding and decoding of the digital signal from the radio
  6. MacBook to run FLDigi on

The radio and FLDigi need to be configured as follows.

FT-991A radio SETUP using MENU/SETUP button:

BEFORE ANYTHING ELSE, CONNECT YOUR ANTENNA TO YOUR RADIO. Accidentally transmitting without an antenna could ruin your radio.

This enables the radio control:

  • 031 cat rate  9600bps
  • 032 cat tot 100 msec

This enables data communication (use DATA-USB mode)

  • 059 cw freq display DIRECT
  • 062 data mode OTHERS
  • 064 other dsp ssb 1500hz
  • 065 other shift ssb 1500hz
  • 066 data lcut freq OFF
  • 068 data hcut freq OFF
  • 070 data in select REAR
  • 071 data ptt select rts
  • 072 data port select USB
  • 073 data out level 70

This enables data in FM mode (use DATA-FM mode)

  • 074 fm mic select REAR
  • 075 fm out level 70
  • 076 fm pkt ptt select RTS
  • 077 fm pkt port select USB

You also need to set the DT MAIN configuration. Press F-MList button, then press FWD on the display until you see DT MAIN. Tap it and then use the knob on the bottom right of the display, turn it to 4 first. Now set the METER setting to ALC, it will show ALC value on the top of the display, As we turn the DT MAIN knob higher, we want to see ALC only a little, turn it just until you see ALC, then turn it back one step.

Before connecting the FT-991A to the Mac, you must install USB drivers on the Mac first. These can be found at:

Once the driver is installed, you can connect the USB cable.

When you are configuring FLDigi and asked for a Device in RigCat, use the serial port named /dev/cu/SLAB_USBtoUART.

FLDigi configuration:

When you first run FLDigi it shows an FLDigi configuration wizard which walks you through the setup steps.

If you’ve already stepped through that and wondering how to run it again, whoops there isn’t a way to do so. There is actually, just run Terminal which by default opens in your home folder, and run this command to be sure cd ~. Once you’re in your home folder issue this command rm -r .fldigi that should remove the configuration folder. Close FLDigi and reopen it and the wizard should appear again.

On the other hand you might just follow the steps below to configure FLDigi.

First, fill out the Operator form from menu item Configure , then UI, then Operator, provide information about the operator, it is used for digital mode. These are optional for voice and CW operation. It is however strongly recommended for digital mode. Of specific importance are:

  • Station QTH, provide your geographic location here. I live in the vicinity of Seattle, WA. USA. So I use Seattle, WA.
  • Station locator using grid square coordinates. You can find where you are and provide the locator using this site by David K2DSL: http://www.levinecentral.com/ham/grid_square.php
  • Operator Callsign. This is your callsign that was assigned when your license was issued to you.
  • Antenna. This is optional, but I like to provide it as information.

Second, we configure our Audio section. You can get here from menu item Configure then Sound Card. Set checkmarks for PortAudio and Device Supports Full Duplex. Then select USB Audio CODEC for both Capture and Playback settings.

To control our radio using the FLDigi software, we select the Configure menu item, then select Rig Control menu item, and then you’ll see the screen shown below.

Enter the values marked by red boxes as shown. Make sure you click Save.

For Rig Description file, get the file from here: https://sourceforge.net/projects/fldigi/files/xmls/yaesu/FT-991.xml/download

and place it in your ~/.fldigi/rigs folder, select it for Rig description file.

If you had the USB cable plugged in earlier, unplug it now, this is to reset the serial port driver on the Mac. FLDigi will sometimes not connect to the radio and you’ll see the frequency display mismatched.

  • Close the FLDigi application.
  • Connect the USB cable from the radio to the Mac.
  • Power on the radio.
  • Launch FLDigi.

If all went well, the frequency display on your radio should match the frequency display on FLDigi.

Final step is to choose the Operating mode. Use menu item Op Mode, then PSK, then BPSK-31.

The frequency that is commonly used for PSK in the 40m band is 7.080.15 MHz USB in the morning USA Pacific time. When you tune around there, you’ll hear a bunch of squealing noises that PSK31 makes. You’ll also see yellow streaks on the waterfall display. A yellow streak is one conversation going on.

Click your mouse on one of the yellow streaks and FLDigi should decode and display the conversation.

Create an AirPlay server using Raspberry Pi (Apple iTunes server clone)

I recently came across forked-daapd, forget what the name means. If you’ve ever setup your iTunes app as a music server, well this is a clone of that.

This means you can use a remote on your iPhone, iPad, or Android device to control the iTunes music server to play music on remote speakers (with the use of Apple’s Airport Express WiFi device).

I started with a scratch Raspberry Pi install, this time around I’m using the latest distribution of Raspbian named Stretch.

You can use instructions on this page to install Stretch on your Raspberry Pi:


Once that is done, you’ll then want to install what is called a repository key. A repository is basically a server that contains applications you can install. A gpg key is a digital signature used to authenticate the repository.

The command to get the repository key is:

wget -q -O – http://www.gyfgafguf.dk/raspbian/forked-daapd.gpg | sudo apt-key add –

Then we want to add the following line to /etc/apt/sources.list, make sure it is the first line in the file, otherwise it will pick up an old version of forked-daapd. This adds the repository that contains forked-daapd to our software install list before the default list so we can install the latest forked-daapd.

deb http://www.gyfgafguf.dk/raspbian/forked-daapd/ stretch contrib

Note that if you have Raspbian Jessie, you can replace the word stretch above with “jessie”.

Now we can install forked-daapd with this command, it takes about a minute or so:

sudo apt update && sudo apt install forked-daapd

Once installed, you have to configure forked-daapd’s configuration file:

sudo nano /etc/forked-daapd.conf

Look for the line that looks like: directories = { “/srv/music”}

Replace the directory “/srv/music/” with wherever you have your music located.

That’s all you have to do with this configuration file.

I have in a USB drive in a directory named “Music” so I first mount the USB drive by editing /etc/fstab file (so it’ll mount everytime the Pi reboots) like so:

/dev/sda1       /media  vfat    defaults,ro     0       0

Note I’m using /dev/sda1 which is the USB disk with the “Music” directory. Also note the “ro” parameter, it means read only so you don’t accidentally write over your music files.

Mounting the USB drive is achieved by issuing this command:

sudo mount -a

So, now you have forked-daapd installed, music mounted, time to make it work:

# start forked-daapd
sudo service forked-daapd start

# check status to see if it started successfully
sudo service forked-daapd status

You should see something like this (sorry for the blur, it’s WordPress’ doing):

Note the green text “active running” that means it is running succesfully. You can also check this file to see how forked-daapd file is doing:

sudo less /var/log/forked-daapd.log

I hope everything went well with no errors. If so, it’s time to add our remote.

For Apple devices, download the Remote app.

For Android devices, I have the best experience with TunesRemote+ app.

To pair your devices with forked-daapd use the following page, starting with Pairing with Remote on iPod/iPhone:


With TunesRemote+ I found the pairing instructions above not working. Fortunately there is a workaround by adding the music library manually (i.e. enter the ip address of the forked-daapd server).

forked-daap has a very helpful and responsive help thread here:


That’s it!


Raspberry Pi as a Mac OSX file server

Update 1/5/2017, I’ve made configuration adjustments to /etc/netatalk/afpd.conf (2nd section below) and /etc/netatalk/AppleVolumes.default (third section below). I also added a section to enable the firewall.

Update 1/4/2017, previously I was unable to make this work with Samba (Windows file sharing for Linux) but after I rebuilt the Pi and followed my own instructions I was able to make this work.

This time I want my Raspberry Pi server to behave as another Mac sharing its files. It is incredibly easy. I use the latest image of Raspberry Pi Raspbian OS Jessie with PIXEL dated 2016-11-25.

First, we install netatalk (this software provides the functionality of an AFP file server used by Macs to share files).

sudo apt-get update
sudo apt-get install netatalk

Second, install ufw firewall if not already

sudo apt-get install ufw
sudo ufw allow 548
sudo ufw allow 5353

Third, restart services

sudo service avahi-daemon restart
sudo service netatalk restart

Third, I adjust the /etc/netatalk/afpd.conf file and use the following line at the end

– -tcp -noddp -uamlist uams_dhx2.so -nosavepassword -mimicmodel RackMac

Fourth, if I wanted to add /mnt/raid5/storage to Mac’s file share I would edit /etc/netatalk/AppleVolumes.default. At the end of the file add the following

/mnt/raid5/storage  “RAID 5 Storage”   dperm:0750 fperm:0660 umask:7007

Then update the configuration of /mnt/raid5/storage so users can access it

sudo chgrp -R users /mnt/raid5/storage  #change the group to users (pi is a member of it)
sudo chmod -R ug+r+w,o-rwx /mnt/raid5/storage # change permissions (so pi can access it)

Fifth, restart the whole stack

sudo service avahi-daemon restart
sudo service netatalk restart

Sixth, now from my Mac’s Finder I can see my raid5 tinypute appear as a shared PC, I can click it, and “Connect As” my tinypute user “pi” using its password and connect to pi’s home directory.

That’s it!