Skip to content

Instantly share code, notes, and snippets.

Petr Michalec epcim

Block or report user

Report or block epcim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@enaeseth
enaeseth / yaml_ordered_dict.py
Created Feb 25, 2011
Load YAML mappings as ordered dictionaries
View yaml_ordered_dict.py
import yaml
import yaml.constructor
try:
# included in standard lib from Python 2.7
from collections import OrderedDict
except ImportError:
# try importing the backported drop-in replacement
# it's available on PyPI
from ordereddict import OrderedDict
@nstielau
nstielau / bash.sh
Created Jun 2, 2011
Set node attributes, run_list, chef_environment, etc
View bash.sh
knife node configure my_node.example.com
@justinvoss
justinvoss / fabfile.py
Created Jun 20, 2011
Example Fabric and Cuisine Scrips
View fabfile.py
from deployment.cuisine import *
from fabric.api import *
from fabric.context_managers import *
from fabric.utils import puts
from fabric.colors import red, green
import simplejson
import os
@rsvp
rsvp / httpstatus
Created Aug 25, 2011
httpstatus : bash script to get HTTP response code with optional status message (includes verbose definitions in comment)
View httpstatus
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-08-25
#
# _______________| httpstatus : get HTTP status code
#
# Usage: httpstatus URL [timeout] [--code or --status] [see 4.]
# ^message with code (default)
# ^code (numeric only)
# ^in secs (default: 3)
# ^URL without "http://" prefix works fine.
@mattm7n
mattm7n / gist:1405067
Created Nov 29, 2011
Monitor DHCP traffic with tcpdump
View gist:1405067
# Monitoring on interface eth0
tcpdump -i eth0 -n port 67 and port 68
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created Feb 12, 2012
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
View git-branches-by-commit-date.sh
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@davejamesmiller
davejamesmiller / ask.sh
Last active Sep 5, 2019
Bash General-Purpose Yes/No Prompt Function ("ask")
View ask.sh
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# https://gist.github.com/davejamesmiller/1965569
local prompt default reply
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
@lancejpollard
lancejpollard / meta-tags.md
Created Mar 5, 2012
Complete List of HTML Meta Tags
View meta-tags.md

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active Sep 17, 2019
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)
View _INSTALL.md

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

View tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
You can’t perform that action at this time.