- View
- Edit
- Delete
function dump_db {
/usr/local/mysql/bin/mysqldump -u root -p $1 > $1.sql
}
function dump_db {
/usr/local/mysql/bin/mysqldump -u root -p $1 > $1.sql
}
function browse_history {
cat ~/.bash_history | grep $1
}
#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:
$ 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
Type those commands to change the default user settings. ( I'm saving some time not explaining each one since they are pretty obvious )
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.
One of the biggest craps in the world ( real and internet ) is something called IE 6 ( internet explorer 6 ). Nothing works as expected on that piece of crap. That's why I've decided to contribute to the world helping innocent souls that are using IE6 to change to a real browser or at least upgrade to IE7.
This little drupal module detects the user's browser and redirect to a specified path. At the beginning the idea was just to point ie6 requests to a specific path, but while developing I thought that this could get actually useful.
From time to time i need to put a set of images up on the internet. That's quite an easy task, however, im more lazy than that. I know there are a ton of sites and apps to publish pictures but all of those are a pain in the ass if you don't care that much about the pictures. They ask so many stuff just to upload one picture, title, description, etc... and the worst part is that you pretty much need to upload 1 pic at a time, generally thru a web interface.
Little demo using 3D flash libraries, its just a proof of concept. Maybe ill make this gameable, i just need some time.
Adjusting volume while pressing shift: Silent mode
Adjusting volume while pressing shift and option: Fine-tune volume ( instead of increasing/decreasing block by block )
The way to do this is with 'ssh authentication keys'.
You can find the instructions here:
http://www.extrapepperoni.com/2007/09/23/openssh-on-the-iphone/
Im posting the same instructions without so many letters, if you are new to all this, I strongly recommend that you read the extrapepperoni.com instructions.
so this is what you need to type in your mac (or linux):
# ssh-keygen -t rsa
That creates 2 files (id_rsa and id_rsa.pub) , to be sure it worked type the following command:
# ls ~/.ssh/
The .zip file include a .fla, a .php and a .txt file
You should open all files and change the settings first, then upload the .txt and the .php to the server.
You might want to add a little bit of security in order to block spam.