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
wget -A gif,jpeg,jpg -r --random-wait -t 5 -T 20 -nc -m -p -E -k -K -H http://www.website.com/ |
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
#!/bin/bash | |
# First up let's create the save path if it doesn't exist | |
LOCAL_PATH=~ | |
SAVE_PATH="$LOCAL_PATH/downloaded_sites" | |
# Next we need to sanitize our input. We want the user to be able to add | |
# naturally formated URLs, this means we need to be able to accept: | |
# http://www.somedomain.com | |
# www.somedomain.com | |
# somedomain.com | |
# If the user does not supply www. we should not assume www. we should accept the |
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
10 23 * * * /usr/local/mysql/bin/mysqldump --add-drop-table -u My_User_Name -pSuperDuperPassword myAwesomDB > "/path/to/database_backups/myAwesomDB_"`date +\%u`.sql |
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
# First install PhantomJS | |
cd /usr/local/share | |
sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 | |
sudo tar jxvf phantomjs-1.9.7-linux-x86_64.tar.bz2 | |
sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64 /usr/local/share/phantomjs | |
sudo ln -s /usr/local/share/phantomjs/bin/phantomjs /usr/local/bin/phantomjs | |
# Test that PhantomJS is installed and working | |
which phantomjs | |
# should produce: |
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
sudo apt-get update | |
sudo apt-get install -y python-software-properties python g++ make | |
sudo add-apt-repository -y ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get install nodejs |
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
# 1. Install Apache | |
sudo apt-get -y install apache2 | |
# 2. Install MySQL, you'll be asked for a root password | |
sudo apt-get -y install mysql-server mysql-client | |
# 2.1. the next step is optional, but it tidies things up and secures your db installation | |
sudo mysql_secure_installation | |
# 3. Install PHP | |
sudo apt-get -y install php5 libapache2-mod-php5 php-pear php5-cli php5-mysql php-apc php5-adodb php5-imagick php5-gd php5-mcrypt php5-memcache php5-memcached php5-curl php5-dev |
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 | |
function get_taxonomy_content($tid, $limit = 10) { | |
/** | |
A note on variables: | |
field_data_field_article_rating --- this is the name of taxonomy table you're referring to | |
field_article_rating_tid --- this is the name of the term ID column in the table above | |
**/ | |
$out = array(); |
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 | |
$my_page_type = 'php_news'; | |
$parent_path = '/languages/php/news'; | |
$hide_from_nav = TRUE; | |
$parent = Page::getByPath($parent_path); | |
/** | |
* Let's pretend the title and description have been set by POST values | |
* and added to the variables $title, $description and $content |