• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Create a VM ($25 Credit)
  • Buy a Domain
  • 1 Month free Back Blaze Backup
  • Other Deals
    • Domain Email
    • Nixstats Server Monitoring
    • ewww.io Auto WordPress Image Resizing and Acceleration
  • About
  • Links

IoT, Code, Security, Server Stuff etc

Views are my own and not my employer's.

Personal Development Blog...

Coding for fun since 1996, Learn by doing and sharing.

Buy a domain name, then create your own server (get $25 free credit)

View all of my posts.

  • Cloud
    • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
    • How to buy a new domain and SSL cert from NameCheap, a Server from Digital Ocean and configure it.
    • Setting up a Vultr VM and configuring it
    • All Cloud Articles
  • Dev
    • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
    • How to setup pooled MySQL connections in Node JS that don’t disconnect
    • NodeJS code to handle App logins via API (using MySQL connection pools (1000 connections) and query parameters)
    • Infographic: So you have an idea for an app
    • All Development Articles
  • MySQL
    • Using the free Adminer GUI for MySQL on your website
    • All MySQL Articles
  • Perf
    • PHP 7 code to send object oriented sanitised input data via bound parameters to a MYSQL database
    • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
    • Measuring VM performance (CPU, Disk, Latency, Concurrent Users etc) on Ubuntu and comparing Vultr, Digital Ocean and UpCloud – Part 1 of 4
    • Speeding up WordPress with the ewww.io ExactDN CDN and Image Compression Plugin
    • Setting up a website to use Cloudflare on a VM hosted on Vultr and Namecheap
    • All Performance Articles
  • Sec
    • Using the Qualys FreeScan Scanner to test your website for online vulnerabilities
    • Using OWASP ZAP GUI to scan your Applications for security issues
    • Setting up the Debian Kali Linux distro to perform penetration testing of your systems
    • Enabling TLS 1.3 SSL on a NGINX Website (Ubuntu 16.04 server) that is using Cloudflare
    • PHP implementation to check a password exposure level with Troy Hunt’s pwnedpasswords API
    • Setting strong SSL cryptographic protocols and ciphers on Ubuntu and NGINX
    • Securing Google G Suite email by setting up SPF, DKIM and DMARC with Cloudflare
    • All Security Articles
  • Server
    • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
    • All Server Articles
  • Ubuntu
    • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
    • Useful Linux Terminal Commands
    • All Ubuntu Articles
  • VM
    • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
    • All VM Articles
  • WordPress
    • Speeding up WordPress with the ewww.io ExactDN CDN and Image Compression Plugin
    • Installing and managing WordPress with WP-CLI from the command line on Ubuntu
    • How to backup WordPress on a host that has CPanel
    • Moving WordPress to a new self managed server away from CPanel
    • Moving a CPanel domain with email to a self managed VPS and Gmail
    • All WordPress Articles
  • All

OSX

Yubico YubiKey 5Ci with USB-C and Lightning connector for mobile devices

July 27, 2020 by Simon

I am a big fan of the Yubico YubiKeys. I have a couple of YubiKey 4 NEO NFC devices. This post will show the Yubico YubiKey 5Ci 

Here are my older posts on the YubiKey 4 NEO’s

  • Using the Yubico YubiKey NEO hardware-based two-factor authentication device to improve authentication and logins to OSX and software
  • Setup two factor authenticator protection at login on Ubuntu or Debian
  • Add two factor auth login protection to WordPress with YubiCo hardware YubiKeys and or 2FA Authenticator App
Yubico YubiKeys

My YubiKey NEO’s have been set up on sites with ether “Insert and Press” (FIDO U2F) or Insert and copy 6 digit OTP code’s (that is valid for 30 seconds).

When a site requires an OTP code I can insert the key and run the YubiKey Authenticator software on iOS, Android, Mac or Windows (and enter an optional password) where I can see all my defined website OTP’s

YubiKey Authentication image

I have enabled YubiKey “Insert and Press” and or time-based OAUTH-HOTP protections to as many logins as I can (PayPal, GMail, Google GSuite, DropBox, My Servers (SSH), WordPress, Forums etc).

I use the NFC on the YubiKey NEO to login to my NFC printer at work.

YubiKey 4 NEO NFC

OTP or TOTP and FIDO U2F or Insert and Press

I am not going to not bore you to death with technical details here and I will refer to TOTP as OTP and FIDO U2F (FIDO Universal 2nd Factor) as “Insert and Press”.

Insert and Press is easier to explain than FIDO Universal 2nd Factor.

You can read about each here:

  • Time-based One-time Password algorithm (TOPT): https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm
  • U2F – FIDO Universal 2nd Factor authentication (Insert and Press): https://www.yubico.com/authentication-standards/fido-u2f/

Find sites that use 2FA

https://twofactorauth.org/ allows you to find sites that use (or do not use) 2FA.

https://twofactorauth.org/ main page

You can search for a site (e.g “play”) and see if the matching sites have 2FA enabled to protect logins.

My Google Play, PlayStation and Ubisoft UPlay accounts are protected with 2FA.

I searched for "Play"

You can also view categories and see what websites and services are up to date. This can be handy if you are looking for a product or service (choose the most secure IMHO).

https://twofactorauth.org/#backup

