This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mencoder -idx MOVI0007.avi -ovc copy -oac copy -o mov7.avi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:if(document.URL.indexOf('XDEBUG_PROFILE')<1){var%20sep=document.URL.indexOf('?');sep%20=%20(sep<1)?'?':'&';window.location.href=document.URL+sep+'XDEBUG_PROFILE';} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install couchDB | |
| sudo apt-get install couchdb | |
| # If using Ubuntu < 11 you need a more recent version of couchdb (+1.0) | |
| sudo apt-add-repository ppa:ubuntuone/stable | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| # Method A: Install using python | |
| sudo apt-get install python-setuptools |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Import SQL file (those too big for phpMyAdmin | |
| mysql -u username -p -h localhost database-name < data.sql | |
| # Copy data from one table schema to another (useful when structure is similar between tables) | |
| INSERT INTO table1 ( `username`, `email`, `password`, `firstname`, `lastname`, `created`) | |
| SELECT `username`, `email`, `password`, `firstname`, `lastname`, UNIX_TIMESTAMP() FROM table2 | |
| # Make sure you set the RIGHT host when you create a new user (127.0.0.1 vs localhost vs an IP vs "%") | |
| # Create new User and give them access to database |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class o | |
| { | |
| private $o; | |
| // Get value | |
| public function __get($k){return isset($this->o[$k])?$this->o[$k]:NULL;} | |
| // Create or Get value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Return an array of locales based on HTTP "Accept-Language" header. | |
| * | |
| * @return array | |
| */ | |
| function accept_languages() | |
| { | |
| if(preg_match_all('/[\-a-z]{2,}/i', getenv('HTTP_ACCEPT_LANGUAGE'), $matches)) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // chmod only files (leaving directories as-is) | |
| find . -type f -exec chmod 644 {} \; | |
| // CHMOD only directories (leave files as-is) | |
| find . -type d -exec chmod 755 {} \; | |
| // Convert a folder of PSD images to PNG (or JPG) previews (requires ImageMagick to be installed) | |
| convert *.psd[0] -set filename:orig %t %[filename:orig].png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # To check if a directory exists in a bash shell script you can use the following: | |
| if [ -d "$DIRECTORY" ]; then | |
| # Control will enter here if $DIRECTORY exists | |
| fi | |
| # Or to check if a directory doesn't exist: | |
| if [ ! -d "$DIRECTORY" ]; then | |
| # Control will enter here if $DIRECTORY doesn't exist | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| We need to setup Postfix | |
| vim /etc/hostname | |
| vim /etc/hosts | |
| [ | |
| apt-get install dnsutils | |
| dig -x 111.111.111.111 | |
| ] or [ | |
| host 173.255.192.25 | |
| ] or [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # install postgresql | |
| $ sudo apt-get install postgresql | |
| # Login as postgres user | |
| $ sudo -u postgres psql postgres | |
| # Set a password for the "postgres" database role using the command: | |
| $ \password postgres | |
| # Creating a new PostgreSQL user |