To access a server, behind a firewall, via HTTP...
Use a server you have access to, as a proxy...
ssh -N -D 9000 user@server
Configure your web browser to use SOCKS proxy host 127.0.0.1 and port 9000.
/** | |
* 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 , |
<?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>"; |
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 |
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 |
To access a server, behind a firewall, via HTTP...
Use a server you have access to, as a proxy...
ssh -N -D 9000 user@server
Configure your web browser to use SOCKS proxy host 127.0.0.1 and port 9000.
me@player:~/player$ grunt build | |
Running "default" task | |
Running "ts:dev" (ts) task | |
Compiling... | |
... | |
Using tsc v1.0.1 |
db.domains.update( { username: "someuser@gmail.com" }, { $set: { something: 0 } }, { multi: true } ) |
# 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 |