Categories
Tags
Category Archives: Snippets
MySQL command line cheat sheet
Selecting a database Listing databases Listing tables in a db Describing the format of a table Creating a database Creating a table Inserting one row at a time Retrieving information (general) Fixing all records with a certain value Retrieving unique output records Sorting Date calculations MONTH(some_date) extracts the month value and DAYOFMONTH() extracts day. Pattern […]
Symbolic Links
Symbolic links come in real handy when you need to create multiple paths to the same directory. Why would you need to do this? Dependencies are one great reason. Let’s say you install a new package that needs to be configured to point to another library, and let’s suppose that library gets updated, and let’s […]
Delete files and directories recursively
Be careful with this one! The -r flag means it’s recursive, the f suppresses the need to confirm every file deletion.
Securely copy folders between UNIX Machines
You will be prompted for a password after issuing this command.
Zip files or directories
Replace filename with the name you want to give the zip file. The .zip extension is automatically appended to the end of the filename. Replace inputfile1 and inputfile2 with the names of the files you wish to include in the zip archive. You can include any number of files here, or you may use an […]
.htacces Redirects
Most of the below culled from stupid .htaccess tricks Rewrite URL to always include the www and redirect multiple doamins to one Aways remove the www Redirect old files and folders to new