Openssl, calculate SKI from public key in certificate

https://tools.ietf.org/html/rfc5280#section-4.2.1.2

Extract public key from certificate in to tempfile

openssl x509 -noout -in [cert-file] -pubkey > tmp.pub.der

Locate ”BIT STRING”

openssl asn1parse -in tmp.pub.der

Extract ”clean” public key

openssl asn1parse -in tmp.pub.der -strparse 19 -out pub.der

Calculate hash of the public key

openssl dgst -c -sha1 pub.der

Tribut to xuf for http://certificateerror.blogspot.com/2011/02/how-to-validate-subject-key-identifier.html

Publicerat i PKI

USG

error: dhcpd uid lease … for client … is duplicate on net_LAN_eth1_…

$ clear dhcp leases

Create DNS entries

$ configure
$ set system static-host-mapping host-name host1 inet 1.1.1.1
$ commit
$ save
$ exit

 

Malaxlimpa

50g jäst
1 1/2 l vatten (ljummet)
1 1/2 kkp bakmalt
4 dl sirap
1 1/2 kkp socker
4 kkp vetemjöl
4 msk salt
1 1/2 kkp lingonsylt
1.8 – 2 kg rågmjöl (för mycket så blir det stabbigt)

Blanda vatten, sirap och lingonsylt först sen jäst, låt stå 5-10 min
Blanda i malt, vetemjöl, socker, salt och rågmjöl
Låt jäsa i 6 timmar
Häll ut smeten i långpanna med smörpapper under och platta till den med fuktig hand så den blir jämntjock, lägg ett smörpapper ovanpå smeten
Grädda i 3 timmar i 150 grader
Pensla med kaffe varje timme
Låt brödet svalna i ugnen med smörpapperet kvar
Skär i lagom bitar

Publicerat i Mat

Ubuntu Base Server 16.04

Language

English

Ubuntu

Install Ubuntu Server

Select a language

English – English

Select your location

Other, Europe, Sweden

Configure locales

United States – en_US.UTF-8

Configure the keyboard,

Detect keyboard layout

<No>

Country of origin of the keyboard

<Swedish>

Keyboard layout

<Swedish>

Configure the network

Hostname

ubuntu

Set up users and passwords

Full name for the new user

user one

username for your account

user

Choose a password for the new user

{password}

re-enter password to verify

{password}

encrypt home directory

<No>

Configure the clock

Is this time zone correct

<Yes>

Partition disks

Partitioning method

<Guided – use entire disk and set up LVM>

Select disk to partition

<enter>

Write the changes to disk and configure LVM

<Yes>

amount of volume group to use for guided partitioning

<Continue>

Write the changes to disk

<Yes>

Configure the package manager

<Continue>

Configuring tasksel

<No automatic updates>

Software selection

  • standard system utilities
  • OpenSSH server

<Continue>

Install the GRUB boot loader on a hard disk

<Yes>

Finish the installation

<Continue>

 

Install additions to Ubuntu server

Prereq is a ”vanilla” Ubuntu 16.04 LTS server

Update Ubuntu

$sudo apt-get update
$sudo apt-get upgrade
($sudo apt-get dist-upgrade)
$sudo apt-get autoremove

Install ntpd and unzip

$ sudo apt-get install ntp unzip

Install xinit

$ sudo apt-get install xinit
($ sudo apt-get install x11-apps)

Install Minimal Xfce Desktop

$ sudo apt-get install --no-install-recommends xubuntu-desktop

Tribute to Dan Nanni http://ask.xmodulo.com/install-minimal-ubuntu-desktop.html for the info on How to install minimal Ubuntu desktop

Install xRDP

$ sudo apt-get install xrdp

Change keyboard settings

$ sudo dpkg-reconfigure keyboard-configuration

Change time zone settings

$ sudo dpkg-reconfigure tzdata

OpenSSL, compare certificate vs. private key

To view the certificate Modulus:

openssl x509 -noout -modulus -in [certificate-file.crt]

To view the key Modulus:

openssl rsa -noout -modulus -in [key-file.key]

Command to compare certificate vs private key

$ certMod=$(openssl x509 -text -noout -modulus -in server.crt | grep "Modulus=") && \
	keyMod=$(openssl rsa -text -noout -modulus -in server.key | grep "Modulus=") && \
	[[ $certMod == $keyMod ]] && echo "Equal"

Tribut to Peter Mescalchin magnetikonline for the script above https://gist.github.com/magnetikonline/fbdb26fcb34ca5038c03507cbdfdb534

Publicerat i PKI

Openssl – parse certificate and crl files

Parse certificate in binary format

openssl x509 -in certfile.cer -text -noout -inform der

Parse crl in binary format

openssl crl -in crlfile.crl -text -noout -inform der

Parse PEM file with several certificates

openssl crl2pkcs7 -nocrl -certfile FILE.pem | \
openssl pkcs7 -print_certs
Publicerat i PKI

Homebrew

Install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Check your system for potential problems

$ brew doctor

Fetch the newest version of Homebrew

$ brew update

List all installed formulae

$ brew list

Install formulae

$ brew install [package]

Farmors jul-limpa

100g margarin
1 pkt farinsocker
2 pkt jäst
1 kg vetemjöl
1 kg rågsikt
1 tsk salt
brödkryddor, anis och fänkål

1 liter ljummet vatten (ca 37grader slås på en burk (el kartong) farin och 1 hg margarin.
När allt löst sig tillsätter man 1 tsk salt, 2 pkt jäst,1 kg vete, 1 kg rågsikt, några teskedar krossade brödkryddor ( anis och fänkål)
Allt arbetas ihop, helst i en assistent, till en smidig deg, som släpper bunken.
Degen delas i 6 delar och formas till limpor, ”levar” två stycken på varje plåt, som är täckt med bakplåts-papper (ej smörgåspapper)
Lägg bakhandukar över limporna och låt allt jäsa på dragfri plats i 2 timmar.
Värm under tiden upp ugnen till 175 gr. Sätt in första plåten utan bakdukar på nedre falsen tills ”leven”, limpan alltså, fått fin färg. Detta tar nog ½ timme eller mer,
Pensla sedan limporna med hett, kokande vatten, så blir de blanka och den yttre sötman, kommer fram tydligare
Linda in de färdiga levarna i handukar, så de får kallna.
Dela limporna på mitten och frys in i fryspåse!

Publicerat i Mat

Create bootable USB stick from ISO in Mac OS X

Convert the ISO to UDRW format

$ hdiutil convert -format UDRW -o destination_file.img source_file.iso

Prepare the USB stick

$ diskutil list
$ diskutil partitionDisk /dev/disk4 1 "Free Space" "unused" "100%"

Copy the image to the USB stick

$ dd if=destination_file.img.dmg of=/dev/rdisk4 bs=1m
$ diskutil eject /dev/disk4
Publicerat i Mac