Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Check and stop unallowed file names from being checked in
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(git hash-object -t tree /dev/null)
fi
#!/bin/bash
MONIT_VERSION=5.25.3
cd /tmp
sudo groupadd monit
sudo useradd monit -g monit
wget https://mmonit.com/monit/dist/binary/${MONIT_VERSION}/monit-${MONIT_VERSION}-linux-x64.tar.gz -O monit.tar.gz
echo "Untarring the archive"
tar xzvf monit.tar.gz
sudo cp -R monit-${MONIT_VERSION}/bin/monit /usr/local/bin/monit
sudo mkdir /etc/monit/
#!/bin/bash
ETHTOOL=/sbin/ethtool
NETWORK_INTERFACE=eth0
ERROR_STATS=$($ETHTOOL -S $NETWORK_INTERFACE | grep errors | tr -d " ")
for STAT in $ERROR_STATS
do
KEY=$(echo $STAT | awk -F ':' '{print $1}')
GitHub pull request #5 of commit 7f528913d419bd6af5313e48067a7afc9801ea3f, no merge conflicts.
Setting status of 7f528913d419bd6af5313e48067a7afc9801ea3f to PENDING with url http://devops.deltamktgresearch.com/jenkins/job/VRPTestPullRequest/26/ and message: 'Build started sha1 is merged.'
Building in workspace /var/lib/jenkins/jobs/VRPTestPullRequest/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/nexsalesdev/VRPTF.git # timeout=10
Fetching upstream changes from https://github.com/nexsalesdev/VRPTF.git
> git --version # timeout=10
using .gitcredentials to set credentials
> git config --local credential.username nexsalesdev # timeout=10
@mehulved
mehulved / gist:fcf7bc472a4a62f73557
Created January 9, 2015 10:42
Keybase Github Identity
### Keybase proof
I hereby claim:
* I am mehulved on github.
* I am mved (https://keybase.io/mved) on keybase.
* I have a public key whose fingerprint is 00A3 54FD 9C58 207D 8788 6176 82F3 C99F 4B53 9199
To claim this, I am signing this object:
import MySQLdb
# MySQL Connection Parameters
MYSQL_USER=''
MYSQL_PASSWORD=''
MYSQL_DB=''
MYSQL_HOST=''
# Collation Information
OLD_COLLATION=''
---
- name: Prepare hosts that will be used
user: root
hosts: all
roles:
- name: Gather information about all the hosts in our account
local_action:
module: rax_facts
credentials: ~/.rackspace_cloud_credentials
name: "{{ inventory_hostname }}"
$ foreman start
14:41:56 web.1 | started with pid 29117
14:41:58 web.1 | 2013-08-12 14:41:58 [29120] [INFO] Starting gunicorn 17.5
14:41:58 web.1 | 2013-08-12 14:41:58 [29120] [INFO] Listening at: http://0.0.0.0:5000 (29120)
14:41:58 web.1 | 2013-08-12 14:41:58 [29120] [INFO] Using worker: sync
14:41:58 web.1 | 2013-08-12 14:41:58 [29130] [INFO] Booting worker with pid: 29130
14:42:04 web.1 | Did not find settings file development.py
14:42:04 web.1 | /home/mehul/Projects/funnel/venv/local/lib/python2.7/site-packages/flask_cache/__init__.py:100: UserWarning: Flask-Cache: CACHE_TYPE is set to null, caching is effectively disabled.
14:42:04 web.1 | warnings.warn("Flask-Cache: CACHE_TYPE is set to null, "
14:42:04 web.1 | * Running on http://0.0.0.0:3000/
@mehulved
mehulved / uastring.py
Created August 1, 2012 18:34
User Agent strings in more usable format
def uastring(platforms, format):
'''
This function is used to retrive User Agent String for various browsers/platforms from www.useragentstring.com.
Aim of this module is to simplify using the available data.
To find the value of the platform, visit http://useragentstring.com and get the part after /pages/
The platform parameter should be a set of one or more platforms. Supported formats are csv, json and xml.
'''
import requests
import BeautifulSoup as bsoup
@mehulved
mehulved / serialEvent
Created May 2, 2012 12:38
Goes to high but doesn't return back to low
int led = 13;
char ledValue;
void setup() {
Serial.begin(9600);
Serial.println("Enter H to turn on the LED and L to turn it off");
}
void loop() {
Serial.println(digitalRead(led));
delay(1000);