Skip to content

Instantly share code, notes, and snippets.

View abdelhai's full-sized avatar
🇵🇸
✌️

mustafa abdelhai

🇵🇸
✌️
View GitHub Profile
@miguelmota
miguelmota / auth.go
Created February 11, 2019 21:26
Golang AWS Cognito Validate JWT token
package auth
import (
"crypto/rsa"
"encoding/base64"
"encoding/binary"
"encoding/json"
"fmt"
"io/ioutil"
"log"
@clucle
clucle / boto3_auth.py
Last active August 26, 2021 14:59
boto3 auth flow
import os
from flask import Flask, render_template, redirect, url_for, request
import boto3
from botocore.exceptions import ClientError
app = Flask(__name__)
APP_CLIENT_ID = os.getenv('COGNITO_CLIENT_ID')
@app.route('/')
@kjenney
kjenney / eks.yml
Created July 18, 2018 20:13
CloudFormation EKS
# kubernetes
#
#
# author: kjenney
# Deploys an EKS cluster with required role and security group
AWSTemplateFormatVersion: 2010-09-09
Description: Deploys an EKS cluster with required role and security group
Parameters:
@projectivemotion
projectivemotion / Advanced Bash Usage CheatSheet.md
Last active August 25, 2018 16:28
Cheatsheet of advanced bash commands presented in Introduction to Advanced Bash Usage - James Pannacciulli. Youtube: https://youtu.be/uqHjc7hlqd0
@abdelhai
abdelhai / code.py
Created January 4, 2016 22:33
this is a test description
#! /usr/bin/env python
"""Conversions to/from quoted-printable transport encoding as per RFC 1521."""
# (Dec 1991 version).
__all__ = ["encode", "decode", "encodestring", "decodestring"]
ESCAPE = '='
MAXLINESIZE = 76
@0XDE57
0XDE57 / config.md
Last active June 29, 2024 13:22
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@abdelhai
abdelhai / fb_ages.py
Created April 11, 2015 00:57
ages from facebook comments, probably my first python "program" ever
# first: pip install requests
# second: python fb_ages.py
import requests
import json
import re
from collections import Counter, OrderedDict
ages = []
@jmorton
jmorton / Dockerfile
Last active March 27, 2019 08:31
Install Python 3.4.2 + mod_wsgi on CentOS
FROM centos:centos6
MAINTAINER jmorton@usgs.gov
# Apache
RUN yum install -y httpd httpd-devel
RUN chkconfig httpd on
RUN apachectl start
# Dependencies
RUN yum groupinstall -y "Development tools"
@pawelmhm
pawelmhm / gist:8917867
Last active January 23, 2024 15:03
Scrapy spider crawling Stack Overflow
from scrapy.spider import Spider
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from scrapy.item import Item, Field
import urllib
class Question(Item):
tags = Field()
answers = Field()
@denji
denji / http-benchmark.md
Last active June 20, 2024 14:22
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)