Categories
Internet

altafiber FiOptics 2 Gigabit

A follow-up to my original FiOptics article, we recently upgraded to their (Cincinnati Bell is now altafiber) 2 gigabit service. The service is rated at 2 Gbps down and 1 Gbps up.

The extra bandwidth necessitated a new ONT, which I was told supports up to 10 gigabits, and an SFP module for the UniFi UDM Pro as the ethernet port is only rated for 1 Gbps. That, coupled with a UniFi switch that has 2.5 Gbps Ethernet ports, means we actually access the full available bandwidth.

Overall the service has been solid, and really no different from our previous service. Just like 1 Gbps service felt like overkill at the time, we grew into 1 Gbps and could, at times, saturate the available bandwidth. This should hopefully last us quite some time … until 10 Gbps becomes a thing 😉

Categories
Linux

Vagrant VMware Utility + openSUSE Tumbleweed

I recently switched back to using VMWare Workstation (17.0.2) with Vagrant (2.3.7) this time with openSUSE Tumbleweed instead of Fedora, and found that every time I restarted, the Vagrant VMware Utility (1.0.22) would “fail to communicate”.

To fix this, I ended up created the following shell script to ensure the service was loaded correctly:

#! /usr/bin/bash

sudo systemctl enable /etc/systemd/system/vagrant-vmware-utility.service
sudo systemctl restart vagrant-vmware-utility.service

Save this as a your_filename_here.sh, ensure it is executable, and run it:

$ chmod +x your_filename_here.sh
$ ./your_filename_here.sh

UPDATE 2023-10-25:

I recently updated to VMWare Workstation 17.5.0 and Vagrant 2.4.0 and realized my initial script was incorrect. I’m now using the following:

#! /usr/bin/bash

sudo systemctl enable /opt/vagrant-vmware-desktop/bin/vagrant-vmware-utility.service
sudo systemctl restart vagrant-vmware-utility.service
Categories
Linux

Linux Variable Fonts

The default GNOME font in Fedora – Cantarell – just wasn’t doing it for me recently and so I decided to find an alternative font. That path led me to Proxima Vara. Variable fonts are a relatively new font technology, and being Linux, I wasn’t too surprised that GNOME didn’t support this out of the box. Like most things with Linux, I guessed that there was already a solution.

Note: everything that follows is in the context of Proxima Vara, but I’d bet other fonts work the same.

First, install the font, then let’s see how the OS sees it

fc-list | grep Proxima

The result was the following (truncated to show Regular and Bold)

...
/var/home/ryan/.local/share/fonts/Mark Simonson - Proxima Vara Roman.ttf: Proxima Vara,Proxima Vara Roman:style=Regular
...
/var/home/ryan/.local/share/fonts/Mark Simonson - Proxima Vara Roman.ttf: Proxima Vara,Proxima Vara Roman:style=Bold
...

Next, using the dconf tool (install as needed) and search for “font”. For both “document-font-name” and “font-name” I used the following value

Proxima Vara style=Regular 10

Note the “style=Regular” here, that was the key to solving the problem. Also note that the “10” here is the font size I wanted to use, but you can change it to your preference.

If you use a took like (GNOME) Tweaks, it will list fonts set in this way as “none”, but I suspect that will change eventually as Tweaks comes to support variable fonts.

Categories
Development Learning Linux

FileZilla Pro .desktop file

For anyone who might decide to purchase a license for FileZilla Pro for Linux – Pop!_OS (Ubuntu) in my case – and you want to have an icon to open the application instead of using the command line, try the following:

Extract the files (assuming your bz2 file is in your Downloads folder)

$ cd Downloads
$ tar -xvJf FileZilla- (tab to autocomplete)

Move it to some place nice

$ sudo mv FileZilla3 /opt

Then create the .desktop file

$ vim ~/.local/share/applications/FileZilla.desktop 

Paste the following text

[Desktop Entry]
Name=FileZilla Pro
GenericName=FTP client
GenericName[da]=FTP-klient
GenericName[de]=FTP-Client
GenericName[fr]=Client FTP
Comment=Download and upload files via FTP, FTPS and SFTP
Comment[da]=Download og upload filer via FTP, FTPS og SFTP
Comment[de]=Dateien über FTP, FTPS und SFTP übertragen
Comment[fr]=Transférer des fichiers via FTP, FTPS et SFTP
Exec=/opt/FileZilla3/bin/filezilla
Terminal=false
Icon=/opt/FileZilla3/share/icons/hicolor/scalable/apps/filezilla_pro.svg
Type=Application
Categories=Network;FileTransfer;
Version=1.0
StartupWMClass=Filezilla

