Skip to content

Instantly share code, notes, and snippets.

/volume1/@optware/local/bin/pylms --device 00:04:20:26:a5:ef play
@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
@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]
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: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)+''));
@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: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 / 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:3496353
Created August 28, 2012 08:58
Java Synth
// SimpleGroovyMidiSynthesizer sample
import javax.sound.midi.*;
public class MidiSynthesizerSample {
static void main(args) {
def notes = [60, 62, 64, 65, 67, 69, 71, 72, 72, 71, 69, 67, 65, 64, 62, 60]
def synth = MidiSystem.getSynthesizer()
def vel = 50 // velocity from 0..127
@nckltcha
nckltcha / Powershell Script to Download Outlook Attachments
Last active May 14, 2020 12:37
Powershell Script to Download Outlook Attachments
$MailboxName = "MAILBOX"
$Subject = "EMAIL SUBJECT"
$ProcessedFolderPath = "/Inbox/Processed"
$downloadDirectory = "c:\temp"
Function FindTargetFolder($FolderPath){
$tfTargetidRoot = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::MsgFolderRoot,$MailboxName)
$tfTargetFolder = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$tfTargetidRoot)
$pfArray = $FolderPath.Split("/")
for ($lint = 1; $lint -lt $pfArray.Length; $lint++) {