I would recommend you contact website’s that use that does not support 2FA and tell them. If they drag their feet supporting 2FA, I’d leave them.

My NFC Issue

I recently purchased a Flip Wallet/Phone Case with a magnetic back (so I can remove the phone from the wallet), but the magnets cause issue reading NFC on various devices including the YubiKey.

My phone has a poor NFC range at best and my YubiKey NEO cannot be read with my new phone case on.  I’ll admit I don’t use NFC anymore on my phone.

Huawei Mate 20 Pro phone c ase

Enter the YubiKey 5Ci (with USB-C and Lightning adapter)

Yubico has a YubiKey 5Ci that has a USB-C and Lightning connector for phones and tablets. My phone has a USB C connector and this would work well instead of NFC.  

You can buy a YubiKey 5Ci direct here for $70 USD. 

YubiKey also make 5CI with transparent plastic

If you are Down Under like me you can order from here https://shop.mi-token.com/#!/public-catalogue  and pay in AUD.

YubiKey 5Ci Specifications

USB Type
USB-C, Lightning

NFC-enabled
No

Authentication Methods
Passwordless, Strong Two Factor, Strong Multi-Factor

Productivity & Communication
Google Account, Microsoft account, Salesforce.com | Emerging support for Lightning connector

Password Managers
1Password, Dashlane Premium, Keeper®, LastPass Premium | Emerging support for Lightning connector

Cloud Storage
Dropbox, Google Drive, OneDrive | Emerging support for Lightning connector

Social
Facebook, Twitter, YouTube | Emerging support for Lightning connector

Design & Durability
No Batteries Required, No Moving Parts

Function
WebAuthn, FIDO2 CTAP1, FIDO2 CTAP2, Universal 2nd Factor (U2F), Smart card (PIV-compatible), Yubico OTP, OATH – HOTP (Event), OATH – TOTP (Time), Open PGP, Secure Static Password

Certifications
FIDO 2 Certified, FIDO Universal 2nd Factor (U2F) Certified

Cryptographic Specifications
RSA 2048, RSA 4096 (PGP), ECC p256, ECC p384

Device Type
FIDO HID Device, CCID Smart Card, HID Keyboard

Manufacturing
Made in USA and Sweden

My YubiKey 5Ci

My YubiKey 5Ci arrived in a small but strong package. Wow this is small.

YubiKey 5Ci Package

The back of the 5Ci packaging has clear instructions.

YubiKey Rear Packaging

I removed the YubiKey 5Ci from the packaging.

A lightning plug is on the left and a USB-C plug on the right. In the middle is a contact to allow activation.

YubiKey 5Ci, Lightning plug on one end and a USB-C plug on the other end

The YubiKey 5Ci is tiny. It is about 4c long with a hole in the middle to allow me to place it on a key chain.

It is about as wide as 2.5 keyboard keys

I do not use iPhone’s or iPad’s but my wife and child do so the lightning plug may come in handy.

Lightning plug close up

The USB plug however will be using on my Android phone and will replace my NFC on My YubiKey 4 NEO when I transfer connected websites over.

USB-C plug up close

I can see two metal contact points on each side of the YubiKey 5Ci that I can press and activate when in Insert and Press mode

Metal contacts on each side of the 5Ci

Insert and Press or Enter OTP Code

What is the difference between 5Ci and Insert and Press when logging into sites?

Google will prompt me to insert my YubiKey and press the bottom to log in.

Googole Insert and Press

My Nextcloud install will prompt for a OTP code (to obtain this I need to Insert my YubiKey and obtain the OTP code)

WordPress requires my YubiKey’s to be presented at login

Wordpress Enter Security Key

I set up my cloud serves to prompt me for a OTP when I log in via SSH. I use MobaXTerm to connect to my servers.

Enter a OTP for the shell

I need to enter an OTP twice as two connections to the server are created (one for the shell and one for the directory listing)

Enter OTP for file the shell

YubiKey 4 NEO v YubiKey 5Ci

Here is a picture comparing my YubiKey NEO and the 5Ci

The 5Ci is thinner and shorter than the NEO

YubiKey Neo 4 NFC and a YubiKey 5Ci

YubiKey Size compared

My YubiKey 4 NEO has been used a few thousand times, but it wont plug into my Mobile Phone.

USB Plug

YubiKey 5Ci (USB C) plugged into an Android Phone

I can easily plug the YubiKey 5Ci can plug into my Android Phone (USB C Plug)

My YubiKey Authenticator automatically opens after I insert my YubiKey.

I can access OTP codes in seconds.

USB C Plus and YubiCo Authenticator

Android 10 asked me if the app Yubico Authenticator can access the USB device.

The Yubico Authenticator can be downloaded for Android here

Open YubiKey Authenticator on YubiKey Insert

YubiKey 5Ci (Thunderbolt) plugged into an Apple iPhone

When I insert the YubiKey 5Ci into my wife’s iPhone I can use the key on the iOS version of the authenticator app (download here)

5Ci inserted into an iPhone

I am prompted to enter the password I have set on the key (nice)

Enter password

YubiKey 5Ci (USB C) plugged into a PC

I have a USB C port on the back of my PC

Some PC’s have USB C on the front of the PC.

Front USB C port

USB to USB Adapter