Save your file and your done. Enjoy!

Categories
Development Internet

WP Migrate DB Pro + Vagrant – 502 errors

I’ve been using WP Migrate DB Pro and Vagrant for some time, but there has always been one aspect that has really annoyed me: when pulling from a remote server to my local environment, Media downloads would (very) often fail due to a 502 timeout.

I had always assumed it was an error on the remote server, until one day I was reading through my local log files (as one does) and stumbled across a Nginx configuration change that made everything work as it should.

I should note that my configuration uses Nginx and PHP-FPM, and it’s the configuration of the latter which is where the tweak needs to be made:

location ~ \.php$ {
	...

	fastcgi_buffers 16 16k;
	fastcgi_buffer_size 32k;

	...
}

https://stackoverflow.com/questions/46205725/nginx-502-fastcgi-error

Where you configure how PHP files are handled, be sure to increase the buffers and buffer size — the defaults are too small to handle the amount of data downloaded by WP Migrate DB Pro.

With this simple change, I can finally work locally with WordPress and be sure my files are in sync with the remote server.

Categories
Apple macOS

Light mode with a dark Menu Bar and Dock using macOS Mojave

macOS Mojave (10.14) was released today, and if you’re like me, you may have decided that dark mode is not for you. Well, I stumble across a site that helped me regain the appearance of High Sierra that I was used to: a light theme with a dark Menu Bar and Dock.

To enable:

defaults write -g NSRequiresAquaSystemAppearance -bool Yes

To disable:

defaults write -g NSRequiresAquaSystemAppearance -bool No

However, this method ended up breaking a few apps and generally it didn’t work out the way I wanted, so I reverted. That’s when Firefox started having a fit, visually speaking, and I noticed in the comments (on the site above) that I wasn’t alone. I tried to reply to the user having the same trouble, but I don’t have a Disqus account (and you’re the product) so I’m writing it here in case anyone has this same issue.

The issue can be fixed by running the following in terminal (assuming you used the command from the article above):

defaults delete -g NSRequiresAquaSystemAppearance

I didn’t need to log out (or restart), Firefox just started working.

I’m actually hoping that dark mode improves over time, or at least that apps better support it. For now, I’ll settle for the default light mode.

Categories
Apple macOS

Removing .DS_Store Files

With the released of macOS 10.13 High Sierra, I did a review of my installed applications to make sure an upgrade would be as painless as possible. One item that caught my eye was Lingon X, which I use solely to remove .DS_Store files via launchd. You can manage this yourself, but Lingon X is so straightforward that it’s easily worth the cost ($10).

Within Lingon X, under the me section, I “named” my script:

local.dsstore.com

For the “Run” command I provided the following:

/usr/bin/find /Users/[user] -name *.DS_Store -type f -delete

Note: be sure to replace [user] with your actual user account. Interestingly, I tried using ~ (tilde) to indicate my own home folder, but Lingon X said that would result in an error.

Lastly, I selected “Scheduled” and decided to run this every 15 minutes.

Everything works as expected, and sometimes, if I’m really bored, I do something in Finder to create a .DS_Store file and, like watching paint dry, wait until my script runs and removes it.

Categories
Internet Learning

Duolingo to busuu

I’m so frustrated that I just need to put this somewhere — I’m giving up on Duolingo today after 328 continuous days of using it. They have this thing called a streak, or your total days of continuous use, and so I’ve been using Duolingo every day for 328 days.

I’m getting off track, my disappointment has nothing to do with my streak and everything to do with Duolingo’s monetization strategy. They know people have become hooked on having a long streak, so they’ve decided now it’ll cost you to keep it. To be fair, you can earn their virtual currency to retain your streak should you forget your daily lesson a day here or there, but now that virtual currency is harder to earn and the cost of retaining that streak has gone up. Oh sure, they’ll sell you more virtual currency, but why even have virtual currency? I think it misses the point of trying to learn another language.

So, I’ve done some research and just now signed up, and paid for, a year of busuu, and so far it’s as good or better than Duolingo in every way that’s important to me. On top of that, I can send my own practice phrases (written or audio) and other users will critique them and provide feedback, and I get to do the same. That feels very gratifying to me.

