Skip to content

Instantly share code, notes, and snippets.

# Steps for compiling tremor succesfully on centos6
# drop to centos6 environment
# https://hub.docker.com/_/centos
docker pull centos:6.6
docker run -i -t centos:6.6 /bin/bash
cd ~
# to get the needed source code
# (nss update resolves ssl issues during downloads)
@anupdhml
anupdhml / secret_santa.py
Last active August 29, 2015 14:10
Play secret santa!
#!/usr/bin/env python
# Randomly assign secret santas for a group of players, based on a json file
# Handles blacklist logic (eg: couples might not want to be paired)
# Also you are never your own secret santa.
# Optionally send email notification to the players, in case you want it to be
# 'secret' for you too.
#
# By <[email protected]> Nov 28 2014
#
@anupdhml
anupdhml / pdf_to_cbz.sh
Created November 28, 2014 22:08
Convert pdf to cbz
#!/bin/bash
# Simple script to convert pdfs to cbz (good for comics)
for pdf in *.pdf; do
echo "Converting ${pdf}..."
filename="${pdf%.*}"
pdftoppm -jpeg "$pdf" "$filename" &&
mkdir "$filename" &&
mv *.jpg "$filename" &&
zip -rq "$filename".cbz "$filename"
@anupdhml
anupdhml / gmusic_to_mp3.py
Created November 28, 2014 22:07
Tag the files from gmusic app cache
#!/usr/bin/env python
# -*-coding:utf-8 -*
# mp3 files from gmusic app's cache don't have id3 tags assosciated with them.
# This assigns tags for them based on music.db found in the app dirs.
# Useful if you want to just copy mp3 from your phone and use them somewhere
# (instead of waiting to download them from the gmusic web (or desktop) app)
#
# Run it from the mp3 folder, and keep music.db in the same folder
#
# By <[email protected]>, October 2014
@anupdhml
anupdhml / lastfm_to_gmusic.py
Last active November 16, 2017 06:01 — forked from Timmmm/lastfm_to_gmusic.py
Lastfm loved tracks/playlist to Google Music playlist, either with songs from your library or from all access. Order of songs in lastfm is preserved and can export/load them from a json file.
#!/usr/bin/env python
# Lastfm loved tracks/playlist to Google Music playlist, either with songs from your library or from all access
# Order of songs in lastfm is preserved.
# First export the lastfm data in a json file, and then import it into Google Music
# You can edit the intermediate json file if you wish.
#
# Based on this script.
# https://gist.github.com/Timmmm/6572592
#
@anupdhml
anupdhml / sort.c
Created November 28, 2013 15:08
basic emulation of the unix sort command
/*
* ============================================================================
* sort.c
* basic emulation of the unix sort command. Default sort is in dictionary order
* Input: a file with numbers. Args -r (reverse), -u (unique), -n (num sort)
* Output: sorted list
*
* <[email protected]>, 15/04/12 20:16:35
* =============================================================================
*/
@anupdhml
anupdhml / dog.c
Created November 28, 2013 15:08
Emulates the unix command cat, with a few new tricks added
/* Emulates the unix command cat, with a few new tricks added
* By <[email protected]>
* April 7, 2010
*
* Program arguments
* -r: reverses the letters of the input
* -c N, where N is a no between 0 and 25: ciphers the input by adding N to
* the ASCII value of each letter and printing the result as a character
*/
@anupdhml
anupdhml / aur_install.sh
Created November 21, 2013 04:14
Script combining cower, makepkg and pacman for Arch Linux, to download packages from AUR
#!/bin/bash
# A simple script combinig cower, makepkg and pacman
# Usage: aur_install.sh package1 package2...
# <[email protected]>
# folder to store the done packages
builds_folder="$HOME/builds"
done_folder_name="BUILT/"
ignore_folder_name="IGNORE/"
@anupdhml
anupdhml / tmux-coding-session.sh
Last active December 28, 2015 22:59
Script to start tmux with all the necessary windows
#!/bin/bash
# Script to fire up tmux with all the important windows
# By anup
SESSION_NAME="coding"
# programs and directories
#cd ${HOME};
cmds="
vi $HOME/Desktop/tiltfactor/todo;
@anupdhml
anupdhml / spotify-launcher.sh
Created November 21, 2013 04:08
A script to start spotify with ad-mute, notification and auto storage-clean features
#!/bin/bash
# A script to start spotify with ad-mute, notification and auto storage-clean features
# By <[email protected]>
# Ad mute based on
# http://pcworldsoftware.kilu.net/files/link_spotify-admute.php
# https://gist.github.com/pcworld/3198763/#comment-857143
# Notification function depends on https://code.google.com/p/spotify-notify/
# Place the script in your ~/bin. Or modify script accordingly.