I hereby claim:
- I am limeless on github.
- I am benjidude (https://keybase.io/benjidude) on keybase.
- I have a public key ASAZWYpm8Nn6kYy0A9Jap0K8UyaxX0oc5zglufqZ9QORcwo
To claim this, I am signing this object:
import numpy as np | |
import matplotlib.pyplot as plt | |
def modular_sqrt(a, p): | |
""" | |
Compute the modular square root of a modulo p using the Tonelli-Shanks algorithm. | |
Returns the two square roots if they exist, or None if no square root exists. | |
""" | |
a = int(a) # Convert a to a regular integer | |
if pow(a, (p-1)//2, p) != 1: |
def xor(a, b): | |
""" | |
Helper function to perform XOR operation on binary strings | |
Source: https://www.tutorialspoint.com/tuple-xor-operation-in-python | |
""" | |
return ''.join(str(int(x) ^ int(y)) for x, y in zip(a, b)) | |
def berlekamp_massey(keystream): |
#include <stdio.h> | |
char passwd[80]; | |
void main() | |
{ | |
printf("Please enter password: "); | |
if (login() == 'T') | |
welcome(); | |
else |
import geocoder | |
ip_addrs = ['172.10.10.10'] | |
if __name__ == "__main__": | |
for i in ip_addrs: | |
g = geocoder.ip(i) | |
print(g.country ,g.city, g.latlng) | |
#!/usr/bin/env python3 | |
import argparse | |
import logging | |
import sys | |
import signal | |
import gi | |
import json | |
gi.require_version('Playerctl', '2.0') | |
from gi.repository import Playerctl, GLib |
# When HHKB is connected | |
ACTION=="add", SUBSYSTEM=="usb", ENV{XAUTHORITY}="/home/user/.Xauthority", ENV{DISPLAY}=":0", ATTRS{idVendor}=="0853", ATTRS{idProduct}=="0100", RUN+="/home/user/bin/hhkb add" | |
# When HHKB is disconnected. | |
ACTION=="remove", SUBSYSTEM=="usb", ENV{XAUTHORITY}="/home/user/.Xauthority", ENV{DISPLAY}=":0", ATTRS{idVendor}=="0853", ATTRS{idProduct}=="0100", RUN+="/home/user/bin/hhkb remove" |
#!/usr/bin/env bash | |
# Generate 100MB of random tex. | |
cat /dev/urandom | base64 | dd of=/tmp/randomdata bs=1024 count=100k | |
# Test. Repeat for each terminal... | |
# Results are written to bench_XXX.txt | |
# This also shows MB/s very nicely thanks to `dd`. | |
{ time dd if=/tmp/randomdata bs=10240; } 2> bench_XXX.txt | |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# | |
# NOTE: specify the absolutepath to the directory to use when | |
# loading a plugin. '~' expansion is supported. | |
# | |
chunkc core::plugin_dir /usr/local/opt/chunkwm/share/chunkwm/plugins | |
# |
#!/usr/bin/env bash | |
# SPDX-License-Identifier: GPL-2.0 | |
# | |
# Copyright (C) 2016-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. | |
# Killswitch : https://github.com/vpn-kill-switch/homebrew-killswitch | |
die() { | |
echo "[-] Error: $1" >&2 | |
exit 1 | |
} |