mac

Add Hosts entry and apache vhost

  • View
  • Edit
  • Delete
Situation: 
Working with drupal locally might be a little bit annoying with the domain issues it can have. thats why a good option ( working with multiple installations ) is to create different host entries and create a vhost for each entry.


#Register a host in /etc/hosts
function register_host {
echo "127.0.0.1 $1.site" | sudo tee -a /etc/hosts
add_vhost $1 $2 $3 | sudo tee -a /etc/apache2/extra/httpd-vhosts.conf
sudo apachectl restart
}


function add_vhost {
echo "
#$3
<VirtualHost *:80>
ServerName $1.site
DocumentRoot /Users/webalab/$2
ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log common"
</VirtualHost>"
}

Usage:


Basic Functionality

  • View
  • Edit
  • Delete
Situation: 
The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system.

$ sudo port selfupdate : Updates the macport's app list.
$ port list : List All packages
$ port search kwd : Search "kwd" in the packages list
$ port info pkg: Retrieve information about the pkg
$ port deps pkg: Show the dependencies of a pkg
$ port variants pkg : Show pkg variants
$ sudo port instal pkg: Install pkg
$ port clean --all pkg: Clean all the mess done by the app installation whatsoever
$ port uninstall pkg: Uninstal pkg


Change personal data

  • View
  • Edit
  • Delete
Situation: 
When using irssi (command line irc client) by default it grabs all your personal data and displays it in the server.

From The irssi Startup HOWTO

Type those commands to change the default user settings. ( I'm saving some time not explaining each one since they are pretty obvious )

  • /SET nick [Your nick name]
  • /SET alternate_nick [Your alternate nick]
  • /SET user_name [Your username] if you have ident enabled this doesn't affect anything
  • /SET real_name [Your real name]

Empty trash without questions asked

  • View
  • Edit
  • Delete
Situation: 
Deleting your trash is a fairly easy task, however there are some files that are a little bit painful to deal with while emptying your trash. Can be something related to permissions or just a billion of annoying "are you sure" questions.

Right-click the trash icon and hold down alt/opt key while clicking "Empty Trash". This will empty the trash no matter whats inside and without prompting annoying dialogs whatsoever.


Fine tune the volume

  • View
  • Edit
  • Delete
Situation: 
Changing up or down the volume with the keyboard shortcut will change the volume one whole block

Adjusting volume while pressing shift: Silent mode
Adjusting volume while pressing shift and option: Fine-tune volume ( instead of increasing/decreasing block by block )


Powered by Drupal, an open source content management system