Skip to content

Instantly share code, notes, and snippets.

@nileshgr
nileshgr / loadtweetarchive.php
Last active December 17, 2015 01:49
Import Twitter Archive into Tweet Nest.
BACKUP YOUR EXISTING DB IF ANY!!!
Download your Twitter Archive, extract -- get a fresh one.
Upload data/js/tweets to your server.
Login to server and execute the following commands:
mv tweets tweets_src
mkdir tweets
cd tweets
@nileshgr
nileshgr / gist:5106229
Last active December 14, 2015 15:09
Shell snippet (zsh/bash) to convert / in id3tags (Flyte songs) to comma followed by space
NOTE -- You need eyeD3 python library and id3lib (C++ library) for the commands eyeD3 and id3info respectively.
find -name '*.mp3' | while IFS= read -r file; do
artists_org=$(id3info "$file" | grep TPE1 | awk -F ': ' ' { print $2 }')
artists_new=$(echo $artists_org | sed 's@/@, @g' | sed 's/ *$//g')
eyeD3 -a "$artists_new" "$file"
done
@nileshgr
nileshgr / gist:3768589
Created September 23, 2012 02:26
Gitolite-Trac post-recieve hook
#!/bin/bash
# Gitolite-Trac post-receive hook
# Script written by Nilesh Govindrajan; http://nileshgr.com
# Updated by giotti to support multiple repositories.
# Assumptions:
# 1: all trac environments are saved under one common directory
# defined in tracenv. e.g. /path/to/all/my/trac/envs
# 2: all repositories of an environment follow the naming-pattern
# <environment><delimeter><repository name>[<delimeter><repository name continued>...],
# e.g. someproject-somerepository, or someproject-somerepository-with-extra-text
@nileshgr
nileshgr / gist:3388917
Created August 18, 2012 18:32
Delete all twitter DMs using this python script
#!/usr/bin/python2
# Go to dev.twitter.com/apps and create a new app; put the information here.
# You need the tweepy library.
consumer_secret = ''
consumer_key = ''
access_token_key = ''
access_token_secret = ''