Skip to content

Instantly share code, notes, and snippets.

import hmac
import hashlib
import time
from django.conf import settings
def gethash(username, expiration_time):
"""
Returns the HMAC encoded part of the cookie protocol
"""
<!-- Simple Countdown in JS + Total Count -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
<style type="text/css" media="screen">
#!/usr/bin/env python
# Example of using Tokyo Cabinet with the
# pytc (http://pypi.python.org/pypi/pytc/) Python language bindings.
# For an overview of pytc's methods, download the pytc source,
# open the pytc.c file and go to line 889
from tc import HDB, HDBOREADER, HDBOWRITER, HDBOCREAT, HDBONOLCK, Error
# open (or create) the 'test.hdb' database with write permissions
Sat May 7 09:44:58 UTC 2016
@arthurk
arthurk / bumpme
Last active October 11, 2018 09:48
Thu Oct 11 09:48:24 UTC 2018
#!/usr/bin/env python3
from secrets import token_bytes
from coincurve import PublicKey
from sha3 import keccak_256
def generate_address():
private_key = keccak_256(token_bytes(32)).digest()
public_key = PublicKey.from_valid_secret(private_key).format(compressed=False)[1:]
addr = keccak_256(public_key).digest()[-20:]
PID TTY STAT TIME COMMAND
1 ? Ss 0:01 /sbin/init
2 ? S 0:00 [kthreadd]
3 ? I< 0:00 [rcu_gp]
4 ? I< 0:00 [rcu_par_gp]
5 ? I 0:00 [kworker/0:0-cgroup_destroy]
6 ? I< 0:00 [kworker/0:0H-kblockd]
7 ? I 0:00 [kworker/u30:0-events_unbound]
8 ? I< 0:00 [mm_percpu_wq]
9 ? S 0:00 [ksoftirqd/0]
adduser/stable,now 3.118 all [installed]
apparmor/stable,now 2.13.2-10 amd64 [installed]
apt-listchanges/stable,now 3.19 all [installed]
apt-utils/stable,now 1.8.2 amd64 [installed]
apt/stable,now 1.8.2 amd64 [installed]
awscli/stable,now 1.16.113-1 all [installed]
base-files/stable,now 10.3+deb10u2 amd64 [installed]
base-passwd/stable,now 3.5.46 amd64 [installed]
bash-completion/stable,now 1:2.8-6 all [installed]
bash/stable,now 5.0-4 amd64 [installed]
admin@ip-172-31-17-214:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 486M 0 486M 0% /dev
tmpfs 99M 2.8M 96M 3% /run
/dev/xvda1 7.7G 868M 6.5G 12% /
tmpfs 494M 0 494M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 494M 0 494M 0% /sys/fs/cgroup
/dev/xvda15 124M 262K 124M 1% /boot/efi
tmpfs 99M 0 99M 0% /run/user/1000
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "mychart.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata: