Scroll bar not working on Mountain Lion Mac? Or am I crazy? Cant find scroll bars on my new mac

Yea, it is weird. I know the the safari page has long to be scrolled but I was not able to damn scroll it :)
Then this behavior was duplicated when I tried to do some stuff on the other windows as well..
Hehehee.. Apple has made the scroll bars AuToMaTiCaLlY for us :(
I have been reading this book regarding UX stuff, it is a good read.
One thing mentioned on that one is consistency of UX designs – in other words you don’t want to surprise your existing users with something that has been there kind of thing.
I might sound silly here by mentioning this and you might say “what the heck, it is not a big deal”
But, for me, I like my scroll bars and I have returned them – thanks to them they have allowed us configure it
To configure it
1. Go to system preferences
2. Be on the Personal/General
3. Select show always option from the scroll bar options.

Scroll it BABY!

Enabling PHP in Mac Mountain Lion

I have been using snow leopard and recently I got a new mac with mountain Lion. As a PHPer the first thing I was doing was to install php+mysql and I have found it much easier

here is how to enable apache for PHP:

1. go to terminal, click the launch icon from dock and you will find it in the utilities, and do
apachectrl start – you need a sudo access for this
2. Go to system preferences -> internet and wireless -> sharing and check web sharing
3. Now, go to http://localhost and verify the it works is there.
4. Then being on your editor, go to /etc/apache2 and open httpd.conf file. Then look for php5_module and uncomment that line.
5. You are done. For testing, go to /Library/Webserver/Documents/ and add a php file named phpinfo.php with content of phpinfo(); and access it from http://localhost/phpinfo.php

Happy PHP

Adding user to sudoers in Mac

Working on mac, you might find something the sudo not working as expected or something.
Specially, if you are installing to ‘somehow’ restricted folders like /usr/local/bin ..
Here is what you can do to have an sudo access:
First check the group wheel (mostly) by running the following command

ls -la /private/etc/sudoers 

This shall produce something: -r–r—– 1 root wheel 1242 Jun 22 2009 /private/etc/sudoers
This will tell you the sudoers should be in the wheel group

Then check in what group the user currently is using

id 

From the listed groups, if wheel is not listed then add it

sudo dscl . -append /Groups/wheel GroupMembership 

-_-

SSH without password not working: mac to ubuntu

if you are doing a lot of server activities, then you are a friend of SSH.
One thing we would do would be to make ssh password-less..
I am trying to log into ubuntu server from mac client. here is the process.

on the MAC,
1. Make sure you have ssh installed. You can check using

which ssh or
ssh -v : this will tell the version

If for some reason it is not installed or if you want to upgrade it, you can install it using mac port – this would be another discussion but the overall stuff would be

$ sudo port -d selfupdate
$ sudo port install openssh

2. Now, create public/private keys using the following command

ssh-keygen -t rsa

you will find these keys in the ~/.ssh folder
This would be much you would do on the client side

On the server (ubuntu server)
1. Create the user on the server using adduser command. Let’s create user macuser

adduser macuser

then follow the instruction to create the user.
2. Go to /etc/ssh/ and update the sshd_config file
Most of the settings of this file would be responsible for the famous problem of asking the password all the time..
3. in the sshd_config file update the following:

StrictModes no
RSAAuthentication yes
PubkeyAuthentication yes
PasswordAuthentication yes

AuthorizedKeysFile      %h/.ssh/authorized_keys

After this restart the ssh using

sudo service ssh restart

Now go back to the mac client and copy the public keys to the server as follows

ssh-copy-id macuser@ubuntuServerOrIP-goes-here

here you will be asked for your password. Give the password you assigned while creating the user on the server.

Then log into the server using

ssh macuser@ubuntuServerOrIP-goes-here

if it is still asking for the password check the following

1. on the ubuntu server go to the ~/.ssh/authorized_keys and see if the public key of mac is registered
2. Check the folder’s permission level is 700 and that of autorized_keys is 600
3. Check the above setting of sshd_config file are saved and restart the ssh on the server

How to View WIFI password in Mac

Here is step by step way to see the wifi password on your mac. It is customary to usually forget the wifi password and, of course, seeking it for our other gadget.

1. Go to Applications folder – it sits the far right of the dock [if you have the default setting of the dock]
2. Go to Utilities
3. Open Keychain Access
4. You would see the name of the wifi on the list – open it. You can open it by doulbe clicking on it or just select and hit enter.
5. On the opened window, there is a show password checkbox. When you click on the checkbox to select it, you would be provided with another window asking you your administrator password.
6. Enter your password and hit enter. You will see your wifi password next to the show password checkbox.

Happy Passwording…

localhost shows 403 forbidden in snow leopard mac

In mac, to set up your apache all you have to do is:
Go to terminal and type

sudo apachectl start

– you can get the terminal by going to Application folder and then to utilities and by clicking terminal.

Then go to your browser and type http://localhost.

Now if you get the error 403 forbidden then:
Open /etc/apache2/extra/httpd-vhosts.conf file and make sure you have proper directory setting for example:


    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "/Library/WebServer/Documents"
    ServerName local.com
    ErrorLog "/private/var/log/apache2/local.com-error_log"
    CustomLog "/private/var/log/apache2/local_access_log" common

In the above example, the document root is in Library/WebServer/Documents. Which means if I want to create a website, then the website folder has to be inside that and will be accessd as http://local.com/website

**if you name server as localhost, then you can access it as http://localhost

Finally, check if hosts file has correct ip-servername mapping by looking into the file /etc/hosts
Then reload your apache

sudo apachectl restart

EnJoY!

Newer version of mysql exists error while installing on Mac OS

I was reinstalling my mac machine and wanted to install my goodies [PHP, Apache, MySQL] on it and I come up with the newer version error when i try to install mysql.
here is what I gather from different sites and blogs:
Go to the terminal and issue these commands
sudo rm /usr/local/mysql*
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm /etc/my.cnf
sudo rm -rf /var/db/receipts/com.mysql.*

This has taken care of the error for me