TLF Scripts

These are scripts I use for convenience. Just wanted to share in case they might be useful to someone.

Use at your own risk

I don't change these scripts a lot, as they're generally JUST right for my use-case. This is not a library intended for mass consumption. Rather, it's some useful stuff I've written that might be helpful to others. The release scripts I find particularly useful. But still, use at your own risk. It's not my fault if you mess up your server or something by using these scripts.

Installation

  1. Clone the repo
  2. Add the tlf script to your PATH

Basics

  • all commands start with tlf. Using just tlf defaults to tlf general
  • Each commands directory is a subcommand. The only commands directories are general and release

Release

Scripts for working with a remote server.

  • tlf release setup: Sets up a project to work with the tlf release scripts. Should be executed from a release directory, generally
  • tlf release push: Upload files to remote server
  • tlf release pull: Download files from remote server
  • tlf release ssh: ssh into your remote server
  • tlf release sshkey: Create an ssh key, then upload the public key to your remote server, so you can ssh into your server later without a password

General

Otherwise unorganized scripts. Run via tlf COMMAND or tlf general COMMAND. The shorter version is shown.
You have to make a file at secrets/whatever.bash with your settings (see below).

  • tlf backupdb: backup a local database
  • tlf gitstatus: Check the git status of all sub-directories of the executing directory. Not recursive (I don't think so anyway)
  • tlf phpautoload: Runs my php autoload file to build a global autoloader for my system
  • tlf serverdir: Sets the current directory to your apache group & sets file & directory permissions, among some other things
  • tlf ssh: Helps you load an ssh key. Depends upon git bent]
  • tlf vhost: Adds a virtual host config file pointing to the current directory. Uses dir="/etc/httpd/conf.d/site", so it won't work on Debian systems.

secrets/general.bash

autoload_build_path="/home/user/absolute_path/build-autoload.php"
apache_user="user"
apache_group="apache"
ssh_keys_folder=~/.ssh # This is the "normal" location, but not what I use.