Skip to content

Instantly share code, notes, and snippets.

@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 / 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": [
{
.. image:: picture.jpeg
:height: 100px
:width: 200 px
:scale: 50 %
:alt: alternate text
:align: right
{
"metadata": {
"name": "",
"signature": "sha256:3d39a8b952a425df0decd18096ff73a97e5e89d0ee6dda1072913087ddd431ba"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
@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/
@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 / 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 / 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 / TAXII-1.1.postman_collection.json
Created October 27, 2016 02:45 — forked from jtschichold/TAXII-1.1.postman_collection.json
Simple Postman Collection for TAXII 1.1 Requests
{
"variables": [],
"info": {
"name": "TAXII-1.1 (0.1)",
"_postman_id": "f355c2a2-5d3e-6f5b-f957-afe4d5646d7a",
"description": "Simple collection of TAXII 1.1 requests.\nYou need an environment with the following keys to run this:\n- hostname: hostname of the TAXII server\n- collection: name of the collection to poll (needed only for Poll Request)\n\nDiscovery request points to {{hostname}}/taxii-discovery-service\n\nCollection Information Request points to {{hostname}}/taxii-collection-management-service\n\nPoll Request to {{hostname}}/taxii-poll-service",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{