sudo apt update
sudo apt install software-properties-common -y
#!/bin/bash | |
# Written by ChatGPT with some human help 🙂 | |
# Loop through all apps in your project | |
for app in $(python manage.py showmigrations -l | grep -v '^\[ \]'); do | |
echo "Deleting migration files for $app..." | |
# Delete all migration files except __init__.py | |
find "$app/migrations" -name '00*.py' -not -name '__init__.py' -exec rm {} \; |
/* | |
Author: Tobe :) | |
ZKP Circuits for a Game of Battleship | |
Circom: https://github.com/iden3/circom | |
3rd-Party circuits gotten from: https://github.com/iden3/circomlib | |
*/ | |
pragma circom 2.1.5; |
""" | |
A cleaner approach to temporarily creating unmanaged model db tables for tests | |
""" | |
from unittest import TestCase | |
from django.db import connections, models | |
class create_unmanaged_model_tables: | |
""" |
""" | |
Vignere (Keyword) Cipher implementation in Python | |
""" | |
import string | |
def generate_key(keyword: str, keyletter: str = "A") -> str: | |
""" | |
Generate a polyalphabetic cipher key |
#!/usr/bin/env python | |
# -*- coding: utf-8; py-indent-offset:4 -*- | |
############################################################################### | |
# | |
# Copyright (C) 2021 Emmanuel Katchy | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or |
Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.
NOTE: This logic can be extended to more than two accounts also. :)
The setup can be done in 5 easy steps:
import base64 | |
import ecdsa | |
def generate_vapid_keypair(): | |
""" | |
Generate a new set of encoded key-pair for VAPID | |
""" | |
pk = ecdsa.SigningKey.generate(curve=ecdsa.NIST256p) | |
vk = pk.get_verifying_key() |
# Put this file under /etc/spamassassin/ and run an sa-update or reload amavis etc. | |
# | |
#-------------------------------------------------- | |
# The only RBL I trust, UCEPROTECT1 (single IP, not IP-ranges or entire ISPs) http://uceprotect.net | |
#-------------------------------------------------- | |
header RCVD_IN_UCEPROTECT1 eval:check_rbl_txt('uceprotect1', 'dnsbl-1.uceprotect.net') | |
describe RCVD_IN_UCEPROTECT1 Listed in dnsbl-1.uceprotect.net | |
tflags RCVD_IN_UCEPROTECT1 net | |
score RCVD_IN_UCEPROTECT1 1.8 |
pragma solidity ^0.4.8; | |
// Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d | |
library ECRecover { | |
// ECRecovery Methods | |
// Duplicate Solidity's ecrecover, but catching the CALL return value | |
function safer_ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal returns (bool, address) { |