Skip to content

Instantly share code, notes, and snippets.

View dandye's full-sized avatar

DanDye dandye

View GitHub Profile
@dandye
dandye / create_edge_user.js
Last active March 25, 2016 21:45
Create an Edge user with node.js
const https = require('https');
var querystring = require('querystring');
//FixMe; this is INSECURE!
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
var payload = querystring.stringify({
"username": "dandye",
"password": "redacted",
@dandye
dandye / get_rpm_versions.sh
Created March 18, 2016 22:26
pretty print versions of RPMs matching a query (for `diff`ing two systems)
rpm -qa --queryformat "%{RPMTAG_NAME}\n" | \
grep soltra-edge | \
sort | \
xargs -I {} \
rpm -qa --queryformat "%-60{RPMTAG_NAME} \
%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}\n" {}
@dandye
dandye / silence.sh
Created February 20, 2016 18:23
silence 30 & # Mute Spotify Ads
#!/bin/csh
osascript -e 'set volume with output muted'
if ( $# != "0" ) then
sleep $1
osascript -e 'set volume without output muted'
endif
@dandye
dandye / pre-commit.py
Last active January 14, 2023 09:30
pre-commit hook to re-write the TravisCI Badge with the current branch. Save as `.git/hooks/pre-commit` (without the .py extension)
#!/usr/bin/python
"""
Referencing current branch in github readme.md[1]
This pre-commit hook[2] updates the README.md file's
Travis badge with the current branch
[1] http://stackoverflow.com/questions/18673694/referencing-current-branch-in-github-readme-md
[2] http://www.git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
[3] https://docs.travis-ci.com/user/status-images/
{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
{
"metadata": {
"name": "",
"signature": "sha256:3d39a8b952a425df0decd18096ff73a97e5e89d0ee6dda1072913087ddd431ba"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
.. image:: picture.jpeg
:height: 100px
:width: 200 px
:scale: 50 %
:alt: alternate text
:align: right
@dandye
dandye / hailataxii_disovery_with_libtaxii
Created November 20, 2014 22:52
Hailataxii discovery example using litaxii
{
"metadata": {
"name": "hailataxii_disovery_with_libtaxii"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@dandye
dandye / sp_who2_w_db_select
Created September 30, 2014 17:27
sp_who2 with DB SELECT
CREATE TABLE #sp_who2 (SPID INT,Status VARCHAR(255),
Login VARCHAR(255),HostName VARCHAR(255),
BlkBy VARCHAR(255),DBName VARCHAR(255),
Command VARCHAR(255),CPUTime INT,
DiskIO INT,LastBatch VARCHAR(255),
ProgramName VARCHAR(255),SPID2 INT,
REQUESTID INT)
INSERT INTO #sp_who2 EXEC sp_who2
SELECT *
FROM #sp_who2
@dandye
dandye / learning_pulp
Last active August 29, 2015 14:06
learning PuLP
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{