Skip to content

Instantly share code, notes, and snippets.

@millermedeiros
millermedeiros / .vimrc
Last active March 3, 2025 07:29
My VIM settings (.vimrc)
" =============================================================================
" Miller Medeiros .vimrc file
" -----------------------------------------------------------------------------
" heavily inspired by: @factorylabs, @scrooloose, @nvie, @gf3, @bit-theory, ...
" =============================================================================
" -----------------------------------------------------------------------------
" BEHAVIOR
@adrianratnapala
adrianratnapala / SSH-X11-Forwarding.md
Created October 29, 2011 17:43
A note on X11-Forwarding in SSh.

I used to think that

ssh -X [email protected]

"just bloody worked". However this might not work - ssh must play ball on both sides of the link. On the remote (ssh server, X client) sshd must sit behind some port, tell Xlib to send X11 requests to it and then forward them back to you the X server (where the ssh client is). If the remote box is locked down to prevent this, you will get:

X11 forwarding request failed on channel 0

as part of an otherwise working login. As it happens, I am the admin of the remote box in question, so I followed the ArchWiki and went to /etc/ssh/sshd_config and uncommented

@mbbx6spp
mbbx6spp / README.md
Created December 4, 2011 04:24
Best UNIX shell-based tools I can't live without with example usages

Best UNIX Shell tools

These are a list of usages of shell commands I can't live without on UNIX-based systems.

Install

Mac OS X

Using Homebrew (yes, I am opinionated) you can install the following tools with the following packages:

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@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"
@sloria
sloria / bobp-python.md
Last active March 3, 2025 16:09
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
@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
@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
@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])
@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]