Posts tagged with “command-line

Securely transferring files between hosts with SCP

scp (or “secure copy“) is a method of securely transferring files between two hosts. Unlike wget, the files to be transferred do not need to be publicly accessible via either HTTP or FTP. To put it another way, ssh + cp = scp. Some caveats: You must specify a target file. If you don’t, scp […]

What to do when “Another update is already in progress”

You’re right in the middle of updating your install of WordPress to the latest version when suddenly there’s a solar flare! — and everything stops. When you reload the Updates page, instead of the expected blue “Update Now” button, there are these words: Another update is already in progress. Huh? You check the front end […]

Searching for world-writable files and directories from the command-line

World-writable permissions are the equivalent of an unlocked door. They require trust and nothing online should bear the weight of that expectation. Why are they so bad? World-writable permissions are also commonly referred to by their binary equivalent of “777”, for which the digits represents the permission level for each of the three possible users: […]

Generating a password-protected archive

Generating an archive file from either a file or directory is a cinch using the command-line. Here’s the structure: zip [options] [archive name] [file or folder to be archived] While there are many options available, the one we’re interested in is -e, for “encrypted”, like so: zip -e example.txt To create a password-protected archive […]

Showing all files in the Finder

By default the Finder only displays visible files and public directories. This excludes any files that begin with a period (such as .htaccess or .htpasswd) as well as any non-public directories, such as /private/etc/ (containing useful files like hosts) or /usr/local/Cellar, where Homebrew-managed packages are installed. One can easily access all of these files and […]

Simplifying SSH connections using SSH config

Using SSH to connect to a remote server is as simple as remembering the details: username, host, and password, plus any connection-specific quirks, like non-standard port. That said, the more remote servers to which you need to connect on a regular basis—each with its own access configuration—the more complicated a task it can become to […]

Configuring SSH to use a public / private key pair instead of a password

Sick of passwords? Simplify your life by configuring your SSH connection to use a public / private key pair instead. Before you get started, confirm you have SSH access to the remote server, as you’ll need it shortly. Generate the public / private key pair via the command-line: ssh-keygen -t rsa -b 4096 The -t […]

Installing and using Composer

Composer is a dependency-management tool for PHP. It installs and keeps current all library dependencies for a given project. It does so recursively, so not only does it manage all direct dependencies but any dependencies those dependencies have, and so on, and so forth, ad infinitum, ad nauseum. It’s becoming more popular as an installation […]

The Gzip Basics

Gzip is data compression software used to compress a file into an archive, as well as expand an already-compressed archive back into a file. One common use for gzip is to compress a tarball. [One could use Zip both to collapse and compress a directory, instead of tar / gzip, but the compression isn’t as […]

Breaking out of the ZIP-CPGZ loop

I receive a lot of compressed archives, from a wide variety of different users. Those who prefer the command-line (usually other developers) will TAR the directory then GZIP the TAR. Most users are more comfortable with a GUI for archiving and wind up sending a ZIP file. With those it’s usually a quick double-click and […]