Skip to content

Instantly share code, notes, and snippets.

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@gkliska
gkliska / ubuntu18.04.sh
Created June 11, 2018 13:54
Ubuntiu 18.04 initial
sudo su
locale-gen en_US en_US.UTF-8 hr_HR hr_HR.UTF-8
# get apt repositories
apt install software-properties-common
add-apt-repository ppa:git-core/ppa
cd /tmp && wget https://nginx.org/keys/nginx_signing.key && apt-key add nginx_signing.key && add-apt-repository -y ppa:nginx/development
# $(lsb_release -cs) => bionic
sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
add-apt-repository ppa:libreoffice/ppa
apt update
@gkliska
gkliska / Ubuntu16.04_setup2
Created November 7, 2017 11:53
2. Ubuntu 16.04 installation
sudo apt-get -qq --force-yes install language-pack-hr wget ca-certificates git ntp htop
sudo apt-get -qq --force-yes install build-essential python-setuptools python-pip python-dev
sudo apt-get -qq --force-yes install antiword graphviz ghostscript poppler-utils
sudo apt-get -qq --force-yes install libldap2-dev libxml2-dev libxslt-dev libevent-dev libsasl2-dev
sudo apt-get -qq --force-yes install libreoffice-script-provider-python libreoffice-base default-jre ure libreoffice-java-common libreoffice-writer fonts-symbola
sudo apt-get -qq --force-yes install python3-pip
sudo apt-get -qq --force-yes install oidentd libdbd-pg-perl
sudo apt-get -qq --force-yes install libreadline-gplv2-dev
sudo apt-get -qq --force-yes install libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
sudo apt-get -qq --force-yes install libxml2-dev libxslt1-dev libevent-dev libsasl2-dev
@gkliska
gkliska / Ubuntu16.04_setup1
Last active February 7, 2018 16:54
1. Ubuntu 16.04 installation
locale-gen en_US en_US.UTF-8 hr_HR hr_HR.UTF-8
# get apt repositories
sudo apt-get -qq --force-yes install python-software-properties
sudo add-apt-repository -y ppa:git-core/ppa
cd /tmp && wget https://nginx.org/keys/nginx_signing.key && apt-key add nginx_signing.key && add-apt-repository -y ppa:nginx/development
sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo add-apt-repository -y ppa:libreoffice/ppa
apt-get install --install-recommends linux-generic-hwe-16.04
sudo apt update
sudo apt upgrade
@gkliska
gkliska / xml_parser.py
Created February 4, 2016 04:27 — forked from yvaucher/xml_parser.py
PoC: Convert a xml to csv and csv to xml or another format for openerp
#!/usr/bin/env python
# Author: Stéphane Wirtel (@matrixise)
# Basic implementation of CSV Renderer by Yannick Vaucher (@yvaucher) (Camptocamp)
import os
from collections import OrderedDict
from pprint import pprint as pp
import itertools
from lxml import etree
import csv
@gkliska
gkliska / SLA
Last active August 29, 2015 13:56
Daniel,
Beside working with OpenERP I am in charge of one of the largest implementation of MS CRM in region.
It is near EOL now :( ,soon more time for OE :).
Take a quick look at this:
http://blogs.msdn.com/b/emeadcrmsupport/archive/2010/04/13/microsoft-crm-4-0-update-rollup-overview.aspx
If you think OpenERP bugs are scary you can read details.
Process goes like this:
Naming convention for OpenERP exists but it is unlikely that it will be enforced in our lifetime.
We can start with this dict as starting point:
def _get_field_map(self, cr, uid, context=None):
return {
'sale_order': {
'lines_field': 'order_line',
'lines_obj': 'sale.order.line',
'curr_date': ['date_order', 'now'],
'date': ['date_order'],
#!/bin/bash
PORT=6432
# Create a ramfs
if [ -f /tmp/pg_on_ram ]
then
echo "/tmp/pg_on_ram already exists"
exit 1
fi