Skip to content

Instantly share code, notes, and snippets.

@lcharles123
lcharles123 / Makefile
Last active November 10, 2023 04:14
Install dafny lang binaries and run inside a terminal, no vscode or emacs needed.
#
# Use Dafny lang in any system: setup agnostic
# Tested on Ubuntu 18.04
# install java
# apt install default-jre
#
# install dotnet 6.0 from Microsoft site
# https://dotnet.microsoft.com/en-us/download/dotnet/6.0
#
# install these programs from source:
@lcharles123
lcharles123 / ftx.py
Last active May 16, 2022 18:23
simple ftx client python, provides basic iIterations with FTX.com crypto exchange
#!/usr/bin/rlwrap python3
#-*- coding:utf-8 -*-
# apt install rlwrap, add console history support
"""Since FTX site uses a lot of CPU with markets with high activity
You can use this simple script to iteract.
Order cancelation is better using the site https://ftx.com/orders
"""
import time
import hmac
from requests import Request, Session
@lcharles123
lcharles123 / ic.py
Last active May 4, 2022 16:25
Compute index of coincidence, python
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
"""
IC = sum i=1 to c(n_i * (n_i-1)) / N(N-1)/c
c = len(alphabet)
N = len(text)
"""
from collections import Counter
from functools import reduce
@lcharles123
lcharles123 / README.md
Created June 1, 2020 19:14 — forked from maxious/README.md
Esee/Anran 960P 180° Wireless Fisheye Panoramic CCTV Smart Camera HD WIFI Webcam IP
@lcharles123
lcharles123 / bwtest.sh
Created January 25, 2020 00:44 — forked from hackerb9/bwtest.sh
Busybox compatible simple speedtest that downloads a file to /dev/null. Useful for sshing into various routers and seeing where the bottleneck is.
#!/bin/sh
# Silly speed test just by downloading a file directly to /dev/null
# Useful on routers which only have busybox installed.
# B9 2016, 2018
dotest() {
# $1 is which file to grab 100, 10, or 1 (megabytes).
megabytes=$1