How to remove a non-empty directory tree
Linux, Mac, Python No Comments »simple…i know, but you’d be surprised how many ppl don’t know this.
Terminal:
$ rm -rf directory
Python:
>>> shutil.rmtree("/some/dir")
can definitely come in handy
simple…i know, but you’d be surprised how many ppl don’t know this.
Terminal:
$ rm -rf directory
Python:
>>> shutil.rmtree("/some/dir")
can definitely come in handy
First Enable Apache:
Then edit httpd.conf
#LoadModule php4_module
#AddModule mod_php4.c
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php-source .phps
Download and install MySQL for the Mac (10.3, 10.4, etc)
$ sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
$ mysql -u root mysql
> update user set Password=password('NewPw‘) where User=’root’;
> flush privileges;
How to fix Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’
Apparently, OS X Tiger doesn’t allow for PHP MySQL connection out of the box. You get this: Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’
/etc/php.ini(.default) looks for mysql.sock in the wrong place… two options are to make a symbolic link from the right place to the socket…
$ sudo mkdir /var/mysql
$ sudo ln -s /private/tmp/mysql.sock /var/mysql/mysql.sock
Or you can update your php.ini (.default) by finding “mysql.default_socket” and setting it to equal /private/tmp/mysql.sock and then restart apache with “apachectl graceful“