Skip to content

Instantly share code, notes, and snippets.

@esurdam
esurdam / ecdsa_openssl.md
Last active December 21, 2023 09:12
Generate ECDSA certs

ECDSA Certs with LetsEncrypt

More on ECDSA

Info on bit length and complexity

From it you may gather that using 256 bit ECDSA key should be enough for next 10-20 years.

To view your available curves

@esurdam
esurdam / meta-tags.md
Last active July 14, 2016 04:19 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@esurdam
esurdam / sign_html_gpg.md
Last active July 14, 2016 07:28
Sign .html files with gpg - detached signature

HTML Signing

Inspiration

Automate Signing with a MakeFile

Create a MakeFile in the root of your git project.

This MakeFile will recursively look through all dirs for any .html file, starting at the root. It will then sign the file and create a detached signature contained in a .html.asc file.

@esurdam
esurdam / nginx_njs.md
Last active August 19, 2018 18:38
njs for nginx configuration

NJS/nginScript

Configure nginx with HTTP JavaScript module using the --add-module option:

./configure --add-module=<path-to-njs>/nginx

Alternatively, you can build a dynamic version of the njs module

./configure --add-dynamic-module=<path-to-njs>/nginx
@esurdam
esurdam / awslogs.conf
Last active January 12, 2018 09:18
AWSlogs config file
[general]
state_file = /var/lib/awslogs/agent-state
[messsages]
datetime_format = %b %d %H:%M:%S
file = /var/log/messages
buffer_duration = 5000
log_stream_name = {hostname} - {instance_id}
initial_position = start_of_file
log_group_name = messages
@esurdam
esurdam / cache_class_methods.rb
Last active July 26, 2016 09:42
Magic Sauce Caching ;)
module CacheClassMethods
def has_serializer
if self.instance_eval "Object.const_defined? #{self.class.name}Serializer.to_s"
self.instance_eval "#{self.class.name}Serializer"
end
end
def hash_key(source = nil)
"#{self.class.name.to_s.downcase}:#{source.to_s.downcase}"
@esurdam
esurdam / MIU.agda
Created August 3, 2016 02:05 — forked from gergoerdi/MIU.agda
The "MI to MU" puzzle from GEB
module MIU where
data Symbol : Set where
I : Symbol
U : Symbol
open import Data.List
Word : Set
Word = List Symbol
@esurdam
esurdam / MIU.agda
Created August 3, 2016 02:05 — forked from gergoerdi/MIU.agda
The "MI to MU" puzzle from GEB
module MIU where
data Symbol : Set where
I : Symbol
U : Symbol
open import Data.List
Word : Set
Word = List Symbol
@esurdam
esurdam / runner.py
Last active September 4, 2016 03:50
sample
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from facebookads.objects import (
AdUser,
@esurdam
esurdam / work
Last active September 14, 2016 04:09
py.py
output = popen("/usr/local/bin/ffprobe -v error -show_format -show_streams %s" % self._audio).read()
for spec in {'sample_rate', 'channels'}:
eval(u'{0:s} = popen("echo "{0:s}" | grep {0:s}).read().replace("{0:s}=", "").rstrip("\n")'.format(spec))
# sample_rate = popen("echo \"%s\" | grep sample_rate" % output).read().replace("sample_rate=", "").rstrip('\n')
# channels = popen("echo \"%s\" | grep channels" % output).read().replace("channels=", "").rstrip('\n')
if int(sample_rate) > 16000 or int(channels) > 1:
filename, extension = self._audio.split('.')
output_file = ".%s_mono.%s" % (filename, extension)