Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#ESBcolor2email.sh
#@acetwenty8 7/31/2016
#Script to send an email if ESB is not signature white tonight
TEMP=/tmp/`date +%s`.tmp
EML=/tmp/`date +%s`.eml
EMAILADDR=somewhere@nowhere.com
HTML=`curl -sq http://www.esbnyc.com/explore/tower-lights > $TEMP`
@acetwenty8
acetwenty8 / nyc_query.sql
Last active April 17, 2016 15:58
OSM Tunnel/Bridge Query - NYC
###############################################################################################
############### SQL craziness to extract the data and load into output tables #################
###############################################################################################
ALTER TABLE joinways_input ALTER COLUMN way SET DATA TYPE geometry;
TRUNCATE joinways_input;
INSERT INTO joinways_input
SELECT *
FROM planet_osm_line
WHERE (name IS NOT NULL) AND
(
@acetwenty8
acetwenty8 / leapyear.sh
Last active February 27, 2016 18:04
leapyear.sh
#!/bin/bash
function_testleap () {
local WORK_YEAR=$1
local IS_LEAP="false"
local IS_100="false"
local IS_400="false"
@acetwenty8
acetwenty8 / ost_autoclose.sql
Last active February 17, 2016 15:11
osTicket AutoClose
INSERT INTO ost_ticket_event
(ticket_id, staff_id, team_id, dept_id, topic_id, state, staff, annulled, timestamp)
SELECT
a.ticket_id, a.staff_id, a.team_id, a.dept_id, a.topic_id, 'closed', 'SYSTEM', '0', NOW()
FROM
ost_ticket a
JOIN
ost_autoclose_id b
ON
a.ticket_id=b.ticket_id;
@acetwenty8
acetwenty8 / numgen.sh
Created February 7, 2016 03:11
numgen.sh
#!/bin/bash
list=`echo {0..9}`
suppress=0
for c1 in $list
do
for c2 in $list
do
for c3 in $list
#PeriscopeProfileJson.sh
#Returns User Profile Json from Web Profile
#Version 1.0: Initial Release
#Version 1.1: Fixed quoting characters, optimize perl statements
#Version 1.2: Update parsing for changes in profile page
#replace myuser with the user you want to query
#line breaks added for readability
USR=myuser; curl -sq https://www.periscope.tv/$USR \
#/etc/asterisk/extentions.conf
[from-internal]
exten => 667,1,Wait(1)
exten => 667,2,Playback(beep)
exten => 667,3,Wait(1)
exten => 667,4,swift(code. 14. j.)
exten => 667,5,Goto(from-internal,667,3)
#lost.call
Channel: SIP/4201
@acetwenty8
acetwenty8 / rename.bat
Created November 2, 2015 23:40
Script to rename Windows system to serial number
@echo off
for /F "skip=1 delims=" %%j in ('wmic bios get serialnumber') do (
set SERIAL=%%j
goto :DONE
)
:DONE
set src=%SERIAL%&set DummyForSpacesAtTheEnd=x
echo [%src%]
for /f "delims=" %%A in ('echo %src%') do call :Sub1 %%A