Skip to content

Instantly share code, notes, and snippets.

@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active October 31, 2025 16:56
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@mmstick
mmstick / transcode-install.sh
Last active October 20, 2022 21:48
Ubuntu 10-bit HEVC Transcoding Tools -- Contains a script to install x265-10bit-git, libass-git, ffmpeg-git and bomi-git; another for updating everything; as well as scripts for transcoding videos with ffmpeg. Transcoding scripts require the fish shell to be installed.
#!/bin/bash
sourcedir="$HOME/.local/src/"
mkdir "$sourcedir"
export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
function install-dependencies() {
# Install build tools and Mesa VDPAU support.
sudo apt-fast install -y cmake yasm autoconf build-essential mesa-vdpau-drivers \
libvdpau-va-gl1
@mistaka0s
mistaka0s / post-recieve.sh
Last active April 16, 2017 20:56
Git post-recieve hook to update Splunk deployment-apps directory on push.
#!/bin/bash
umask 022
# Uncomment to debug.
#set -x
# Modify GITWORKDIR to suit you.
#GITWORKDIR=/tmp/deployment-apps/
GITWORKDIR=/opt/splunk/etc/deployment-apps/
# Modify AUTOPUSHBRANCH with the branch you want to automatically push.
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active July 16, 2025 06:32
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@darylrobbins
darylrobbins / props.conf
Created January 9, 2015 17:55
AWS Splunk Configuration
[source::.../var/log/messages]
sourcetype = linux_messages_syslog
[source::.../var/log/secure]
sourcetype = linux_secure
[source::.../var/log/dmesg]
sourcetype = dmesg
[source::.../var/log/cron]
@waprin
waprin / gist:7aee67aefd7530d3587a
Last active June 21, 2018 15:29
Verify Splunk Regex Matches Against Your Entire Log File
#!/usr/bin/env python
# usage ./verify_splunk_coverage.py <log_file>
# set these from splunk-apps/apps/<service-name>/default/props.conf
BREAK_ONLY_BEFORE_REGEX=r'^\d\d:\d\d:\d\d\s\[[^\]]+\]'
EXTRACT_REGEX=r'^\d?\d:\d\d:\d\d\s\[(?P<thread>[^\]]+)\]\s\[(?P<loglevel>\w+)\]\s\[(?P<class>[^\]]+)\]\s\[(?P<username>[^\]]*)\](?P<message>.*)$'
import re,sys
f = open(sys.argv[1])
@dky
dky / gist:9982144
Created April 4, 2014 20:04
List all non Splunk indexes
cd /opt/splunk/var/lib/splunk && for i in `ls -1 -d */| less |egrep -iv "summary|audit|authDb|blockSignature|defaultdb|hashDb|fishbucket|_internaldb|notable|notabledb|persistentstorage|session_*|appserver|historydb"`; do du -sh $i; done
@xuhdev
xuhdev / use_macports.sh
Last active September 3, 2019 08:29
Wrap executables installed by Macports
#!/bin/sh
## Wrap Macports command (any executables installed by Macports).
if [ "$#" -le 0 ]; then
echo "Usage: $0 command [arg1, arg2, ...]" >&2
exit 1
fi
if [[ -z $MACPORTS_PREFIX ]]; then
@sloria
sloria / bobp-python.md
Last active September 9, 2025 10:52
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@hgdeoro
hgdeoro / check_smart_sas.sh
Created June 25, 2013 19:44
Check health of SAS drive using smartctl
#!/bin/bash
#STATE_OK=0
#STATE_WARNING=1
#STATE_CRITICAL=2
#STATE_UNKNOWN=3
#STATE_DEPENDENT=4
STATUS_OK="OK"
STATUS_WARNING="WARNING"