Skip to content

Instantly share code, notes, and snippets.

@bohack
bohack / SimpleHTMLServer.js
Created February 22, 2017 02:54
Node.JS Server which reads a SQLITE database and outputs HTML
var sqlite3 = require('sqlite3').verbose();
var file = "mydb.db";
var db = new sqlite3.Database(file);
db.all("SELECT rowid AS id, info FROM user_info", function(err, rows) {
var http = require("http");
var server = http.createServer(function(request, response) {
//var now = new Date();
//console.log('Request at ' + now);
response.writeHead(200, {"Content-Type": "text/html"});
response.write("<!DOCTYPE html>");
@bohack
bohack / gist:faf5265bc172f86aa7389c453170f393
Created March 3, 2017 22:44
decode directly from gqrx use snd-aloop driver
1) modprobe snd-aloop
2) start gqrx and select the loopback sound device
3) padsp -- dsd -i /dev/dsp -o /dev/dsp
4) use pavucontrol to set monitoring device for padsp/dsd
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = &H0001
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
strPathtoTextFile = "."
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
@bohack
bohack / PowerCLI for Checking VM Time Sync
Created May 22, 2017 14:49
PowerCLI for Checking VM Time Sync
get-view -viewtype virtualmachine -Filter @{'Config.Tools.SyncTimeWithHost'='False'} | select name
@bohack
bohack / PowerCLI to Set a VM to sync time from the host
Created May 22, 2017 14:51
PowerCLI to Set a VM to sync time from the host
# Bohack
# 05/22/17
# Set time sync for VM
if ($args.count -lt 1) {
write-host
write-host "SetVMTime {VM Guest Name}"
write-host
break
}
@bohack
bohack / Creating a Specific File Size for Testing
Created June 29, 2017 18:46
Creating a Specific File Size for Testing
@ECHO OFF
REM Jon Buhagiar
REM 06/29/17
REM Create really large files
IF {%1}=={} (goto :ERRHAND)
SETLOCAL
SET /A maxsize=%1*1000
SET /A X=0
@bohack
bohack / Flashing a 3700i Cisco Wireless Access Point
Created September 5, 2017 13:52
Flashing a 3700i Cisco Wireless Access Point
Hold the reset button for 30 seconds during boot
release and press ESC a few times
format flash:
set ENABLE_BREAK=yes
set IP_ADDR 10.2.7.10
set NETMASK 255.255.0.0
tftp_init
ether_init
flash_init
@bohack
bohack / Windows 10 Command Prompt Here
Created September 6, 2017 14:07
Windows 10 Command Prompt Here
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\cmdprompt]
@="@shell32.dll,-8506"
"Extended"=""
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\Directory\shell\cmdprompt\command]
@="cmd.exe /s /k pushd \"%V\""
@bohack
bohack / Bill's Mom's BBQ Recipe
Created September 18, 2017 15:56
Bill's Mom's BBQ Recipe
Scale out as needed!
3 Tablespoon Paprika
1 Tablespoon Pepper
1/2 to 1 Teaspoon of non-iodized Salt
1/2 to 1 Teaspoon of Cayenne Pepper (be careful!)
1 Tablespoon of Powered Onion
1 Tablespoon of Powered Garlic
2 Tablespoons of Brown Sugar
1 Tablespoon of Chilli powder
@bohack
bohack / Office Activation Script on Startup
Created October 19, 2017 17:51
Office Activation Script on Startup
@ECHO OFF
REM Jon Buhagiar
REM 10/19/17
REM Office Manual Activation
IF EXIST "C:\Support\.officeactivation" GOTO :END
CSCRIPT "C:\Program Files (x86)\Microsoft Office\Office16\ospp.vbs" /act
ECHO %ERRORLEVEL% - %DATE% - %TIME% > "C:\Support\.officeactivation"