Skip to content

Instantly share code, notes, and snippets.

View Preen's full-sized avatar

Philip Mannheimer Preen

  • SkimSafe
  • Stockhollm, Sweden
View GitHub Profile
@byronmansfield
byronmansfield / install-openssl-from-src-mac
Last active December 15, 2023 05:51
Install OpenSSL from source Mac OS X
# Install OpenSSL from source on Mac OS X
# prepare workspace
mkdir -p ~/code/build-from-src/ && cd $_
# download source code
curl -LO https://www.openssl.org/source/openssl-1.1.1d.tar.gz
# expand tar
tar -xzvf openssl-1.1.1d.tar.gz
@tanthammar
tanthammar / ocr.php
Created September 27, 2019 10:38 — forked from AdamGerthel/ocr.php
Generate BankGiro/PlusGiro OCR numbers via PHP
<?php
/**
* OCR Number generation function
*
* @param string $base_number
* The base number that you wish to use for the OCR nr. Can be any number,
* but usually consists of client ID combined with invoice ID or similar.
* @param boolean $length
* Use length if you want the OCR number to add a length
@josephabrahams
josephabrahams / wpsalt.sh
Last active March 30, 2022 08:30
Get WordPress Salts in Env format
#!/bin/sh
curl -s https://api.wordpress.org/secret-key/1.1/salt | sed "s/^define('\(.*\)',\ *'\(.*\)');$/\1='\2'/g"
@mileandra
mileandra / letsencrypt_setup.md
Last active April 9, 2020 19:39
Letsencrypt on Ubuntu 16.04 with Nginx, Rails and Capistrano-Unicorn-Nginx

Install Letsencrypt

Install with apt-get

$ sudo apt-get update    
$ sudo apt-get install letsencrypt

Generate a strong DH

$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048

Configure nginx

@taiansu
taiansu / app.js
Created August 10, 2016 10:46
Phoenix brunch config which just make sense
import "phoenix_html"
import "bootstrap"
import "jquery"
import "toastr"
// ...
@Vestride
Vestride / encoding-video.md
Last active April 24, 2024 09:59
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@rodleviton
rodleviton / imagemagick-install-steps
Created May 26, 2014 07:37
Installing Image Magick on Ubuntu 14.04
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz
tar xzvf ImageMagick-6.8.9-1.tar.gz
cd ImageMagick-6.8.9-1/
./configure --prefix=/opt/imagemagick-6.8 && make
checkinstall
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048