I purchased an inexpensive USB C to USB adapter to allow me to insert the USB C plug of the YubiKey to the front of my PC

USB C to USB adapter
USB C to USB adapter

Now I can use the YubiKey 5Ci anywhere.

YubiKey 5Ci Conclusion

I love YubiKeys and 2FA of any kind and I have a key chain with my YubiKey 4 NEO (the backup key stay’s somewhere else) and my 5Ci.

I also carry 2x USB backups (encrypted) and a Tile tracking token.

My Keychain

Pros

  • Works flawlessly with OTP (HOTP)
  • Works flawlessly with Insert and Touch (FIDO U2F)
  • Works well on iOS, Android, Windows, Mac and Linux.

Cons

  • Black shows dust very well, It would be nice to have them in more colours?

Adding hardware-based 2FA is a long journey but a journey that I don’t regret taking one big.  Have a look at https://haveibeenpwned.com/ if you are unsure if this should be your journey.  Also, check out the weekly Security Now Podcast for all the news on weekly hacks and security vulnerabilities.

Use the Yubico Quiz to find out what YubiKey us best for you.

https://www.yubico.com/quiz/

Troubleshooting

N/A

v1.0 Initial Version

Filed Under: 2FA, 2nd Factor, MFA, mobile app, Nextcloud, NFC, OSX, Secure, Secure Shell, Yubico, YubiKey Tagged With: 5Ci, Yubico, YubiKey

Is OSX Mojave on a 2014 MacBook Pro slower or faster than High Sierra

October 1, 2018 by Simon

This is a quick post to see if OSX Mojave runs slower on a Mid 2014 Mac Book Pro than High Sierra

Aside

If you have not read my previous posts I have now moved my blog to the awesome UpCloud host (signup using this link to get $25 free UpCloud VM credit). I compared Digital Ocean, Vultr and UpCloud Disk IO here and UpCloud came out on top by a long way (read the blog post here). Here is my blog post on moving from Vultr to UpCloud.

Buy a domain name here

Domain names for just 88 cents!

Now on with the post.

New Mac Operating System (Mojave)

I have always been hesitant before upgrading to a new Apple operating system (or performance-impacting patch).

My Mid-2012 Macbook will not be able to install the next 2019 operating system (as it is now considered too old).

MacBook Thermal Cooling

My MacBook is already running at the limit of the stock thermal cooler (read more here). I replaced the thermal paste on my Mid-2012 Mac Book to help lower thermal temps. I often run fans at 100% with TG Pro.

Stock MacBook thermal paste (needs replacing).

Stock Paste

OSX Mojave

What’s new in OSX Mojave: https://help.apple.com/macOS/mojave/whats-new/

  • Dark Mode
  • Folder Stacks
  • Finder Enhancements
  • Quick Look Enhancements
  • New Screen gran
  • iOS to Mac camera.
  • New News App
  • Stocks App
  • Voice Memos
  • Home Control
  • Better Safari Privacy and Security
  • New Mac App Store
  • Take the tour

I currently have High Sierra Installed.

High Sierra About Screen

High Sierra – Black Magic Disk Speed Test 3.1 Speed Test Results

Write:  340.5 MB/s

Read:  348.1 MB/s

Hig Sierra Disk Benchmark

High Sierra – Novabench 4.01 Benchmark Scores

GPU: 0 (known issue)

RAM: 136

GPU: 243

DISK: 57

High Sierra Nova Bench

Downloading Mojave

Mojave is available for download in the App Store.

Download Mojave

Instaling Mojave

A quick wizard and Mojave in ready to install.

Download Mojave

Installation took about 2 hours to install over High Sierra.

OSX Mojave About Screen

Mojave Dark Mode

Dark mode is certainly very pretty, all stock apps on OSX are not optionally available in dark colour themes.

OSX Mojave dark mode

Mojave – Black Magic Disk Speed Test 3.1 Speed Test Results

Write:  348.5 MB/s (8MB/s faster than High Sierra)

Read:  348.1 MB/s (27.1MB/s faster than High Sierra)

Nice

FYI, The first 2 days of Mojave did seem a bit sower but this may because of background indexing.

My home MacBook has a 512GB Apple SSD hard drive. I recently upgraded to Mojave on a 2014 27 iMac that had a Hybrid SSD (128GB SSD + 1TB drive) and it runs really slowly.

High Sierra – Novabench 4.01 Benchmark Scores

GPU: 0 (known issue)

RAM: 136 (same as High Sierra)

GPU:251 (8 higher than High Sierra)

DISK: 57 (same as High Sierra)

Nova Bench on Mojave

Reboot Time in seconds (time taken to reboot and log back into an interactive desktop)

WOW: Reboot average times were 212 seconds in High Sierra but only 124 seconds in Mojave, that’s an 88-second improvement.

Mojave faster reboots

That totally made upgrading to Mojave worth it.

Screen Capture and save speed

Often I screenshot the desktop (or apps), Below is a time in seconds to capture the desktop and open the file in Photoshop on High Sierra and Mojave.

Capture Desktop Speed

Mojave is a lot faster (even with a wait for the file to be saved to the desktop)

IntelliJ

Does Mojave make IntelliJ slower?

