Skip to content

Instantly share code, notes, and snippets.

View wiktor-k's full-sized avatar
🇺🇦
Support Ukraine!

Wiktor Kwapisiewicz wiktor-k

🇺🇦
Support Ukraine!
View GitHub Profile
@josephglanville
josephglanville / ruby_image.sh
Created October 21, 2014 11:26
Create bare Ruby docker image
#!/bin/bash
TARGET=$1
mkdir -p $TARGET
files=$(
dpkg -L ruby | grep '/usr/bin/'
dpkg -L ruby1.9.1 | grep '/usr/bin/'
echo '/usr/lib/ruby'
)
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright 2017 Vladislav Mileshkin
# Copyright 2015 Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de>
# Copyright 2015 Daniel Gultsch <daniel@cgultsch.de>
#
# 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
@roehst
roehst / Direction.idr
Last active December 9, 2018 23:42
Simple verification in Idris
module Main
data Direction = North | South | West | East
turn : Direction -> Direction
turn North = East
turn South = West
turn West = North
turn East = South
@grugq
grugq / gist:7713916
Created November 30, 2013 00:43
The text from: http://dee.su/uploads/baal.html On Underground Communications
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Undercover communication
It should be obvious by now, that the only way to communicate
stealthily and securely is to avoid raising suspicion to the
level at which the authorities might consider it worthwhile
to put you under active surveillance (e.g., park a van with
TEMPEST equipment by your apartment).
@Higgs1
Higgs1 / key.py
Last active March 22, 2021 07:29
import cryptography
import datetime
import pgpy
pkalg = pgpy.constants.PubKeyAlgorithm.ECDSA
curve = pgpy.constants.EllipticCurveOID.NIST_P384
super_secret_number = 12345
created = 0 # datetime
@kanaka
kanaka / addTwo.wast
Last active June 17, 2021 21:39
Run wast (WebAssembly) in node
(module
(func $addTwo (param i32 i32) (result i32)
(i32.add
(get_local 0)
(get_local 1)))
(export "addTwo" (func $addTwo)))
@mef
mef / pre-render.js
Last active May 20, 2022 16:56
proof-of-concept pre-rendering d3.js svgs on the server using node.js and jsdom module.
// pre-render d3 charts at server side
var d3 = require('d3')
, jsdom = require('jsdom')
, fs = require('fs')
, htmlStub = '<html><head></head><body><div id="dataviz-container"></div><script src="js/d3.v3.min.js"></script></body></html>'
jsdom.env({
features : { QuerySelector : true }
, html : htmlStub
, done : function(errors, window) {
# Update at 3am once a week
# Make sure the time on the Mikrotik is correct or update will occur "randomly" or never
/system scheduler
add interval=1w name=Auto-Upgrade on-event="/system package update\r\
\ncheck-for-updates once\r\
\n:delay 1s;\r\
\n:if ( [get status] = \"New version is available\") do={ install }" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=jan/01/2017 start-time=03:00:20
/system scheduler
add interval=1w name="Upgrade Router Weekly and Reboot" on-event=\
"/system package update check-for-updates; /system package update download; /system reboot;" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=jan/01/2018 start-time=03:00:00
@jakecraige
jakecraige / pkcs11-ecdh1-derive.go
Last active May 22, 2023 01:13
Example of the differences between deriving a non-sensitive ECDH key with `CKM_ECDH1_DERIVE` with SoftHSM2, AWS CloudHSM and YubiHSM2's PKCS#11 interface
/*
* This script shows an example of how with PKCS#11 ECDH1 key derivation and how it differs when
* communicating with SoftHSM2 vs AWS CloudHSM vs YubiHSM2. This seems to boil down to how they treat
* the `CKA_SENSITIVE` attribute on the derived key.
* - SoftHSM2 does what you expect, if you say it is sensitive it won't allow exporting. If you say
* it's not it will.
* - CloudHSM errors when you attempt to mark the derived key as not-sensitive. It behaves as
* expected when you say it is. AWS docs seem to indicate that the derived key is available on the
* "client" but it's unclear what client they are referring to, and it doesn't seem to be