Linux

Web Developer Workflow: More Useful Linux Bash Aliases

More Bash Alias fun. This time we'll look at Git, Drush and a few others.

Intro

This is a followup to another recent post discussing bash aliases meant to make your web-developer life easier. If this is your first Tango with Bash Aliases, head to that post for an intro to working with aliases. Otherwise--the list goes on!

Bash: A Simple Script for Checking out New Git Branches

I'm feeling particularly nerdy today and I had a little extra time in my schedule. I recently discussed the utility of Bash Aliases; today, I decided go a step further and put together a Bash Script that allows me to build on that power even more. A Bash Script is basically an Alias on steroids, and if you've had any experience with PHP or JavaScript, there's a lot of overlap. Put on your nerd glasses and let's have a look.

Background - Repetitive Processes w/ Git

You may or may not find this script particularly useful--this post is really about the power of bash scripts to help manage workflow. I do, however, find myself checking out new Git branches somewhat frequently. So, with the extra time in my schedule, I decided to have a little fun and see if I could automate some of that Git workflow with a simple script. Checking out a branch with git isn't a particularly complicated process: git checkout -b <branchname>.

Relative Symlinks for Removable Media/Devices

Symlinks can be a useful and sometimes necessary part of working on the command line. They're often used with absolute paths, extending from either root directories or your user folder. If you're working on a removable disk, however, absolute paths might change depending on which user has the disk mounted. In this case, using relative paths for you symlinks is a great way to ensure they work regardless of who mounts them. Here's a look at how this can be done.

If you've ever used removable devices across multiple user profiles, you might have noticed that, once mounted, the path to the drive changes depending on user. Here's a quick example: suppose I have two users/profiles on a computer and one removable disk named "Extras". For each user, once the disk is mounted, the path to the disk would vary--like this:

Web Developer Workflow: Useful Linux Bash Aliases

If you spend a lot of time on the command line, like I do, an important part of your workflow is getting things done both quickly and efficiently. Bash aliases can be extremely helpful in saving you time. This isn't a comprehensive list by any means, but hopefully it serves as a starting point--allowing you to optimize your terminal-based development work.

Intro

I recently talked about bash aliases for managing XAMPP more efficiently. Here are a few more fun ways you can optimize your development workflow on the command-line using aliases. None of this is rocket science, by any measure. Still, if you're new to bash aliases this brief article will hopefully act as an introduction to a new way of using the command-line (and a new way of thinking about workflow, hopefully).

Launch Xampp from Linux Command Line -- The Easy Way

Quick and easy ways to Launch XAMPP from the command line with aliases.

Start & Stop -- The Easy Way!

You've installed XAMPP for Linux! Congratulations! Now that it's installed, how do you get it running? ApacheFriends has you covered for the basics, of course, but their methods make use of the command line, and aren't exactly efficient in terms of keystrokes.

If all you need to do is get services (Apache, MySQL, ProFTPD) started or stopped, ApacheFriends suggests you use the following:

Ubuntu: Déjà Dup Backup Failed to Execute Child Process

It's just the way of Linux, especially on legacy hardware: every now and then you screw things up beyond repair--like when you change graphics drivers and can no longer access a login screen. I recently got myself in a pinch and, after hitting my head against a wall for several hours, decided that I'd look at reinstalling Ubuntu and restoring from a Duplicity/Deja Dup backup. Unfortunately, my first attempts to restore the backup presented me with an error that seems to be somewhat common. The fix, as often seems to be the case, was a simple permissions change.

Background

I should know better than to mess with drivers on my old Mac Pro -- the hardware is finicky at best. Out of curiosity, though, I decided the other day to switch to an Nvidia driver. Big mistake!--I soon found myself unable to get to the login screen, and attempts to even get into the command line weren't particularly fruitful (an issue, I suspect, with the boot disk being encrypted).

Raspberry Pi 4 -- Yes, You Can Use it for Web Development

It'll take a while for you to optimize your Pi 4, but the answer is a definitive "YES"--you can manage a development workflow on it. The real question is, do you want to?

Background

One of the big concerns with the Raspberry Pi 4 as a daily driver is, of course, whether the hardware can handle the comparable workload of a desktop computer. I've already touched lightly on overclocking the Pi and optimizing a boot disk. The final question is whether the little SBC actually has enough software support to be productive--in any effective sense.

Hardware: Raspberry Pi 4 Boot Disk Optimization

I recently looked at my 2008 Mac Pro to optimize it's startup disk; today let's have a look at the Raspberry Pi 4 to see what kind of setup provides the fastest read speed on it's boot disk. We can take it for granted that the Pi 4's USB3 port will provide better throughput than the on-board microSD reader; I've seen people using different USB3 peripherals for their boot disks, though. Today, I'll have a look at how a USB3 flash drive performs against a 2.5" solid state.

Quick Background

I previously posted on the feasibility of the Raspberry Pi 4 as a desktop computer--particularly in regard to whether it could handle my web-development workflow; there are really three major issues at stake with regard to whether the Pi 4 can pull it off:

Ubuntu: Disk Permissions & Multiple User Profiles

This is probably a no-brainer for advanced Linux users, but for newbies it may strike as awkaward that if you create/partition a disk with one user on your computer, another user won't automatically have "access" to it. This is a good opportunity to revisit the function of permissions in Linux--a quick review of Users and Groups.

TL;DR

When creating a partition, the "Disks" application/utility sets permissions to 700 by default (read/write/execute access for the disk owner only). You'll want to change that if you've got multiple users who need to access the disk on your computer. I'll discuss solutions below.

Hardware: Optimizing Startup Disk Throughput on Linux -- SATA vs PCIe

Okay... BIG qualifier here: this post pertains to a 2008 Mac Pro running Ubuntu 18.04.5 LTS. If you're expecting some sort of cutting edge hardware review, this isn't it. However, I fetishize old computers and my 2008 Mac Pro holds well enough against contemporary computers that it can handle just about anything I throw at it as a web-developer in 2021. This computer has been an ongoing project, and I enjoy tweaking it here and there to see just how well it can keep up. I recently purchased some PCIe cards (adapters, really) to run hard-disks on, and in this post I'd like to casually review which card, which drive, and which connection gets me the best performance. I'll also discuss what kinds of tools on Ubuntu/Linux help me assess this.

Background

Now, technically speaking, most of the information in this review could easily be found in product descriptions. Product descriptions, however, aren't always what they're cut out to be. I really prefer not to take it for granted that the maximum throughput listed on a product is the same as what you'll get on your own computer. It seems like there are enough variables in data throughput (reading and writing hard disks) that use-case is inevitably a factor. If my testing turns out to be redundant, that's fine.