Note: Sorry, the scale in the chart zoomed in by default, I am not sure how to reset the scale on the left to starts at 0.

Time to open IntelliJ

4-second improvement. Nice.

Time to opening Adobe CS Premiere Pro in Mojave v High Sierra

How does Adobe Premiere Pro handle Mojave?

Note: Sorry, the scale in the chart zoomed in by default, I am not sure how to reset the scale on the left to starts at 0.

Mojave Opening Premiere Pro

2 seconds slower (I expect updated from Adobe soon)

More to come soon.

I hope this guide helps someone.

Please consider using my referral code and get $25 UpCloud VM credit if you need to create a server online.

https://www.upcloud.com/register/?promo=D84793

Ask a question or recommend an article

[contact-form-7 id=”30″ title=”Ask a Question”]

Revision History

v1.0 Initial Post

Filed Under: Apple, High Sierra, Mojave, OS, OSX Tagged With: faster, Installing, mojave, or, OSX, slower, speed

Open a Windows 10 Boot Camp Installation on OSX in Parallels (like a VM)

April 29, 2018 by Simon

This guide will show you how you can open a Windows 10 Boot Camp Installation on OSX in Parallels (like a VM).

Installing Parallels on a Mac allows you to install Windows in A VM, this is handy but you may want to install Windows on a Mac drive with Boot camp (guide here)  for better performance.

Can you load this VM-less Windows install in OSX rather than reboot it, the answer is YES (with Parallels v13).

Setup your Windows Bootcamps (see my guide here).

Create a new VM image in Parallels (Select Boot Camp)

New Image

Click Continue

Use Windows Bootcamp

Confirm the reaction warning.

Before You Proceed

Name the VM and choose a location

Location

Set desired memory etc.

Choose your desired clipboard and disk access settings.

Options

Done, now Parallels will prepare your VM (Really Boot Camp)

Created

Preparing

Creating VM

Parallel tools will be automatically installed.

Configuring

Done, you will now be able to load your Apple Bootcamp partition as it is was a VM inside OSX (or boot it)

Windows

yes, the VM file is pointing to the Boot Camp partition.

VM File

I hope this guide helps someone.

Ask a question or recommend an article

[contact-form-7 id=”30″ title=”Ask a Question”]

Revision History

v1.0 Initial post

Filed Under: Bootcamp, Development, OSX, VM, Windows Tagged With: 10, a, Boot, Camp, in, Installation, like a VM, on, Open, OSX, Parallels, windows

How to free up disk space in OSX

April 22, 2018 by Simon

It will happen to everyone, you will run out of space (on your computer or device) and you will need to free some space. Apple OSX computers that only have Solid State storage need at least 1/5 free space to remain free all times to prevent the drive from wearing out (by using free sectors repeatedly)

I have a number of guides on moving away from CPanel, Setting up VM’s on UpCloud, AWS, Vultr or Digital Ocean along with installing and managing WordPress from the command line.

I have blogged before about my backup plan but of late I have ignored my own advice. I have let my free space dwindle to a mere few GBs of free space.

I would not recommend you use Apple iCloud to extend your storage and move unused files to the cloud. I would always recommend you backup files and clear up space (and deal with the problem).

I use Space Gremlin on OSX to find large files (this is not a paid endorsement). After you scan your drive you I could see large and common files, for me, it looks like some old Virtual Machines (Windows and Kali Linux) and over 100GB of photos.

Start with the largest files and work your way down.

Space Gremlin

Moving small files (to say an external drive is as easy as drag and drop)

Move Small Filea

I moved my two Parallel Desktop Virtual machines to an external 3TB drive (until I need them again).

Large Files

Another awesome program is Clean My Mac 3 (also not a paid endorsement), I paid for Clean My Mac 3 and if can easily find obscure hidden files to delete.

Clean

Clean My Mac has a find Large and old files tool.

Large Files

Remove unwanted developer files

I don’t need Developer related simulator files

Developer Files

or XCode (I‘ll uninstall in Clean My Mac 3)

Uninstall XCode

Search for Duplicate Files

