Skip to content

Instantly share code, notes, and snippets.

View mohitsethi's full-sized avatar
🎯
Focusing

Mohit Sethi mohitsethi

🎯
Focusing
View GitHub Profile
@jkeiser
jkeiser / gist:db0478ff3556a613067b
Last active August 29, 2015 14:01
metal-drivers

Chef Metal, Configuration and Drivers

As Chef Metal approaches 1.0, we've landed a huge configuration and driver interface improvement intended to enable:

  • A standard way to specify credentials and keys that keeps them out of recipes and allows them to be used in multiple places
  • External commands (like "metal execute") that can look up information and manage a node independent of the original Metal recipe
  • Environmental and directory-specific configuration
  • Make the drivers easily usable in test-kitchen and knife

Herein I want to talk about the Driver interface and how it is used by provisioning programs like the machine resource or kitchen, and driver implementors.

@mychaelstyle
mychaelstyle / build.gradle
Created March 28, 2014 06:04
Example Gradle build Java with FindBugs and PMD and CPD
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "maven"
apply plugin: "findbugs"
apply plugin: "pmd"
def defaultEncoding = 'UTF-8'
[compileJava, compileTestJava]*.options*.encoding = defaultEncoding
sourceCompatibility = 1.7
@hwdsl2
hwdsl2 / .MOVED.md
Last active December 28, 2016 07:16
Ghost Blog Auto Setup Script with Nginx and ModSecurity
@noteed
noteed / docker-ovs.md
Last active December 29, 2023 07:07
Docker - Open vSwitch setup
@ringular
ringular / .chef_profile
Created January 23, 2014 09:16
bash aliases for knife
# BOOTSTRAP COMMANDS
alias kb="knife bootstrap"
# alias k="knife bootstrap windows ssh FQDN
# alias k="knife bootstrap windows winrm FQDN
# CLIENT COMMANDS
alias kbdc="knife client bulk delete"
alias kcc="knife client create --editor /usr/bin/sublime"
alias kdc="knife client delete"
alias kec="knife client edit"
@robulouski
robulouski / gmail_imap_example.py
Last active April 19, 2024 02:27
Very basic example of using Python and IMAP to iterate over emails in a gmail folder/label. http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#!/usr/bin/env python
#
# Very basic example of using Python and IMAP to iterate over emails in a
# gmail folder/label. This code is released into the public domain.
#
# RKI July 2013
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#
import sys
import imaplib
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 30, 2024 19:21
5 entertaining things you can find with the GitHub Search API
@miglen
miglen / Apache Tomcat 8 Start stop script init.d script
Last active November 10, 2022 20:03 — forked from valotas/tomcat.sh
Apache Tomcat init script (or startup/controll script). Works fine for version 7/8. Read the comments for release history. Feel free to modify, copy and give suggestions. (c) GNU General Public License
#!/bin/bash
#
# description: Apache Tomcat init script
# processname: tomcat
# chkconfig: 234 20 80
#
#
# Copyright (C) 2014 Miglen Evlogiev
#
# This program is free software: you can redistribute it and/or modify it under
@dideler
dideler / example.md
Last active February 17, 2024 20:24
A python script for extracting email addresses from text files.You can pass it multiple files. It prints the email addresses to stdout, one address per line.For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.

The program below can take one or more plain text files as input. It works with python2 and python3.

Let's say we have two files that may contain email addresses:

  1. file_a.txt
foo bar
ok ideler.dennis@gmail.com sup
 hey...user+123@example.com,wyd
hello world!
# Place this file in the same directory as `Vagrantfile'
# then simply require "vagrant-snapshot.rb" at the top of Vagrantfile.
require 'optparse'
Vagrant.commands.register(:snap) { Snap::Commands }
# Provide rake-like desc() 'inflected' documentation
# See http://stackoverflow.com/questions/2948328/access-attributes-methods-comments-programmatically-in-ruby
class Module