Skip to content

Instantly share code, notes, and snippets.

View kaushikgandhi's full-sized avatar
🎯
Focusing

kaushik gandhi kaushikgandhi

🎯
Focusing
  • WebPreneur
  • india
View GitHub Profile
#!/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
"
@kaushikgandhi
kaushikgandhi / vkcom_audio_download.py
Created January 16, 2016 19:51 — forked from st4lk/vkcom_audio_download.py
Python: vkontakte.ru (vk.com) audio music downloader
# -*- coding: utf-8 -*-
"""
Скрипт для скачивания музыки с сайта vkontakte.ru (vk.com)
Запуск:
python vkcom_audio_download.py
Принцип работы:
Скрипт проверяет сохраненный access_token. Если его нет или срок истек,
то открывается страница в браузере с запросом на доступ к аккаунту.
@kaushikgandhi
kaushikgandhi / auto-blogger.py
Created January 18, 2016 22:51 — forked from Ricky-Wilson/auto-blogger.py
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
kaushikgandhi / gist:663e6e47d8a42025e848e454f5e064c4
Created October 13, 2016 10:08
Nginx SSL Configuration Steps for passing all vulnerability tests.( Qualys SSL Test )
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 / PegPay.py
Created September 21, 2018 05:21
PegPay Python Sample Code
#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 / jinja2_test.py
Last active June 11, 2019 06:25
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
kaushikgandhi / webp_converter.sh
Created June 28, 2021 13:44
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
kaushikgandhi / Scrape_Clouflare_Protected_Site.py
Last active November 19, 2022 14:19
Bypass Cloudflare Protected site
##Scrape_Clouflare_Protected_Site
## More Info: https://pypi.org/project/undetected-chromedriver/
## pip install undetected-chromedriver selenium
## https://stackoverflow.com/questions/68289474/selenium-headless-how-to-bypass-cloudflare-detection-using-selenium
import undetected_chromedriver as uc
from selenium import webdriver
options = webdriver.ChromeOptions()
options.headless = True
driver = uc.Chrome(options=options)
@kaushikgandhi
kaushikgandhi / download_with_tornado.py
Created February 20, 2024 09:58
Download a File Asynchronously From Web And Serve to Download Using Python Tornado Framework
import asyncio
import tornado
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
class MainHandler(tornado.web.RequestHandler):
@gen.coroutine
def get(self):
url = self.get_argument('url')
filename = self.get_argument('filename')