Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
import random
import unittest
on_disk = None
class Error(Exception):
pass
@aravindavk
aravindavk / gist:2b4298eeb2d8f949224b
Created September 24, 2014 12:15
Use Shared lib created in Rust from Python
#!/usr/bin/env python
"""
Consumer example to use the shared object created in Rust.
Ref: http://blog.skylight.io/bending-the-curve-writing-safe-fast-native-gems-with-rust/
Rust program: points.rs
use std::num::pow;
pub struct Point { x: int, y: int }
struct Line { p1: Point, p2: Point }
@aravindavk
aravindavk / sms-trends-android
Created April 8, 2013 18:22
SMS trends from Android phone
@aravindavk
aravindavk / file-by-gfid
Last active December 14, 2015 23:09
glusterfs adds 'trusted.gfid' as extended attribute to the files and creates hard link to that file in .glusterfs directory. This script accepts gfid as parameter and finds respective file in system.
#!/bin/bash
# glusterfs adds 'trusted.gfid' as extended attribute to the files
# and creates hard link to that file in .glusterfs directory
# This script accepts gfid as parameter and finds respective file in
# system
# Example Usage:
# ./file-by-gfid f6b2307a-8d3f-4e61-94eb-c565f48240fb
@aravindavk
aravindavk / udayavani_visheshanka_2010.sh
Created November 15, 2010 07:49
Udayavani Deepavali visheshanka download script
#!/bin/sh
# Cover page
wget "http://74.127.61.106/epaper/Deepavali_Visheshanka/Deepa_2010_Cover.pdf"
# all pages
i=3
while [ $i -lt 308 ]
do
start=`printf "%03d" $i`