Skip to content

Instantly share code, notes, and snippets.

@technion
technion / acme-client-runner.rb
Last active August 8, 2023 16:29
Runs Acme Client
#!/usr/bin/env ruby
# We're going to need a private key.
require 'openssl'
# Initialize the client
require 'acme/client'
# We need an ACME server to talk to, see github.com/letsencrypt/boulder
ENDPOINT = 'https://acme-v01.api.letsencrypt.org/'
#ENDPOINT = 'https://acme-staging.api.letsencrypt.org'
ACCOUNT_FILE = 'account_key.pem'
# Base image
FROM debian:stable
MAINTAINER Infer
# Debian config
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
Param(
[Parameter(Mandatory=$true)]
[string]$FileOwner,
[string]$Unlock
)
$Shares = Get-WmiObject -Class win32_share -filter "type=0 and not name like 'PRINT$' and not name like 'SYSVOL' and not name like 'NETLOGON'"
if ($Unlock) {
ForEach ($Share in $Shares) {
UnBlock-SmbShareAccess -Name $Share.Name -AccountName $FileOwner -force
}
# sh /code/run.sh
[value] Analyzing a complete application starting at main
[value] Computing initial state
[value] Initial state computed
/code/src/test.c:59:[value] warning: argument version has type int but format indicates unsigned int
[value] warning: Continuing analysis because this seems innocuous
Test Argon2i version number: 13
# Source
#include <stdio.h>
#include <stdlib.h>
struct node {
int something;
struct node *next;
};
#!/usr/bin/env ruby
require 'openssl'
def subject_alt_name(domains)
domains = domains.split(/,/)
ef = OpenSSL::X509::ExtensionFactory.new
ef.create_extension("subjectAltName",
domains.map { |d| "DNS: #{d}" }.join(','))
@technion
technion / size_t.c
Last active February 25, 2017 08:20
#include <stdio.h>
#include <unistd.h>
int returnsnegative() {
return -5;
}
ssize_t my_write(int fd, const void *buf, size_t count) {
/* This functions has the same function prototype as write() */
/* For more information: https://linux.die.net/man/2/write */
#!/usr/bin/env ruby
("1000000000".to_i(16)).upto("FFFFFFFFFF".to_i(16)) do |n|
puts n.to_s(16).upcase
puts n.to_s(16)
end
module ApplicationHelper
# Use a hash so there's a bit of work to serialize
DATA = [data: 'a secret cookie', second: 'another string']
N = 100000
def storebench
# Setup keying. Really, secret and sign_secret should just get saved.
key_generator = ActiveSupport::KeyGenerator.new(Rails.application.secrets.secret_key_base, iterations: 1000)
secret = key_generator.generate_key('encrypted cookie')
sign_secret = key_generator.generate_key('signed encrypted cookie')
@technion
technion / Password References.md
Last active February 13, 2024 16:47
A set of references on modern password policies

References on modern password policies

Below links provide source, reference link and relevant quote

Standards

NIST

https://github.com/usnistgov/800-63-3/blob/nist-pages/sp800-63b/sec5_authenticators.md

Verifiers SHOULD NOT impose other composition rules (e.g., requiring mixtures of different character types or prohibiting consecutively repeated characters) for memorized secrets. Verifiers SHOULD NOT require memorized secrets to be changed arbitrarily (e.g., periodically).However, verifiers SHALL force a change if there is evidence of compromise of the authenticator.

Major organisations