Skip to content

Instantly share code, notes, and snippets.

View samundra's full-sized avatar
🔬
refine details

Samundra samundra

🔬
refine details
View GitHub Profile
@samundra
samundra / get_sitemap_url.py
Created March 25, 2016 05:30
Get the urls from the sitemap with python and beautiful soup
import sys
import urllib
from bs4 import BeautifulSoup
def get_sitemap_url(sitemap_url):
try:
opener = urllib.urlopen(url=sitemap_url, data=None)
xml = opener.read()
# fp = open("../../static/sitemap.xml", "r")
@samundra
samundra / preferences.sublime-settings.js
Last active August 2, 2017 05:12
Sublime User Settings
{
"SublimeLinter":
{
"linters":
{
"phpcs":
{
"cmd": "phpcs"
}
}
@samundra
samundra / google_translate.py
Last active June 10, 2016 10:53
Mutate_google_translate.py
#!/usr/bin/python2
#!encoding = utf-8
# filename: ~/.config/Mutate/scripts
import re
import urllib
import urllib2
import json
import sys
reload(sys)
@samundra
samundra / touchpad.sh
Last active June 13, 2016 14:45
Touchpad scripts
#!/bin/bash
#filename: /usr/local/bin/touchpad.sh
declare -i ID
ID=`xinput list | grep -Eio '(touchpad|glidepoint)\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
declare -i STATE
STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`
if [ $STATE -eq 1 ]
then
xinput disable $ID
@samundra
samundra / cmus-depencies.sh
Last active June 30, 2016 20:03
Cmus dependencies installations
#!/bin/sh
sudo apt-get update
sudo apt-get install -y libncursesw5-dev
sudo apt-get install -y libpulse-dev
sudo apt-get install -y libasound2-dev
sudo apt-get install -y libroar-dev
sudo apt-get install -y libao-dev
sudo apt-get install -y libjack-dev
sudo apt-get install -y libsamplerate0-dev
sudo apt-get install -y libcdio-dev
@samundra
samundra / kickass.sh
Created July 1, 2016 10:10
Extract urls from kickass and saves .torrent link from it.
#/bin/bash
if [ "$#" != 2 ]; then
echo "Usage : kickass [full_torrent_url] [torrent_file_to_save.torrent]"
exit 1;
fi
NEWLINE="\n"
red='\033[0;31m'
green='\033[0;32m'
light_red='\033[0;31m'
yellow='\033[1;33m'
@samundra
samundra / available_forms.php
Last active August 5, 2016 06:20
Parses the content, search for the form and assign respective elements to array keys as `formAction`, 'formId', 'formMethod' that can be checked against for easy assertions. When multiple forms are found they will be stored on arrays with key 'availableForms'.
<?php
/**
* Parses the content, search for the form and assign respective elements to
* array keys as 'formAction', 'formId', 'formMethod' that can be checked against
* for easy assertions. When multiple forms are found they will be stored on
* arrays with key 'availableForms'.
*
* @param string $content HTML content for the form
*
@samundra
samundra / Employee.java
Last active August 7, 2016 14:05
Create class dynamically in a loop and use scanner object for input
package com.fivedots.tutorials;
import java.util.Scanner;
public class Employee {
private int id;
private String firstname;
private String lastname;
private String phone;
private String address;
#!/usr/bin/perl -T
use strict;
use warnings;
#
## Calomel.org ,:, Download Youtube videos and music using wget
## Script Name : youtube_wget_video.pl
## Version : 0.45
## Valid from : September 2014
@samundra
samundra / adminer.conf
Created December 6, 2016 09:02
adminer nginx configuration
server {
listen 80;
listen [::]:80;
root /var/www/adminer;
index index.php index.html index.htm;
server_name adminer.dev;
location / {
autoindex on;