Skip to content

Instantly share code, notes, and snippets.

@alimp5
alimp5 / WSL2-Kali.md
Created February 7, 2022 11:24
WSL2 - Kali Linux
@alimp5
alimp5 / requirements.txt
Created August 23, 2021 14:21 — forked from miraculixx/example.MD
Python multiprocess parallel selenium web scraping with improved performance
beautifulsoup4==4.6.3
certifi==2018.10.15
chardet==3.0.4
idna==2.7
lxml==4.2.5
requests==2.20.1
selenium==3.141.0
urllib3==1.24.1
@alimp5
alimp5 / infection_rate_visualization.py
Created March 18, 2021 05:23 — forked from chelseatroy/infection_rate_visualization.py
Example of Proxy Model InfectionRateVisualization
from visualizations.models import Visualization
class InfectionRateVisualization(Visualization):
class Meta:
proxy = True
def from_data(csvfile):
department_instances = []
infection_type = []
@alimp5
alimp5 / views.py
Created March 18, 2021 04:57 — forked from chelseatroy/views.py
Example of Proxy Model Dependency Injection
from __future__ import unicode_literals
from django.shortcuts import render
from models import Visualization
from exceptions import IncompleteDataException
from .forms import VisualizationForm
from django.contrib.auth.decorators import login_required
def _inject_visualization(name):
if name == "infection_rate_visualization":
@alimp5
alimp5 / models.py
Created March 18, 2021 04:45 — forked from chelseatroy/models.py
Example of Proxy Model Visualization
from django.db import models
class Visualization(models.Model):
name = models.CharField(primary_key=True, max_length=200)
description = models.TextField()
position = models.IntegerField(default=200)
def __repr__ (self):
return self.name
@alimp5
alimp5 / models.py
Created March 18, 2021 04:32 — forked from chelseatroy/models.py
Example of Giant Conditional in Django Model
from __future__ import unicode_literals
from django.conf import settings
from django.db import models
from django.utils import timezone
import numpy as np
from calendar import Calendar
from charts import HeatMap, PieChart
@alimp5
alimp5 / views.py
Created March 18, 2021 04:31 — forked from chelseatroy/views.py
Example of Calling Giant Conditional in View
from __future__ import unicode_literals
from django.shortcuts import render
from models import Visualization
from exceptions import IncompleteDataException
from .forms import VisualizationForm
from django.contrib.auth.decorators import login_required
@login_required
def transform(request):
@alimp5
alimp5 / Installing Python 3.7 from source on Ubuntu 18.04.md
Created December 9, 2020 07:06
Installing Python 3.7 from source on Ubuntu 18.04

Installing Python 3.7 from source on Ubuntu 18.04

# update system
sudo apt update && sudo apt upgrade -y

# install build tools and python prerequisites
sudo apt install build-essential libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev

# download and extract python
@alimp5
alimp5 / Base64_CheatSheet.md
Created October 26, 2019 04:19 — forked from Neo23x0/Base64_CheatSheet.md
Learning Aid - Top Base64 Encodings Table

Learning Aid - Top Base64 Encodings Table

MITRE ATT4CK - T1132 - Data Encoding

Base64 Code Mnemonic Aid Decoded* Description
JAB 🗣 Jabber $. Variable declaration (UTF-16)
TVq 📺 Television MZ MZ header
UEs 🏬 Upper East Side PK ZIP, Office documents
SUVY 🚙 SUV IEX PowerShell Invoke Expression
@alimp5
alimp5 / gist:9af5b103dbeb38547a7148c36c464dad
Created May 30, 2019 03:51 — forked from telendt/gist:607454
html_entity_decode in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import htmlentitydefs
import re
entity_re = re.compile(r'&(%s|#(\d{1,5}|[xX]([\da-fA-F]{1,4})));' % '|'.join(
htmlentitydefs.name2codepoint.keys()))