Anyway, I hate to give up the streak, but it’s time.

Categories
Apple CakePHP Development

macOS + MAMP + CakePHP (bake)

Are you using macOS, MAMP, and trying to bake some CakePHP code? Are you having trouble because you get an error in Terminal such as this:

Fatal error: You must enable the intl extension to use CakePHP.

And I bet all you did was browse to your CakePHP site and tried to run this:

bin/cake bake

Well, you could install intl via Homebrew or one of the half-dozen other solutions I found, or you could simply do the following:

  1. Install/upgrade to MAMP 4.x
  2. On the left, select Languages > PHP
  3. Select the checkbox labeled: Make this version available on the command line.
  4. Click Save

Once you’ve done, open up Terminal again (if it’s already open, type exit and Quit Terminal first before trying this again) and browse to your CakePHP site. This time, instead of what you typed above, simply type the following command:

php bin/cake.php bake

This should work just fine, as php is now aliased to the MAMP PHP version (step 3 above), which has intl install, and you’re specifying the PHP script directly, bin/cake.php, and together you’ll be able to bake all the CakePHP code you need.

Categories
Apple macOS

macOS Sierra 10.12 SSH Keys

I updated to macOS Sierra 10.12 (GM) tonight and surprisingly everything seemed to work without any issues … at least so far. One thing that did come up, but was easily remedied, was that all of my SSH keys stopped working.

ssh git@github.com

The above command prompted for a password (assuming you use GitHub), which is should not do if SSH keys are set up properly.

Assuming your SSH keys are RSA-based, I have a quick solution:

cd ~/.ssh

This will get us into our user SSH folder

ssh-add -l

This lists all keys that the SSH agent knows about. After upgrading, this returned zero keys! Note: In reality ssh-add is session-based, and so each time you log in this command will show zero results (see below).

ssh-add -K ~/.ssh/[your-private-ssh-key-name]

You’ll be asked for the password (if one is set) for this private key

-K tells ssh-add to save the key into your Keychain, so that on subsequent logins, even if ssh-add -l shows nothing, ssh will also look in your Keychain to see if the key is save there.

[your-private-ssh-key-name] is likely id_rsa, but it could be others as well

Repeat step 3 as needed

ssh-add -l

You should now see you SSH key(s) listed

That worked for me, though oddly I had to do this process twice as the first time I made it to step four, then exited Terminal, none of my applications using SSH worked, I opened Terminal again and found that nothing was listed when I ran the ssh-add list command.

UPDATE:

This doesn’t seem to do what I thought it should, namely, upon reboot I had to repeat this process again. I have since added the following steps:

cd ~/.ssh/
sudo vim config

I then added this line to my SSH config file:

IdentityFile ~/.ssh/[your-private-ssh-key-name]

I saved the config file, and now my SSH keys work as expected.

UPDATE 2 (19 Dec 2016):

With Apple’s update to 10.12.2 I found myself having SSH issues yet again. A bit of searching pointed me to the updated man pages as seen via Terminal:

man ssh_config
AddKeysToAgent
    Specifies whether keys should be automatically added to a running ssh-agent(1). If this option is set to ``yes'' and a key is loaded from a file, the key and its passphrase are added to the agent with the default lifetime, as if by ssh-add(1). If this option is set to ``ask'', ssh will require confirmation using the SSH_ASKPASS program before adding a key (see ssh-add(1) for details). If this option is set to ``confirm'', each use of the key must be confirmed, as if the -c option was specified to ssh-add(1). If this option is set to ``no'', no keys are added to the agent. The argument must be ``yes'', ``confirm'', ``ask'', or ``no''. The default is ``no''.
UseKeychain
    On macOS, specifies whether the system should search for passphrases in the user's keychain when attempting to use a particular key. When the passphrase is provided by the user, this option also specifies whether the passphrase should be stored into the keychain once it has been verified to be correct. The argument must be ``yes'' or ``no''. The default is ``no''.

I eventually landed on the following inside my config file (~/.ssh/config), erasing everything I had added in the first UPDATE.

Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/[your-private-ssh-key-name]

Afterwards I restarted to flush anything in SSH and noticed that everything was working correctly again. At this point, it’s probably a good idea just to start with this, assuming you’re running at least macOS 10.12.2.

Note: The above example I actually repeated three times since I have more than one SSH key that I need to use. Just copy and paste, being sure to update your private key filename.