Skip to content

Instantly share code, notes, and snippets.

@nckltcha
nckltcha / gist:2112266
Created March 19, 2012 13:33
Proxy Redirect
vi /usr/syno/etc/httpd-vhost.conf-user
/usr/syno/etc/rc.d/S97apache-user.sh restart
ProxyHTMLURLMap http://localhost:8082 /couch
/usr/syno/apache/bin/httpd -L
http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh
ProxyRequests Off
@nckltcha
nckltcha / Squid Reverse Proxy
Created March 19, 2012 13:33
Squid Reverse Proxy
http_port 8080 accel defaultsite=myredhotcar.co.uk
cache_peer localhost parent 5000 0 no-query originserver name=myAccel
acl our_sites dstdomain myredhotcar.co.uk
http_access allow our_sites
cache_peer_access myAccel allow our_sites
http://www.cyberciti.biz/tips/linux-setup-transparent-proxy-squid-howto.html
http://www.visolve.com/squid/whitepapers/reverseproxy.php
@nckltcha
nckltcha / Custom Macros
Created March 19, 2012 13:36
VBA Macros taken from Excel
Sub DoIt()
Selection = Selection.Value
End Sub
Sub datevalues()
'
@nckltcha
nckltcha / Prowl Notifier
Created March 22, 2012 14:32
Check Service is Running and Post to Prowl
#!/bin/sh
# Name of Service
SERVICE=sick
if ps | grep -v grep | grep $SERVICE > 0
then
@nckltcha
nckltcha / Prowl Start UpShutdown Notifier
Created March 22, 2012 15:21
Script to send Prowl Notificatio when system starts up or shuts down
#! /bin/sh
case "$1" in
start)
wget --post-data 'apikey=XXXXX&application=DiskStation&event=System&description=DiskStation Starting Up' -O - http://api.prowlapp.com/publicapi/add
;;
stop)
wget --post-data 'apikey=XXXXX&application=DiskStation&event=System&description=DiskStation Shutting Down' -O - http://api.prowlapp.com/publicapi/add
;;
esac
@nckltcha
nckltcha / Prowl Bookmarklet
Created March 23, 2012 09:05
Prowl Bookmarklet
javascript:var http = new XMLHttpRequest();var url = "http://prowl.weks.net/publicapi/add";var apikey = "XXXXX";var application = "Work Browser";var evt = "Browser!";var description = encodeURIComponent(document.title.replace(/^\s*|\s*/g,%27%27))+ escape("\n") + encodeURIComponent(location.href);var params = "apikey="+apikey+"&application="+escape(application)+"&event="+escape(evt)+"&description="+description;http.open("POST", url, true);http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");http.send(params);
javascript:q=location.href;if(document.getSelection){d=document.getSelection();}else{d='';};p=document.title;void(open('https://prowl.weks.net/publicapi/add?apikey=XXXXX&application=Work Browser&event=Send Link&description='+encodeURIComponent(p)+'&url='+encodeURIComponent(q)+''));
@nckltcha
nckltcha / Prowl HD Temp
Created March 23, 2012 13:23
Check's the HD Temp and Sends a Prowl Notification
#!/bin/bash
limit=39
t=`/usr/syno/bin/smartctl -a -d sat /dev/sda | grep "Temperature_Celsius" | awk '{print $10}'`
if [ $t -ge $limit ]
then
wget --post-data 'apikey=XXXX&priority=2&application=DiskStation&event=Hard Drive&description=Hard Drive Temperature over Limit degress&url=http://myredhotcar.co.uk:5000' -O - http://api.prowlapp.com/publicapi/add
@nckltcha
nckltcha / RRD Temp
Created March 24, 2012 14:41
RRD Temperature Graph - DiskStation
#!/usr/bin/perl
#
# copyright Martin Pot 2003
# http://martybugs.net/linux/hddtemp.cgi
#
# Modified by myredhotcar for DiskStation DS212j
#
#
#
# rrd_hddtemp.pl
@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
@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')