My Notes and Thoughts

I blog about WordPress, web technologies and website performance.

photo by Jeff Sheldon

Quickly batch install Mac Apps with Bash

OSX, Tools

GetMacApps is a great little website that lets you build a custom bash script that lets you automate installing your favourite apps as easily as pasting a single line of code into the terminal window.

You can preview my chosen apps by following this link: My install manifest

or create your own at http://www.getmacapps.com/

If you want to view see the bash script the site generate you can view it here:

http://www.getmacapps.com/raw/embvawlksr2p

And in finally to use just paste the following line of text into your terminal:
N.B. the link below installs the apps I want and regularly used, you’re probably going to want to create your own..

curl -s http://www.getmacapps.com/raw/embvawlksr2p | sh

Source :

Useful Bash Aliases for GIT

Linux, OSX, Tools

Switching from SVN to GIT can be awkward especially if your used to SVN shortcuts like
svn co for svn checkout and
svn up for svn update

the solution is these nifty terminal aliases.

git status, git add, git commit, and git checkout are such common commands that it is useful to have abbreviations for them.

alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gca='git commit -a'
alias gd='git diff'
alias go='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
alias gp='git pull'
alias push='git push'
alias gr='git rebase '
alias gm='git merge '

alias got='git '
alias get='git '

Source(s):

Downloading WordPress minus the content directory.

tip, WordPress

The default version of WordPress comes with an entire content directory full stuff you probably don’t want or need like the default themes and the hellodolly.php plugin unless your setting you your site for the very first time, even then probably not.

There is however a well hidden version of WordPress that comes minus a content directory, it’s purpose is to optimise WordPress’ auto update function, if you click the update WordPress button in the dashboard and watch carefully you’ll see a url similar to this flash up on your screen:

https://wordpress.org/wordpress-3.8.1-no-content.zip

simply substitute '3.8.1' with the version you require.

This is really handy if you’re managing your site with SVN or GIT or Composer and want to reduce the amount of clutter and extra files you download.

WordPress AutoUpdate fix for Version Controlled Sites

WordPress

So.. since version 3.7 WordPress has had a neat auto-update function, unfortunately WordPress is also quite cautious so it check to see if the website is using any kind of Version Control and if so disables the auto update function.  BUT what if your using version control but not to actually manage what version of WordPress is installed.

Luckally this line of code will override the “under version control” test of the autoupdate

“`php

<span class="ace_identifier">add_filter</span>( <span class="ace_string">'automatic_updates_is_vcs_checkout'</span>, <span class="ace_string">'__return_false'</span> );

“`

re-enabling the auto-update functionality.

Source:

How to use TAR and GZIP

Linux, OSX, tip, Tools

I’ve been doing a lot of server maintenance recently and have found myself having to archive and transfer file to and from different server, as a result I’m continually looking at the man page for TAR trying to figure out which exact flags to use in each situation.

See the guide below for a quick 101:

How to TAR a Directory

  • -z: Compress archive using gzip program
  • -c: Create archive
  • -v: Verbose i.e display progress while creating archive
  • -f: Archive File name

For example, you have directory called /home/jerry/prog and you would like to compress this directory then you can type tar command as follows:

$ tar -zcvf prog-1-jan-2005.tar.gz /home/jerry/prog

Above command will create an archive file called prog-1-jan-2005.tar.gz in current directory.

NB. the -v flag “Verbose” is optional  and prints a list of each item added or extracted to the console.

How to Extract a TAR

If you wish to restore your archive then you need to use following command (it will extract all files in current directory):

$ tar -zxvf prog-1-jan-2005.tar.gz

Where,

  • -x: Extract files

If you wish to extract files in particular directory, for example in /tmp then you need to use following command:

$ tar -zxvf prog-1-jan-2005.tar.gz -C /tmp
$ cd /tmp
$ ls -

Source(s)

I can’t remember the exact source of this example but its been used and reused all over the web.. here’s a few places it maybe from:

 

Digging into WordPress

WordPress

Written by WordPress veterans Chris Coyier and Jeff Starr, Digging Into WordPress is 400+ jam-packed pages of everything you need to get the most out of WordPress.

This is a great book if you just starting out with WordPress, it covers the basics of building and maintaining your own WordPress website all the way through some quite advanced topics.

Click here to buy : Digging Into WordPress.

Joomla – MVC Tutorial Part 4

Joomla, Tutorials

This is the fourth and final part of a MVC tutorial for Joomla that I relied heavily on whilst working with J00mla! and it went off line so I saved it for prosperity and personal gain…

Continue reading …