Skip to content

Instantly share code, notes, and snippets.

View andanhm's full-sized avatar

Andan H M andanhm

View GitHub Profile
@andanhm
andanhm / iso_time
Created December 28, 2018 11:28
Python India ISO Time
#!/usr/bin/python
import pytz
from datetime import datetime, timedelta
intz = pytz.timezone('Asia/Kolkata')
print (datetime.now(intz)+ timedelta(days=1)).strftime("%Y-%m-%d %H:%M %p")
@andanhm
andanhm / docker-compose.yml
Last active February 19, 2018 09:09
Sonar MySQL Docker composer
version: '3'
services:
db:
container_name: mysql_sonarqube
image: mysql:latest
ports:
- "3308:3306"
environment:
@andanhm
andanhm / jwt.py
Last active December 26, 2023 10:33
Decodes JWT base64 encoded token without the JWT singing key (Offline)
import base64
import json
def decode(token):
# Decodes JWT base64 encoded token
try:
alg, payload, signature = token.split(".")
payload += '=' * (-len(payload) % 4)
decode_payload = json.loads(base64.b64decode(payload).decode("utf-8"))