Skip to content

Instantly share code, notes, and snippets.

View Puneeth-n's full-sized avatar
💭
git clean -ffdx

Puneeth Puneeth-n

💭
git clean -ffdx
View GitHub Profile
@Puneeth-n
Puneeth-n / gmail_actions_example.html
Created February 26, 2016 03:13
Python script to send HTML email from command line
<!--
This is a sample email taken from https://developers.google.com/gmail/schemas/apps-script-tutorial
and used to test the GMail actions support.
-->
<html>
<head>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
@Puneeth-n
Puneeth-n / database.rb
Created February 10, 2016 12:16 — forked from clarkdave/database.rb
A Chef recipe for creating EBS volumes. See: http://clarkdave.net/2013/04/managing-ebs-volumes-with-chef/
# The database recipe should be included by any server running a DB. It creates
# a /data directory and, if on EC2, will mount an EBS volume here
directory '/data' do
mode '0755'
end
if node[:app][:ec2] || node[:cloud][:provider] == 'ec2'
aws = data_bag_item('aws', 'main')
include_recipe 'aws'
FROM ubuntu:14.04
MAINTAINER Mason Fischer <mason@thoughtbot.com>
RUN apt-get update && apt-get install -y nodejs

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit

Keybase proof

I hereby claim:

  • I am puneeth-n on github.
  • I am puneeth (https://keybase.io/puneeth) on keybase.
  • I have a public key whose fingerprint is RETU RN T HIS. PGP. GET_ FING ERPR INT( ); }

To claim this, I am signing this object:

@Puneeth-n
Puneeth-n / awk1line.txt
Created November 20, 2014 09:45
awk handy cheat sheet
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE:
:set nospell
:colorscheme django
nmap <leader>ts :%s/\s\+$//<CR>
; Global settings for redshift
[redshift]
; Set the day and night screen temperatures
temp-day=5700
temp-night=3500
; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature.
; 1 will gradually increase or decrease the screen temperature
transition=1
#!/bin/bash
# Based on https://github.com/krobertson/xenserver-automater/blob/master/usr/sbin/xe-set-hostname
# Adapted by Frederick Ding
# Detect if xenstore-read is available
XENSTOREREAD=`which xenstore-read`
if [ -e $XENSTOREREAD ]; then
# Filter the domU's name to a lowercase alphanumeric hyphenated hostname
NAME=`xenstore-read name | sed -e 's/[^[:alnum:]|-]/-/g' | tr '[:upper:]' '[:lower:]'`
@Puneeth-n
Puneeth-n / ttic.sh
Last active August 29, 2015 14:06 — forked from swarminglogic/ttic.sh
#!/bin/bash
function showHelp {
version=0.0.1
versionDate="2014-07-07"
echo "$0 - tic/toc timer pair
Usage: $0 [id] Stores initial time (w/optional id marker)
$0 [-u|--unique] Creates and returns unique id