drush ucrt "new_user" --mail="new_user@email_address.com" --password="new_password"(check the database to get the administrator ID)
| # Open the networking configuration file using your favorite editor (vi, nano, etc....) | |
| sudo vi /etc/network/interfaces | |
| # Enter the following: | |
| auto lo | |
| iface lo inet loopback | |
| iface eth0 inet dhcp |
| # Create a bootable OS X 10.10 Yosemite install drive on a USB flash drive using createinstallmedia | |
| sudo /Volumes/Macintosh\ HD/Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction |
| db.domains.update( { username: "someuser@gmail.com" }, { $set: { something: 0 } }, { multi: true } ) |
To access a server, behind a firewall, via HTTP...
Use a server you have access to, as a proxy...
ssh -N -D 9000 user@serverConfigure your web browser to use SOCKS proxy host 127.0.0.1 and port 9000.
| public function getRandomRecords() | |
| { | |
| // Select the first id in the target table | |
| $statement = $this->db->prepare("SELECT some_id | |
| FROM table_name | |
| ORDER BY some_id ASC LIMIT 1"); | |
| $statement->execute(); | |
| $lowest_id = $statement->fetch(PDO::FETCH_ASSOC); | |
| // Select the last id in the target table |
| The objective of this post is to get you from absolutely nothing, to a fully functional nodejs environment. | |
| Software used: Ubuntu 11.10, Nodejs v0.6.12, Nginx, MongoDB, Redis, and NPM modules. | |
| 1. Download and install the latest version of Ubuntu: http://www.ubuntu.com/download (don't select any extra items to install when prompted) | |
| 2. Once you are logged in and are at your Ubuntu command prompt, install the necessary software you will need: | |
| a. sudo apt-get install openssh-server | |
| b. sudo apt-get install libssl-dev | |
| c. sudo apt-get install git | |
| d. sudo apt-get install g++ | |
| e. sudo apt-get install make |
| <?php | |
| $url = "http://www.imdb.com/movies-in-theaters/"; | |
| $input = @file_get_contents($url) or die("Could not access file: $url"); | |
| $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; | |
| if(preg_match_all("/$regexp/siU", $input, $matches)) { | |
| // $matches[2] = array of link addresses | |
| // $matches[3] = array of link text - including HTML code | |
| echo "<pre>"; | |
| var_dump($matches[2]); | |
| echo "</pre>"; |
| /** | |
| * Script dependencies | |
| */ | |
| var twitter = require('ntwitter'); | |
| var settings = require('./config.js'); | |
| var exec = require('child_process').exec; | |
| var twit = new twitter({ | |
| consumer_key: settings.consumer_key , |