Skip to content

Instantly share code, notes, and snippets.

View maxking's full-sized avatar
:octocat:

Abhilash Raj maxking

:octocat:
View GitHub Profile
# To run this script first install the 'gitpython' package from pip.
# $ pip install gitpython
#
# Usage:
# python git_grep.py repo_path filename regex
#
import os
import sys
import subprocess
@maxking
maxking / intern_project_discussion.md
Last active September 12, 2016 21:46
Defense against privilege escalation attacks in Linux Kernel
window.addEventListener("load", function() { alert("hello!");});
@maxking
maxking / grub.cfg
Last active July 6, 2016 20:06
Grub.cfg to load ikgt module in grub.
# CoreOS grub oem config to add coreos-ikgt support to the grub config of the OS.
# The ikgt_pkg.bin shoudl already be inside /boot/coreos and this file should be
# placed inside /dev/sda6 which is by default mounted at /usr/share/oem/ in coreos
# production build.
#
# **Note**:
# Please read the comments in the file below before using the configuration. It might
# cause temporarily to wreck your system otherwise.
set default='coreos-ikgt'
@maxking
maxking / get_files.py
Last active April 17, 2016 10:04
Download files of a particular type from a webpage.
#! /usr/bin/env python3
"""
Author: Abhilash Raj <raj.abhilash1@gmail.com>
This script is used to download all the files of a particular type linked on a
web page. This probably can be accomplished easily by some other tools as well,
but I wrote this to download some assignments of my own.
Usage: python get_files.py -p <address_of_web_page> -f <filtype>
@maxking
maxking / server.c
Last active March 17, 2016 10:07
simple echo server demonstration
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
void dostuff(int);
void error(char *msg)
{
perror(msg);
@maxking
maxking / emacs-email-setup.md
Created December 26, 2015 08:16 — forked from areina/emacs-email-setup.md
Manage your email in emacs with mu4e

Manage your gmail account in emacs with mu4e

There're a lot of combinations to manage your email with emacs, but this works for me. I've a backup and I can manage my daily email.

The stack:

  • emacs
  • offlineimap
  • mu
  • mu4e
@maxking
maxking / screen-switch
Created September 20, 2015 23:26
This is a script to auto-enable/disable an external display. I bind it to the screen-switch button used in windows and it works like a charm.
#!/usr/bin/env bash
xrandr | grep VGA | grep -w connected >/dev/null
echo $?
if [[ "$?" -lt 1 ]]
then
notify-send "Extending desktop to VGA screen"
xrandr --output LVDS1 --auto --output VGA1 --auto --left-of LVDS1 --primary
else
xrandr --output LVDS1 --auto --primary
@maxking
maxking / indiabix.py
Last active August 29, 2015 14:17
Given URL of the first page of a category from Indiabix.com, downloads all the questions with answers.
"""
This script downloads all the questions from Indiabix.com from the url of a given category.
It can easily be customized (if you know basic python) to download all the questions from
all the categories. It also downloads their answers.
Author: Abhilash Raj <raj.abhilash1@gmail.com>
Date: 17th March 2015
Copyright (c) 2015 Abhilash Raj <Abhilash Raj>
@maxking
maxking / plsync.sh
Last active August 29, 2015 14:13 — forked from mkaito/plsync.sh
#!/usr/bin/env zsh
# Takes all my playlists from ~/.mpd/playlists, fixes them up, and creates a
# folder for each, along with the music they reference.
# The sync stage requires an sshd server to run on your phone, as well as the rsync executable.
# - http://linux.wxs.ro/2011/08/05/rsync-your-android/
MPD_MUSIC_ROOT="${HOME}/Music" # Root of your MPD library
MPD_PLAYLIST_ROOT="${HOME}/.mpd/playlists" # MPD playlist folder