Skip to content

Instantly share code, notes, and snippets.

Avatar

Manpreet Singh junkblocker

View GitHub Profile
@junkblocker
junkblocker / song.rb
Created Sep 9, 2012 — forked from natew/song.rb
Rails model for parsing artist information from a song
View song.rb
class Song
# Regular expressions
RE = {
:featured => /(featuring | ?ft\.? |feat\.? |f\. |w\/){1}/i,
:remixer => / remix| rmx| edit| bootleg| mix| remake| re-work| rework| extended remix| bootleg remix/i,
:mashup_split => / \+ | x | vs\.? /i,
:producer => /^(produced by|prod\.? by |prod\. )/i,
:cover => / cover/i,
:split => /([^,&]+)(& ?([^,&]+)|, ?([^,&]+))*/i, # Splits "one, two & three"
:open => /[\(\[\{]/,
View mydaemon
#! /bin/sh
### BEGIN INIT INFO
# Provides: mydaemon
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mydaemon does stuff
# Description: this is an actual executable script, and should be saved in
# /etc/init.d/mydaemon.
@junkblocker
junkblocker / itunes_notifications.py
Last active Aug 29, 2015 — forked from codiez/itunes_notifications.py
Listen for distributed notifications from iTunes of the current song
View itunes_notifications.py
'''
This python script listens for distributed notifications from iTunes of new songs playing,
works alot better then constantly polling.
'''
import Foundation
from AppKit import *
from PyObjCTools import AppHelper
class GetSongs(NSObject):
def getMySongs_(self, song):
View print_contacts_from_address-book.py
import objc
import AddressBook as ab
import pprint as pp
def pythonize(objc_obj):
if isinstance(objc_obj, objc.pyobjc_unicode):
return unicode(objc_obj)
elif isinstance(objc_obj, ab.NSDate):
return objc_obj.description()
@junkblocker
junkblocker / ARCHANONIRC.md
Created Mar 23, 2016 — forked from zotherstupidguy/ARCHANONIRC.md
A Quick Guide for Anonymous and Pseudonymous irc
View ARCHANONIRC.md

##Weechat+Arch Linux+Tor ###A Quick Guide for Anonymous and Pseudonymous irc I'm going to assume you know what irc is, and generally how it works. If you haven't gotten that far watch a youtube video and try out some of the commands on an irc webclient somewhere. On Arch Linux to install Weechat you can run sudo pacman -S weechat or you can download it from the official website at http://weechat.net/download/.

You can also install Tor from the official repositories, but If you are going to be making multiple connections to irc networks and you want to keep your identities seperate, I would recommend installing the Tor Browser Bundle as well. This should be done from the Tor website, and you should check the GnuPG signature on the package before running it. The key they have been using to sign the packages with for the months that I have been verifying it i

@junkblocker
junkblocker / IRC client in pure bash 4
Created Mar 29, 2016 — forked from anonymous/IRC client in pure bash 4
IRC client written in pure bash using only bash builtin commands and no other binaries.
View IRC client in pure bash 4
#!/bin/bash
#no PATH, no way to accidently run any programs
PATH=''
#useful variables
term_height=0
term_width=0
term_scroll_height=0
status_line_row=0
@junkblocker
junkblocker / mac.sh
Created Sep 21, 2016 — forked from pwnsdx/disable.sh
Disable bunch of #$!@ in Sierra
View mac.sh
#!/bin/bash
# This is a draft but it works
# FIRST (I don't even know if it works but we'll assume yes)
# sudo launchctl list
# sudo launchctl disable system/netbiosd
# sudo launchctl disable system/parsecd
# sudo launchctl disable system/parentalcontrols.check
# sudo launchctl disable system/airportd
View detect.sh
#!/bin/bash
echo "Please wait..."
# Look for suspect files
/usr/bin/find -E {,~}/Applications -iregex '.*\.app\/(.*\.DS_Store|Icon.{1})$' > /tmp/.suspectfiles
# Check suspect files
appsCounter=0
while read path; do
View foo.js
/* jshint maxerr : 10000 */
/* jslint browser : true */
/* jslint esversion : 6 */
try {
console.log('foo')
console.log('foo')
console.log('foo')
console.log('foo')
console.log('foo')
@junkblocker
junkblocker / perfectelementary.bash
Created Jan 7, 2017
HowTo Install the perfect Elementary-OS
View perfectelementary.bash
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'