Skip to content

Instantly share code, notes, and snippets.

@ajayverghese
ajayverghese / graphite-diskusage.py
Created February 14, 2013 18:50
calculate space required to store graphite data
#!/usr/bin/python
'''
Calculate disk space required for given graphite retention policy and number of
metrics
'''
#######################################
# retention policy
@ajayverghese
ajayverghese / inode-usage.sh
Created February 14, 2013 21:24
get inode usage
#!/bin/sh
echo "Detailed Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"
@ajayverghese
ajayverghese / gist:9612118
Created March 18, 2014 01:52
recursively set whisper aggregation policy
find . -name counter.wsp -execdir whisper-set-aggregation-method.py "{}" sum \;
@ajayverghese
ajayverghese / collectd.conf
Created March 25, 2014 20:37
Sample collectd configuration to fetch jetty and jvm metrics for monitoring (and send to graphite)
#
# Config file for collectd(1).
# Please read collectd.conf(5) for a list of options.
# http://collectd.org/
#
##################
# Global settings
##################
@ajayverghese
ajayverghese / gist:66b368617585204b11f8
Created December 9, 2014 22:21
Perforce diff for changeset
#!/bin/sh
# Display the diff for files in a given changeset
p4 opened -c $1 | sed -e 's/#.*$//' | p4 -x - diff
@ajayverghese
ajayverghese / gcs_price_calculator.py
Last active August 29, 2015 14:18
Approximate price calculation when using google cloud storage
#!/usr/bin/env python
'''
Calculate price for GCS usage
Prices as on Mar 31 2015 [https://cloud.google.com/storage/pricing]
'''
def enum(**named_values):
return type('Enum', (), named_values)
@ajayverghese
ajayverghese / win-iso-to-usb-on-macos.md
Created December 3, 2022 21:01
Create bootable USB from windows ISO on Mac
  • Run brew install wimlib on mac
  • Format USB thumbdrive with Fat32. Name the partition to something relevant such as win11pro
  • Mount the windows ISO on Mac by double clicking the image.
  • The mountpoints of the USB and the ISO will be in /Volumes. For example, windows ISO at /Volumes/CCCOMA_X64FRE_EN-US_DV9 and USB at /Volumes/win11pro

Run the following

export WINISO="/Volumes/CCCOMA_X64FRE_EN-US_DV9" 
export USB="/Volumes/win11pro"