Skip to content

Instantly share code, notes, and snippets.

View maxking's full-sized avatar
:octocat:

Abhilash Raj maxking

:octocat:
View GitHub Profile
@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
@maxking
maxking / cb-exit
Last active August 29, 2015 14:06 — forked from lanrat/cb-exit
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
import os
import getpass
class cb_exit:
def disable_buttons(self):
# !/bin/sh
# apt-fast v0.02 by Matt Parnell http://www.mattparnell.com, this thing is fully open-source
# if you do anything cool with it, let me know so I can publish or host it for you
# contact me at admin@mattparnell.com
# Special thanks to Travis/travisn000 from the PCLinux Forums for making improvements that allow
# for more complex apt-get commands. See the thread: http://www.pclinuxos.com/forum/index.php/topic,66385.0.html
# Use this just like apt-get for faster package downloading. Make sure to have axel installed.
#!/usr/bin/env python3
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.headerregistry import Address
# Create the base text message.
msg = MIMEMultipart('related')
#!/usr/bin/env python3
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.headerregistry import Address
# Create the base text message.
msg = MIMEMultipart('related')