Skip to content

Instantly share code, notes, and snippets.

@nckltcha
nckltcha / gist:3402709
Created August 20, 2012 09:46
Using Wget to post a pushvoer notification
wget --post-data 'token=APIKEY&user=USERKEY&"message=hello world' -O - https://api.pushover.net/1/messages
@nckltcha
nckltcha / gist:3380123
Created August 17, 2012 15:56
Post Pushover Message via CURL / PHP
<?php
curl_setopt_array($ch = curl_init(), array(
CURLOPT_URL => "https://api.pushover.net/1/messages",
CURLOPT_POSTFIELDS => array(
"token" => "APIKEY",
"user" => "USERKEY",
"message" => "hello world",
)));
$result = curl_exec($ch);
curl_close($ch);
@nckltcha
nckltcha / bit.ly API PHP Shortener
Created August 17, 2012 15:26
bit.ly API PHP Shortener
<html>
<head>
</head>
<body>
<?php
function bitly($add)
{
$long_url = urlencode($add);
$bitly_login = 'LOGIN';
$bitly_apikey = 'APIKEY';
@nckltcha
nckltcha / gist:3361054
Created August 15, 2012 15:33
Get Bit.ly Short URL in Pop-Up Window
javascript:q=location.href;if(document.getSelection){d=document.getSelection();}else{d='';};p=document.title;void(open('http://api.bit.ly/shorten?version=2.0.1&login=USERNAME&apiKey=APIKEY&format=text&longUrl='+encodeURIComponent(q)+''));
LEDS "clip" signals at about +/-1.2-to-2.2V, depending upon "color" of LED emission, ie: RED ~ 1.2-1.5V, BLUE ~ 2.2V"
@nckltcha
nckltcha / gist:2788306
Created May 25, 2012 14:00
rewrite url
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?www.whatwouldthecaptaindo.co.uk$
RewriteRule ^(/)?$ wordpress [L]
@nckltcha
nckltcha / gist:2688453
Created May 13, 2012 13:22
httpd.conf-user
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
/volume1/@optware/local/bin/pylms --device 00:04:20:26:a5:ef play
@nckltcha
nckltcha / gist:2556441
Created April 30, 2012 08:09
Check IPs
<?php
/**
* First, we declare an array of domains to check. Each array is for a domain that we want to check, and the port that we want to check.
* The third value is how long fsockopen should wait before timing out.
*/
$ports = array (
array('192.168.0.1', 80, 1,'Router'),
array('192.168.0.7', 90, 1,'Self'),
array('www.yahoo.com', 80, 1,'google'),
array('www.sitethatdoesnotexist.com', 80, 1,'nothing')
@nckltcha
nckltcha / gist:2205070
Created March 26, 2012 13:33
Beeps for DiskStation
"echo 2 >/dev/ttyS1" for a short beep
"echo 3 >/dev/ttyS1" for a long beep