Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

kaushik gandhi kaushikgandhi

🎯
Focusing
  • WebPreneur
  • india
View GitHub Profile
@kaushikgandhi
kaushikgandhi / webp_converter.sh
Created Jun 28, 2021
Shell command One liner for converting all images in a directory to webp format
View webp_converter.sh
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
kaushikgandhi / jinja2_test.py
Last active Jun 11, 2019
How to perform a jinja2 test for your flask app
View jinja2_test.py
#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
kaushikgandhi / PegPay.py
Created Sep 21, 2018
PegPay Python Sample Code
View PegPay.py
#pip install suds-jurko
#CC=clang sudo -E pip install pycrypto
from suds.client import Client
url="https://test.pegasus.co.ug:8019/pegpaytelecomsapi/PegPayTelecomsApi.asmx?WSDL"
client = Client(url)
print client ## shows the details of this service
from Crypto.Util.asn1 import DerSequence
@kaushikgandhi
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 :
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
Fix OpenSSL Padding Oracle vulnerability :
https://gist.github.com/ArturT/bc8836d3bedff801dc324ac959050d12
ADD SSL protocols:
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
@kaushikgandhi
kaushikgandhi / auto-blogger.py
Created Jan 18, 2016 — forked from Ricky-Wilson/auto-blogger.py
Blogger Automatic Content Generation and Publication
View auto-blogger.py
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
kaushikgandhi / vkcom_audio_download.py
Created Jan 16, 2016 — forked from st4lk/vkcom_audio_download.py
Python: vkontakte.ru (vk.com) audio music downloader
View vkcom_audio_download.py
# -*- coding: utf-8 -*-
"""
Скрипт для скачивания музыки с сайта vkontakte.ru (vk.com)
Запуск:
python vkcom_audio_download.py
Принцип работы:
Скрипт проверяет сохраненный access_token. Если его нет или срок истек,
то открывается страница в браузере с запросом на доступ к аккаунту.
View install_wifi_access_point.sh
#!/bin/bash
### Setup a wifi Access Point on Ubuntu 12.04 (or its derivatives).
### make sure that this script is executed from root
if [ $(whoami) != 'root' ]
then
echo "
This script should be executed as root or with sudo:
sudo $0
"