Skip to content

Instantly share code, notes, and snippets.

View aniket91's full-sized avatar

Aniket Thakur aniket91

View GitHub Profile
@aniket91
aniket91 / got-spoiler-killer.js
Last active June 12, 2016 05:25
Greasemonkey script to blackout Game of thrones spoiler posts on facebook
// ==UserScript==
// @name Spoiler Killer
// @include http://*.facebook.com/*
// @include https://*.facebook.com/*
// @require http://code.jquery.com/jquery-1.7.1.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant none
// @version 1
// @namespace http://opensourceforgeeks.blogspot.in/
// @description Blacken facebook posts possibly containing Game of Thrones spoilers.
@aniket91
aniket91 / PageRedirectScript.js
Last active October 3, 2016 14:24
GM script to redirect a URL to new URL
// ==UserScript==
// @name PageRedirectScript
// @include http://domain1/*
// @include https://domain1/*
// @run-at document-start
// @description Redirects page from one domain to another. Note if domain1 is down you need to add entry in /etc/hosts file as "ipOfDomain2 domain1 domain2". You can get the ipOfDomain2 as "ping domain2"
// @namespace http://opensourceforgeeks.blogspot.in/
// @version 1
// @grant none
// ==/UserScript==
@aniket91
aniket91 / noWhiteBackgroundColor-gray.js
Created December 18, 2016 09:00
GM script that automatically changes background colors that are too white.
// ==UserScript==
// @id noWhiteBackgroundColor-gray
// @name noWhiteBackgroundColor-gray
// @version 1.0
// @namespace
// @author athakur
// @description GM script that automatically changes background colors that are too white.
// @include *
// @exclude
// @run-at document-start
@aniket91
aniket91 / youtube-replayer.user.js
Last active November 11, 2017 09:46
Greasemonkey script to automatically replay finshed songs in youtube
// ==UserScript==
// @name YoutubeReplayScript
// @include http://*.youtube.com/*
// @include https://*.youtube.com/*
// @require http://code.jquery.com/jquery-1.7.1.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @description Replays songs automatically once it is finished playing.
// @namespace http://opensourceforgeeks.blogspot.in/
// @version 1
// @grant none
@aniket91
aniket91 / squid.conf
Created January 18, 2018 16:38
Sample squid proxy configuration file for basic usernmae and password authentication
#For more detials refer http://opensourceforgeeks.blogspot.in/2018/01/how-to-set-up-squid-proxy-with-basic.html
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
@aniket91
aniket91 / creategif.sh
Last active February 27, 2018 15:30
Shell script to create a gif out of a video using ffmpeg
#!/bin/bash
#----------------------------------------------------
# Author : athakur
# Version : 1.0
# Create Date : 27/02/2018
# Update Date : 27/02/2018
# Description : Create gif from a video
# Sample usage : ./creategif.sh input.mp4 output.gif
# ffmpeg static build can be downloaded from https://johnvansickle.com/ffmpeg/
#----------------------------------------------------
@aniket91
aniket91 / sqs-consumer.js
Created March 18, 2018 16:53
Cosnumer for AWS SQS queues
var AWS = require('aws-sdk');
//TODO : change this region based in your SQS service region
AWS.config.update({region: 'ap-south-1'});
var sqs = new AWS.SQS({apiVersion: '2012-11-05'});
//TODO : change this URL based in your queue URL
var queueURL = "https://sqs.ap-south-1.amazonaws.com/499222264523/my-queue";
var params = {
AttributeNames: [
"SentTimestamp"
@aniket91
aniket91 / Calculator.java
Last active July 3, 2018 04:51
Basic Calculator program in Java
package com.osfg;
import java.util.Scanner;
/**
*
* @author aniket
*
* Basic Calculator program in Java
*/
@aniket91
aniket91 / node-https.js
Created August 11, 2018 05:47
A sample nodejs code to make https call using standard https module
/**
* Node.js code to demonstrate https calls.
* @author athakur
*/
const https = require("https");
var startDemo = function () {
console.log("starting demo code");
executeHttps(function (err, data) {
if (err) {
@aniket91
aniket91 / update-lambda.sh
Last active November 26, 2019 20:24
Shell script to update lambda code and environment variables to multiple regions and environments using AWS CLI
#!/bin/bash
#----------------------------------------------------
# Author : athakur
# Version : 1.0
# Date : 10/02/2018
# Description : Deployment script to update lambda code and env variables
# Sample usage :
# Local : ./update-lambda.sh test aws-admin fileb://../lambda.zip
# Dev : ./update-lambda.sh dev aws-admin fileb://../lambda.zip
# QA : ./update-lambda.sh qa aws-admin fileb://../lambda.zip