About sable

Mastering the visual space helps me assess the physical space. Time is my canvas. With pictures, it's only a moment - a slice - of that time.

Password Protect Your Development Folder

We can use sim­ple pass­word pro­tec­tion to keep users from see­ing your lat­est devel­op­ment on the web until you are ready. By using the .htaccess file in the folder we want to pass­word pro­tect and an .htpasswd file out­side of the /public_html/ folder to spec­ify the users we will be able to lock out the pub­lic until our theme / project / site / etc. is complete.

This is a very sim­ple and easy solu­tion when you want to give access to your entire devel­op­ment envi­ron­ment (new theme, new web­site, etc.) to a client or colleague.

Cre­ate An Access List

Use SSH to remotely access your web­site and nav­i­gate to your home direc­tory. The .htpasswd file can be any­where on your web direc­tory but should not be in the public_html folder.

cd ~/
pwd

wpid-2012-02-22_11-30-56-2012-02-22-11-25.png

Use the htpasswd com­mand to cre­ate the .htpasswd file and add a user ‘guest’.

htpasswd -c .htpasswd guest

wpid-2012-02-22_11-33-58-2012-02-22-11-25.png

Enter the pass­word twice. You can see the con­tents of the new file by using this command

cat .htpasswd

wpid-2012-02-22_11-35-16-2012-02-22-11-25.png

Autho­rized users will be added to this file. If you want more than one user use the htpasswd com­mand with­out the “-c”.

htpasswd .htpasswd guest2

wpid-1__@__2012-02-22_11-35-16-2012-02-22-11-25.png

Pass­word Pro­tect a Folder (directory).

Open your code edi­tor and go to the folder you want to pass­word pro­tect (or cre­ate a new folder). I have cre­ated a folder named ‘solitude’.

Cre­ate a file called .htaccess and enter your infor­ma­tion in this for­mat. Note that this file is inside the folder you want to pass­word pro­tect. If this file is in your public_html folder then your entire web­site will be pass­word protected.

AuthName "Members Area"
AuthType Basic
AuthUserFile /path/to/your/.htpasswd
Require valid-user

If you don’t have any pages in the direc­tory yet try adding a sin­gle index.html page with “Hello World” or some other such text.

To test the secu­rity out open your browser to yourdomain.com/solitude and you should be prompted for a user­name and password.

wpid-2012-02-22_11-45-19-2012-02-22-11-25.png

Upon suc­cess­fully typ­ing in your cre­den­tials you should be in and be able to see your con­tent. In this case, the index.html will display.

wpid-2012-02-22_11-45-45-2012-02-22-11-25.png

Get the Latest WordPress.org Release Code Using the Terminal

Use the ter­mi­nal to quickly grab the most up-to-date sta­ble ver­sion of Word­Press with curl.

Open Terminal.app.

curl -O http://wordpress.org/latest.tar.gz

When the down­load is com­plete (latest.tar.gz) extract it to the folder of your choice.

tar xzvf latest.tar.gz wordpress/

Note: If you are using ssh to access a remote linux server you can use wget.

Lion Terminal — Organizing Those Windows

You and I tend to keep a lot of ter­mi­nal win­dows open at any given time. Mul­ti­ple remote ses­sions, sys­log tails run­ning, top and htop, vim, bwm-ng, splunk search, apache http requests, man pages, grep, you name it — it’s all open for us. We will even leave this win­dows open for days, weeks, or in some cases months! (I once left a splunk real­time search open for 22 days before the ubuntu box crashed!)

Here’s a lit­tle trick I use to keep things orga­nized. Open the ter­mi­nal and run the com­mand you are mon­i­tor­ing. While the ter­mi­nal still has focus hit Com­mand + I to “get info” on the win­dow. Change the title and the color scheme for each win­dow to dif­fer­en­ti­ate. You can also save the set to call up later. I always pulled up the same four con­trollers simul­ta­ne­ously (not this exam­ple) so I saved a win­dow group for it.

What’s run­ning?

  • iostat
    while true; do iostat -w 2; done
  • date & cal
    while true; do clear; date ; echo ; cal; sleep 2; done
  • top
    top -u -s 2
  • man screen

The “Abortion Plex” and Critical Thinking

Every­thing you read on the inter­net is true right? Are wikipedia arti­cles a reli­able source for pri­mary research?

I wasn’t fol­low­ing Con­gress­man John Flem­ing or this story on the onion at all. But the site “Lit­er­ally Unbe­liev­able”, which tracks Face­book post­ings of The Onion arti­cles, found that the con­gress­man from Louisiana had posted a story from The Onion on his Wall.

from literally unbelievable

Brett Smi­ley wrote this up at nymag.com - which is what took me down the rab­bit hole.

Satire got the best of unsus­pect­ing or fac­tu­ally impaired Repub­li­can Con­gress­man John Flem­ing of Louisiana this past Friday.

The Onion’s Abor­tion Plex satire piece ran last May.

TOPEKA, KS — Planned Par­ent­hood announced Tues­day the grand open­ing of its long-planned $8 bil­lion Abor­tion­plex, a sprawl­ing abor­tion facil­ity that will allow the orga­ni­za­tion to ter­mi­nate unborn lives with an effi­ciency never before thought possible.

The con­ver­sa­tion about trust­ing online sources seems to come up fre­quently and I am a fan of gath­er­ing all the infor­ma­tion pos­si­ble and then con­sid­er­ing the sources. I often go to wikipedia and then look at the ref­er­ence sources. I guess not every­one does this.

To be fair, it can be hard to tell between a joke and a fact. Just look at all these Yelp reviews about the clinic.

I also got the groupon for the Abor­tion­plex and over­all my expe­ri­ence was fine. The clinic was fast and ser­vice was friendly and effi­cient but they seemed a lit­tle ruder towards me (I think) because I had a groupon.

There is a les­son here …

Update added 2/15:

The Onion is not a hoax web­site, it’s satire, there’s a long tra­di­tion of satire that goes back thou­sands of years, but some peo­ple are stu­pid — it’s a diverse soci­ety in every way,” - Baratunde Thurston