Skip to content

Instantly share code, notes, and snippets.


kaushik gandhi kaushikgandhi

  • WebPreneur
  • india
View GitHub Profile
kaushikgandhi /
Created Jun 28, 2021
Shell command One liner for converting all images in a directory to webp format
for i in *;do inpt="$i"; arrIN=(${inpt//./ }); convert $i ./webp/${arrIN[0]}.webp;done
#convert command comes in handy if you have imagemagick and webp installed or else run
#sudo apt-get install webp imagemagick
kaushikgandhi /
Last active Jun 11, 2019
How to perform a jinja2 test for your flask app
#Purpose of this code is to test your flask app for jinja2 rendering issue
#If you have a large database and your jinja2 code can break due to uneven db rows, this will serve the purpose
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash,send_from_directory
import MySQLdb,json
import datetime
app = Flask(__name__, static_url_path='/static')
kaushikgandhi /
Created Sep 21, 2018
PegPay Python Sample Code
#pip install suds-jurko
#CC=clang sudo -E pip install pycrypto
from suds.client import Client
client = Client(url)
print client ## shows the details of this service
from Crypto.Util.asn1 import DerSequence
kaushikgandhi / gist:663e6e47d8a42025e848e454f5e064c4
Created Oct 13, 2016
Nginx SSL Configuration Steps for passing all vulnerability tests.( Qualys SSL Test )
View gist:663e6e47d8a42025e848e454f5e064c4
Add SSL ciphers :
Fix OpenSSL Padding Oracle vulnerability :
ADD SSL protocols:
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
kaushikgandhi /
Created Jan 18, 2016 — forked from Ricky-Wilson/
Blogger Automatic Content Generation and Publication
from gdata import service
import gdata
import atom
import feedparser
from time import *
banner = """
Blogger Automatic Content Generation and Publication
Coded by Ricky L. Wilson
Post entries from RSS feeds to a blogger blog using Googles Blogger API.
kaushikgandhi /
Created Jan 16, 2016 — forked from st4lk/
Python: ( audio music downloader
# -*- coding: utf-8 -*-
Скрипт для скачивания музыки с сайта (
Принцип работы:
Скрипт проверяет сохраненный access_token. Если его нет или срок истек,
то открывается страница в браузере с запросом на доступ к аккаунту.
### Setup a wifi Access Point on Ubuntu 12.04 (or its derivatives).
### make sure that this script is executed from root
if [ $(whoami) != 'root' ]
echo "
This script should be executed as root or with sudo:
sudo $0