Skip to content

Instantly share code, notes, and snippets.

@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`
@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 / sms-trends-android
Created April 8, 2013 18:22
SMS trends from Android phone
@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 }
#!/usr/bin/python
import random
import unittest
on_disk = None
class Error(Exception):
pass
@aravindavk
aravindavk / find_gfid_issues.py
Last active November 15, 2015 09:12
python find_gfid_issues.py <BRICK_PATH>
import sys
import os
import xattr
import uuid
from errno import ENODATA
IGNORE_DIRS = [".glusterfs", ".trashcan"]

Source Tree

$SRC/
  - xlators/
      - features/
          - changelogs/
              - lib/ # Changelog API
              - src/ # Changelog Translator
  - geo-replication/
  • src/ # gsyncd shell and other scripts required for Geo-rep create
import uuid
import xattr
import os
from hashlib import md5
import sys
IGNORE_DIRS = [".glusterfs", ".trashcan"]
PFX = "user.pgfid"
import xattr
import sys
import os
ROOT_GFID = "00000000-0000-0000-0000-000000000001"
PFX = "user.pgfid"
def symlink_gfid_to_path(brick, gfid):
@aravindavk
aravindavk / glusterrest_glusterd_1.0.md
Last active December 21, 2015 10:45
Gluster REST Server - A solution for Glusterd 1.0

Root Endpoint and Version

Root endpoint will be http(s)://hostname/v1

Client Errors

Unauthorized access will result in 401 UnAuthorized response.

HTTP/1.1 401 Unauthorized

Content-Type: application/json