I use a program called Twins (now called The Duplicate Finder from https://rockysandstudio.com/) to find duplicate files (not a paid endorsement). Simply point it to a drive and it will find duplicate files.

Twins

Remove (Backup) Old Photos

Open your Photos app.

Export Photos

Highlight All Photos and click File, Export then Export Unmodified…

Export

Choose export options.

Export Settings

Choose a destination (I chose a location on an external 3TB drive)

Export Location

Export in progress.

Exporting

FYI: Somes files will report that they will not export.

Exported

TIP: Confirm your photos have exported.

Confirm Copy

After I confirmed that my photos were exported I deleted the Photos.

Delete

TIP: I had to move my master images from Photos as the delete from the GRI left behind the masters.

Masters

Space Gremlin Restricted Files

If you have large chunks of restricted files (files you don’t have access too) in Space Gremlin you can run Space Gremlin with elevated permissions (the manual says).

sudo /Applications/Space\ Gremlin.app/Contents/MacOS/Space\ Gremlin
Password:
Illegal instruction: 4

Hmm, this does not work.

I have 200GB of restricted files that need scanning 🙁

200GB

Conclusion

Do repeat detection of files to delete with Space Gremlin, Twins and Clean My Mac. Ensure you have multiple backups and don’t leave all of your eggs in one basket.

I hope this guide helps someone.

Ask a question or recommend an article

[contact-form-7 id=”30″ title=”Ask a Question”]

Revision History

v1.2 200GB Restricted Files

v1.1 iCloud Info

v1.0 Initial post

Filed Under: Maintenance, OSX, Storage

Useful OSX Terminal Commands

December 11, 2017 by Simon

Following on my from Useful Linux Terminal Commands here is my Useful OSX Terminal Commands. This guide is handy for setting up a development OSX installation (e.g Apache, PHP, MySQL etc). I will update this post when I find new commands.

First, read my Useful Linux Terminal Commands post.

Normally I set up Ubuntu servers in the cloud on Vultr (read my guide here) or Ubuntu Servers on Digital Ocean (read my guide here) but this is how I can quickly set up a development environment locally on OSX.

Useful OSX Commands

Prevent your Mac from falling asleep

caffeinate

Prevent your Mac from falling asleep (for 1 minute)

caffeinate -t 60

Check Path

$PATH
/Library/Frameworks/Python.framework/Versions/3.4/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands

Compare files

opendiff index1.html index2.html

Show hidden files in Finder

defaults write com.apple.finder AppleShowAllFiles -bool TRUE

Find file on OSX

sudo find / -name "httpd-ssl.conf"

Find all listening ports

sudo lsof  | grep LISTEN
Password:
launchd      1               root   34u     IPv6 0xcd261b413removed        0t0        TCP *:afpovertcp (LISTEN)
launchd      1               root   35u     IPv4 0xcd261b413removed        0t0        TCP *:afpovertcp (LISTEN)
launchd      1               root   37u     IPv6 0xcd261b413removed        0t0        TCP *:afpovertcp (LISTEN)
launchd      1               root   38u     IPv4 0xcd261b413removed        0t0        TCP *:afpovertcp (LISTEN)
prl_pm_se  116               root   14u     IPv4 0xcd261b413removed        0t0        TCP *:55656 (LISTEN)
kdc        124               root    5u     IPv6 0xcd261b413removed        0t0        TCP *:kerberos (LISTEN)
kdc        124               root    7u     IPv4 0xcd261b413removed        0t0        TCP *:kerberos (LISTEN)
mysqld     127             _mysql   28u     IPv6 0xcd261b413removed        0t0        TCP *:mysql (LISTEN)
Dropbox    434              simon  127u     IPv6 0xcd261b413removed        0t0        TCP *:17500 (LISTEN)
Dropbox    434              simon  128u     IPv4 0xcd261b414removed        0t0        TCP *:17500 (LISTEN)
Dropbox    434              simon  150u     IPv4 0xcd261b414removed        0t0        TCP localhost:17600 (LISTEN)
Dropbox    434              simon  154u     IPv4 0xcd261b414removed        0t0        TCP localhost:17603 (LISTEN)
2BUA8C4S2  520              simon   12u     IPv4 0xcd261b414removed        0t0        TCP localhost:6258 (LISTEN)
2BUA8C4S2  520              simon   13u     IPv6 0xcd261b413removed        0t0        TCP localhost:6258 (LISTEN)
2BUA8C4S2  520              simon   14u     IPv4 0xcd261b414removed        0t0        TCP localhost:6263 (LISTEN)
2BUA8C4S2  520              simon   15u     IPv6 0xcd261b413removed        0t0        TCP localhost:6263 (LISTEN)
Adobe\x20  590              simon    9u     IPv4 0xcd261b414removed        0t0        TCP localhost:15292 (LISTEN)
node       640              simon   14u     IPv4 0xcd261b414removed        0t0        TCP localhost:49249 (LISTEN)
prl_clien 3428              simon   47u     IPv4 0xcd261b413removed        0t0        TCP localhost:51476 (LISTEN)
cupsd     3656               root    5u     IPv6 0xcd261b413removed        0t0        TCP localhost:ipp (LISTEN)
cupsd     3656               root    6u     IPv4 0xcd261b414removed        0t0        TCP localhost:ipp (LISTEN)
plugin_ho 5331              simon   26u     IPv4 0xcd261b415removed        0t0        TCP localhost:52698 (LISTEN)
iTunes    5478              simon   17u     IPv4 0xcd261b415removed        0t0        TCP *:daap (LISTEN)
iTunes    5478              simon   32u     IPv6 0xcd261b413removed        0t0        TCP *:daap (LISTEN)

Find process listening on port 80

sudo lsof -n -i4TCP:80 | grep LISTEN
Password:
httpd     8748 root    4u  IPv6 0xcd261b416removed      0t0  TCP *:http (LISTEN)
httpd     8752 _www    4u  IPv6 0xcd261b416removed      0t0  TCP *:http (LISTEN)
httpd     8763 _www    4u  IPv6 0xcd261b416removed      0t0  TCP *:http (LISTEN)
httpd     8869 _www    4u  IPv6 0xcd261b416removed      0t0  TCP *:http (LISTEN)

Find a Process

which httpd
/usr/sbin/httpd

Find A File (e.g httpd.conf)

sudo find / | grep 'httpd.conf'
/private/etc/apache2/httpd.conf~previous
/private/etc/apache2/httpd.conf
/private/etc/apache2/original/httpd.conf
/private/etc/apache2/httpd.conf.pre-update
...

Note: OSX Apache Index file location is…

/Library/WebServer/Documents/index.html.en~orig

To edit the default HTML file

sudo nano /Library/WebServer/Documents/index.html.en~orig

Built-In Apache

Disable built-in OSX apache daemon

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

Restart built-in Apache daemon

sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

View other startup daemons

sudo ls -al /System/Library/LaunchDaemons/

View All Startup Daemons

sudo launchctl list
Password:
Sorry, try again.
Password:
PID	Status	Label
-	0	com.apple.storedownloadd.daemon
7245	-44	com.apple.CoreAuthentication.daemon
189	0	com.apple.coreservicesd
-	0	com.apple.touchbarserver
-	0	com.apple.avbdeviced
289	0	com.apple.cvmsServ
-	0	com.apple.FontWorker
-	-44	com.apple.applessdstatistics
-	0	com.apple.hdiejectd
-	0	com.apple.corestorage.corestoraged
-	0	com.apple.storagekitd
-	0	com.apple.EmbeddedOSInstallService
-	0	com.apple.wifid
-	0	com.apple.storereceiptinstaller
-	0	com.macpaw.CleanMyMac3.Agent
-	0	com.apple.seld
-	0	com.apple.emond
-	-44	com.apple.iconservices.iconservicesagent
-	0	com.apple.logkextloadsd
-	0	com.apple.bluetoothReporter
68	0	com.apple.syslogd
-	0	com.apple.symptomsd-diag
258	0	com.apple.WindowServer
-	0	com.apple.NetworkSharing
-	0	com.apple.afpfs_checkafp
-	0	com.parallels.mobile.kextloader.launchdaemon
-	0	com.apple.AppleFileServer
117	0	com.apple.securityd
8529	0	com.apple.auditd
...

Force network drives to automatically connect after each login (instead of manually connecting)

Go to System Preferences > Users & Groups (click your account on left) > Drag connected network drives (from your desktop) to the Login items list box.

More: https://www.tekrevue.com/tip/automatically-connect-network-drive/

Set PHP as default Web Server delivered file in local Apache

sudo nano /private/etc/apache2/httpd.conf

Set…

DirectoryIndex index.php

Install PHP 7.0 on to OSX

FYI: 7.1 and 7.2 are out but I find 7.0 is more stable with WordPress (read more here).

More: https://php-osx.liip.ch/

sudo curl -s https://php-osx.liip.ch/install.sh | bash -s 7.0
****
[WARNING]
Detected macOS High Sierra 10.13. As this is quite new, there may be issues still. Your mileage may vary.
****
Get packager.tgz
Unpack packager.tgz
Please type in your password, as we want to install this into /usr/local
Start packager (may take some time) using /usr/bin/python2.7
downloading https://s3-eu-west-1.amazonaws.com/php-osx.liip.ch/install/7.0-10.10-frontenddev-latest.dat
downloading https://s3-eu-west-1.amazonaws.com/php-osx.liip.ch/install/7.0-10.10/frontenddev/7.0-10.10-frontenddev-7.0.24-20171002-092027.tar.bz2

Installing package 7.0-10.10-frontenddev into root /
./pkg/pre-install
pkg/pre-install
Skipping existing directory 
Skipping existing directory usr/
Skipping existing directory usr/local/
Extracting usr/local/php5-7.0.24-20171002-092027/
Extracting usr/local/php5-7.0.24-20171002-092027/bin/
Extracting usr/local/php5-7.0.24-20171002-092027/entropy-php.conf
Extracting usr/local/php5-7.0.24-20171002-092027/etc/
Extracting usr/local/php5-7.0.24-20171002-092027/include/
Extracting usr/local/php5-7.0.24-20171002-092027/info/
Extracting usr/local/php5-7.0.24-20171002-092027/lib/
Extracting usr/local/php5-7.0.24-20171002-092027/libphp7.so
...
removed
...
Extracting usr/local/php5-7.0.24-20171002-092027/bin/tsql
Extracting usr/local/php5-7.0.24-20171002-092027/bin/uconv
Extracting usr/local/php5-7.0.24-20171002-092027/bin/vacuumdb
Extracting usr/local/php5-7.0.24-20171002-092027/bin/wrjpgcom
Extracting usr/local/php5-7.0.24-20171002-092027/bin/xgettext
Extracting usr/local/php5-7.0.24-20171002-092027/bin/xslt-config
Extracting usr/local/php5-7.0.24-20171002-092027/bin/xsltproc
Executing post-install script /tmp/7.0-10.10-frontenddev-post-install
Create symlink /usr/local/php5/entropy-php.conf /etc/apache2/other/+php-osx.conf
Restarting Apache
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using removed.removed.com.au. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Finished.

Create a diag file in your OSX Default Apache root

Edit your default index file

sudo nano /Library/WebServer/Documents/index.php

Contents

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>

Now load the file

Debug Info

Install MySQL on OSX

Download: https://dev.mysql.com/downloads/mysql/

Download MySQL

Help: https://dev.mysql.com/doc/refman/5.7/en/osx-installation-pkg.html

Uninstall MySQL OSX
Read: https://community.jaspersoft.com/wiki/uninstall-mysql-mac-os-x

Add MySQL to PATH

export PATH=$PATH:/usr/local/mysql/bin

Reboot and Check the MySQL Service

Service Status

Check MySQL Version

/usr/local/mysql/bin/mysql --version
/usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.7.20, for macos10.12 (x86_64) using  EditLine wrapper

Login to MySQL from the Command Line

/usr/local/mysql/bin/mysql -u root -p;
Enter password: 
...
mysql> 

Set a new root password (after logging in as root)

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('nUp!KGFi=*FI"2p:7mC3W<%bA_`}6Tcm^\*mS1VYp[d]dup16U\t5removed,
');
Query OK, 0 rows affected, 1 warning (0.01 sec)

fyi: You can obtain a good password here.

Bonus: Install MySQL (PHP) management tool  (in Apache)

Download: https://www.adminer.org/#download Save the file to /Library/WebServer/Documents/adminer.php

Load Adminer in your browser and log in with your root password

Login to Adminer (via Apache/PHP)

Adminer

Creating MySQL Tables in Adminer (via Apache/PHP)

Create Table

Adminer allows you to fully manage your MySQL (create databases, users, run queries, alter objects etc)

Adding Records to MySQL with Adminer

Adding Records

Remove MySQL:

Read more here: https://community.jaspersoft.com/wiki/uninstall-mysql-mac-os-x

Get your Mac Processor Name

sudo sysctl -n machdep.cpu.brand_string
Password:
Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz

Show All OSX System Settings

Command:

sysctl -a

Show Live File System Usage

sudo fs_usage

Show last 10 lines of the system log

tail -f /var/log/system.log
Dec 11 22:07:35 192-xxx-xx-xxx Wireless Network Utility[568]: Model -ioClassRef error
Dec 11 22:08:05 --- last message repeated 11 times ---
Dec 11 22:08:05 192-xxx-xx-xxx Wireless Network Utility[568]: Model -ioClassRef error
Dec 11 22:08:05 192-xxx-xx-xxx Wireless Network Utility[568]: Model -ioClassRef error
Dec 11 22:08:14 --- last message repeated 2 times ---
Dec 11 22:08:14 192-xxx-xx-xxx syslogd[68]: ASL Sender Statistics
Dec 11 22:08:16xxx-xx-xxx Wireless Network Utility[568]: Model -ioClassRef error
Dec 11 22:08:46 --- last message repeated 11 times ---
Dec 11 22:08:46 192-xxx-xx-xxx Wireless Network Utility[568]: Model -ioClassRef error
Dec 11 22:08:46 192-xxx-xx-xxx Wireless Network Utility[568]: Model -ioClassRef error
Dec 11 22:09:03 --- last message repeated 6 times ---

Get Your Local WAN IP Address

ipconfig getifaddr en0
192.x.x.x

Get your Public IPV4 Address

curl icanhazip.com; echo
60.xxx.xx.xxx

More to come.

Hope this helps someone.

Donate and make this blog better

Ask a question or recommend an article

[contact-form-7 id=”30″ title=”Ask a Question”]

Revision History

v1.2 Find file (current version)

v1.1 Removed system info chunk (too big to format)

Filed Under: OSX Tagged With: commands, OSX, terminal, Useful

Primary Sidebar

Poll

What would you like to see more posts about?
Results

Support this Blog

Create your own server today (support me by using these links

Create your own server on UpCloud here ($25 free credit).

Create your own server on Vultr here.

Create your own server on Digital Ocean here ($10 free credit).

Remember you can install the Runcloud server management dashboard here if you need DevOps help.

Advertisement:

Tags

2FA (9) Advice (17) Analytics (9) App (9) Apple (10) AWS (9) Backup (21) Business (8) CDN (8) Cloud (49) Cloudflare (8) Code (8) Development (26) Digital Ocean (13) DNS (11) Domain (27) Firewall (12) Git (7) Hosting (18) IoT (9) LetsEncrypt (7) Linux (21) Marketing (11) MySQL (24) NGINX (11) NodeJS (11) OS (10) Performance (6) PHP (13) Scalability (12) Scalable (14) Security (45) SEO (7) Server (26) Software (7) SSH (7) ssl (17) Tech Advice (9) Ubuntu (39) Uncategorized (23) UpCloud (12) VM (45) Vultr (24) Website (14) Wordpress (25)

Disclaimer

Terms And Conditions Of Use All content provided on this "www.fearby.com" blog is for informational purposes only. Views are his own and not his employers. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. Never make changes to a live site without backing it up first.

Advertisement:

Footer

Popular

  • Backing up your computer automatically with BackBlaze software (no data limit)
  • How to back up an iPhone (including photos and videos) multiple ways
  • Add two factor auth login protection to WordPress with YubiCo hardware YubiKeys and or 2FA Authenticator App
  • Setup two factor authenticator protection at login on Ubuntu or Debian
  • Using the Yubico YubiKey NEO hardware-based two-factor authentication device to improve authentication and logins to OSX and software
  • I moved my domain to UpCloud (on the other side of the world) from Vultr (Sydney) and could not be happier with the performance.
  • Monitor server performance with NixStats and receive alerts by SMS, Push, Email, Telegram etc
  • Speeding up WordPress with the ewww.io ExactDN CDN and Image Compression Plugin
  • Add Google AdWords to your WordPress blog

Security

  • Check the compatibility of your WordPress theme and plugin code with PHP Compatibility Checker
  • Add two factor auth login protection to WordPress with YubiCo hardware YubiKeys and or 2FA Authenticator App
  • Setup two factor authenticator protection at login on Ubuntu or Debian
  • Using the Yubico YubiKey NEO hardware-based two-factor authentication device to improve authentication and logins to OSX and software
  • Setting up DNSSEC on a Namecheap domain hosted on UpCloud using CloudFlare
  • Set up Feature-Policy, Referrer-Policy and Content Security Policy headers in Nginx
  • Securing Google G Suite email by setting up SPF, DKIM and DMARC with Cloudflare
  • Enabling TLS 1.3 SSL on a NGINX Website (Ubuntu 16.04 server) that is using Cloudflare
  • Using the Qualys FreeScan Scanner to test your website for online vulnerabilities
  • Beyond SSL with Content Security Policy, Public Key Pinning etc
  • Upgraded to Wordfence Premium to get real-time login defence, malware scanner and two-factor authentication for WordPress logins
  • Run an Ubuntu VM system audit with Lynis
  • Securing Ubuntu in the cloud
  • No matter what server-provider you are using I strongly recommend you have a hot spare ready on a different provider

Code

  • How to code PHP on your localhost and deploy to the cloud via SFTP with PHPStorm by Jet Brains
  • Useful Java FX Code I use in a project using IntelliJ IDEA and jdk1.8.0_161.jdk
  • No matter what server-provider you are using I strongly recommend you have a hot spare ready on a different provider
  • How to setup PHP FPM on demand child workers in PHP 7.x to increase website traffic
  • Installing Android Studio 3 and creating your first Kotlin Android App
  • PHP 7 code to send object oriented sanitised input data via bound parameters to a MYSQL database
  • How to use Sublime Text editor locally to edit code files on a remote server via SSH
  • Creating your first Java FX app and using the Gluon Scene Builder in the IntelliJ IDEA IDE
  • Deploying nodejs apps in the background and monitoring them with PM2 from keymetrics.io

Tech

  • Backing up your computer automatically with BackBlaze software (no data limit)
  • How to back up an iPhone (including photos and videos) multiple ways
  • US v Huawei: The battle for 5G
  • Check the compatibility of your WordPress theme and plugin code with PHP Compatibility Checker
  • Is OSX Mojave on a 2014 MacBook Pro slower or faster than High Sierra
  • Telstra promised Fibre to the house (FTTP) when I had FTTN and this is what happened..
  • The case of the overheating Mac Book Pro and Occam’s Razor
  • Useful Linux Terminal Commands
  • Useful OSX Terminal Commands
  • Useful Linux Terminal Commands
  • What is the difference between 2D, 3D, 360 Video, AR, AR2D, AR3D, MR, VR and HR?
  • Application scalability on a budget (my journey)
  • Monitor server performance with NixStats and receive alerts by SMS, Push, Email, Telegram etc
  • Why I will never buy a new Apple Laptop until they fix the hardware cooling issues.

Wordpress

  • Replacing Google Analytics with Piwik/Matomo for a locally hosted privacy focused open source analytics solution
  • Setting web push notifications in WordPress with OneSignal
  • Telstra promised Fibre to the house (FTTP) when I had FTTN and this is what happened..
  • Check the compatibility of your WordPress theme and plugin code with PHP Compatibility Checker
  • Add two factor auth login protection to WordPress with YubiCo hardware YubiKeys and or 2FA Authenticator App
  • Monitor server performance with NixStats and receive alerts by SMS, Push, Email, Telegram etc
  • Upgraded to Wordfence Premium to get real-time login defence, malware scanner and two-factor authentication for WordPress logins
  • Wordfence Security Plugin for WordPress
  • Speeding up WordPress with the ewww.io ExactDN CDN and Image Compression Plugin
  • Installing and managing WordPress with WP-CLI from the command line on Ubuntu
  • Moving WordPress to a new self managed server away from CPanel
  • Moving WordPress to a new self managed server away from CPanel

General

  • Backing up your computer automatically with BackBlaze software (no data limit)
  • How to back up an iPhone (including photos and videos) multiple ways
  • US v Huawei: The battle for 5G
  • Using the WinSCP Client on Windows to transfer files to and from a Linux server over SFTP
  • Connecting to a server via SSH with Putty
  • Setting web push notifications in WordPress with OneSignal
  • Infographic: So you have an idea for an app
  • Restoring lost files on a Windows FAT, FAT32, NTFS or Linux EXT, Linux XFS volume with iRecover from diydatarecovery.nl
  • Building faster web apps with google tools and exceed user expectations
  • Why I will never buy a new Apple Laptop until they fix the hardware cooling issues.
  • Telstra promised Fibre to the house (FTTP) when I had FTTN and this is what happened..

Copyright © 2023 · News Pro on Genesis Framework · WordPress · Log in

Some ads on this site use cookies. You can opt-out if of local analytics tracking by scrolling to the bottom of the front page or any article and clicking "You are not opted out. Click here to opt out.". Accept Reject Read More
GDPR, Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT