Skip to content

Instantly share code, notes, and snippets.

View sakethramanujam's full-sized avatar
:shipit:
bravo alpha zulu india november golf alpha

Saketha Ramanjam sakethramanujam

:shipit:
bravo alpha zulu india november golf alpha
View GitHub Profile
"""
A simple get function which caches responses for a URL
using a LFU cache
"""
import requests
from collections import Counter
class LFUCache(object):
""" Least frequently used cache with caching done on SET """
import numpy as np
import casadi
from casadi import SX, DM
from math import cos, sin
import cv2
# State Vector Indices
index_mass = 0
index_position_x = 1
index_position_y = 2
@pdp7
pdp7 / BeagleBone: sharing Internet connection from Linux laptop with USB.md
Last active March 13, 2024 20:40
BeagleBone: sharing Internet connection from Linux laptop with USB

WARNING: interfaces can enumarate differently:

ufw status
#iptables -F
#iptables --table nat --append POSTROUTING --out-interface wlxe0b94db737c9 -j MASQUERADE
#iptables --table nat --append POSTROUTING --out-interface enp0s20u1u1 -j MASQUERADE
iptables --table nat --append POSTROUTING --out-interface enp0s20u1u2 -j MASQUERADE
#iptables --append FORWARD --in-interface enx1cba8c9bbeb5 -j ACCEPT
#iptables --append FORWARD --in-interface enx9884e391a556 -j ACCEPT
iptables --append FORWARD --in-interface enx9884e391a559 -j ACCEPT
@ThibaultJanBeyer
ThibaultJanBeyer / read-only-couchdb.json
Created July 5, 2018 17:21
read only couchdb: add this to the design documents of the database you want to protect. Now, only users with role admin will be able to edit or add documents to this database.
{
"_id": "_design/auth",
"language": "javascript",
"validate_doc_update": "function(newDoc, oldDoc, userCtx) { if (userCtx.roles.indexOf('admin') !== -1) { return; } else { throw ({ forbidden: 'Only admins may edit the database' }); } }"
}