Skip to content

Instantly share code, notes, and snippets.

View bkilshaw's full-sized avatar

Brad Kilshaw bkilshaw

View GitHub Profile
stanley@home:~$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package build-essential is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'build-essential' has no installation candidate
brad@etylogic:~$ sudo apt-cache search build-essential
sbuild - Tool for building Debian binary packages from Debian sources
devscripts - scripts to make the life of a Debian Package maintainer easier
stanley@home:~$ cat /etc/issue
Ubuntu 11.10 \n \l
stanley@home:~$ cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu oneiric universe
deb-src http://archive.ubuntu.com/ubuntu oneiric universe
deb http://archive.ubuntu.com/ubuntu oneiric-updates universe
deb-src http://archive.ubuntu.com/ubuntu oneiric-updates universe
~$ apt-cache policy nginx
nginx:
Installed: 1.0.15-1~lucid
Candidate: 1.0.15-1~lucid
Version table:
*** 1.0.15-1~lucid 0
500 http://nginx.org/packages/ubuntu/ lucid/nginx i386 Packages
100 /var/lib/dpkg/status
1.0.5-1 0
500 http://archive.ubuntu.com/ubuntu/ oneiric/universe i386 Packages
deb http://archive.ubuntu.com/ubuntu oneiric main
deb-src http://archive.ubuntu.com/ubuntu oneiric main
deb http://archive.ubuntu.com/ubuntu oneiric-updates main
deb-src http://archive.ubuntu.com/ubuntu oneiric-updates main
deb http://archive.ubuntu.com/ubuntu oneiric universe
deb-src http://archive.ubuntu.com/ubuntu oneiric universe
deb http://archive.ubuntu.com/ubuntu oneiric-updates universe
<?php
/**
* @package WordPress
* @subpackage The Developer
* @since The Developer1.0
*/
?>
<?php get_header(); ?>
var http = require("http");
function onRequest(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
console.log(".");
response.end();
}
http.createServer(onRequest).listen(8888);
index.php -> page_1.php -> page_2.php -> page_3.php
-> page_a.php -> page_b.php
-> page_i.php -> page_ii.php
-> page_x.php -> page_y.php
<?php
function query_select_single($query) {
$results = mysql_query($query);
if(mysql_num_rows($results) >= 1) {
return mysql_fetch_assoc($results);
}
return FALSE;
}
?>
@bkilshaw
bkilshaw / gist:3624901
Last active November 15, 2023 19:22
MACVendors.com API :: PHP GET Example
<?php
$mac_address = "FC:FB:FB:01:FA:21";
$url = "https://api.macvendors.com/" . urlencode($mac_address);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
if($response) {
echo "Vendor: $response";