Showing posts with label mac. Show all posts
Showing posts with label mac. Show all posts

Friday, 10 January 2014

Showing hidden folders in Mac 10.9.1

To show hidden folders in finder, for me this worked...

defaults write com.apple.finder AppleShowAllFiles -boolean true

and to undo... 

defaults delete com.apple.finder AppleShowAllFiles

  • Open a terminal window and run...
  • defaults write com.apple.finder AppleShowAllFiles -boolean true
  • Now hold ‘alt’ on the keyboard and right click on the Finder icon and click on Relaunch (or run killall Finder in the terminal)

If that doesn't work try the above with... (undo with NO or FALSE respectively)

defaults write com.apple.Finder AppleShowAllFiles YES

or 

defaults write com.apple.Finder AppleShowAllFiles TRUE


Or if you just want to open a file, using the application's 'Open File' function (e.g. Sublime text 2). Press Command – Shift – [full stop] and all hidden files/folders will become visible, only in the Open File window, very handy!

Saturday, 16 March 2013

Adding a virtual host on mac

Quickly adding a virtual host on mac (10.6) assuming your adding the host name "test".
  1. Add your host name to your hosts file
    • Open a terminal and type: sudo nano /etc/hosts
    • Add "127.0.0.1 test" to the bottom of your hosts file, without the quotes.
  2. Enable apache vhosts file
    • open your httpd.conf 
    • in a terminal type: cd /private/etc/apache2
    • then: sudo nano httpd.conf 
    • find the line #Include /private/etc/apache2/extra/httpd-vhosts.conf
    • remove the # at the beginning of the line (if it has one, if not, your good to go)
  3. Add the folder you want the host to reference to the httpd-vhost.conf file
    • back in the terminal: cd extra
    • then: sudo nano httpd-vhosts.conf 
    • add the following to the bottom of the file, changing the DocumentRoot, directory paths and log file names appropriately.
    • <VirtualHost *:80>
          ServerAdmin webmaster@dummy-host2.example.com
          DocumentRoot "/User/patrickc/www/test"
          ServerName test
          ErrorLog "/private/var/log/apache2/test-error.log"
          CustomLog "/private/var/log/apache2/test-access.log" common
          <directory "/User/patrickc/www/test/">
             Options Indexes FollowSymLinks
             AllowOverride All
             Order allow,deny
             Allow from all
          </directory>
      </VirtualHost>
          
  4. Restart apache
    • in your terminal; sudo apachectl restart (on some setups it might be; sudo apache restart)
  5. Then open a browser and type http://test
  6. That should be it, if you get a permissions error check the value in  <directory  />


 

Note: the opinions on this page don't represent that of my employer in anyway. And, actually only vaguely represent my opinions on the date of publication. (Unlike Ms T, I am very much for turning)