Skip to content

Instantly share code, notes, and snippets.

View SeriousM's full-sized avatar
🌟
Focusing

Bernhard Millauer SeriousM

🌟
Focusing
View GitHub Profile
@SeriousM
SeriousM / download_workouts.sh
Created January 8, 2018 15:41 — forked from scompt/download_workouts.sh
A script to download workouts and exercise alternatives. Prerequisites are GNU Parallel, cURL, and jq.
#!/bin/bash
USERNAME=d@t.com
PASSWORD=r
LANGUAGES="en fr it ja tr es pt de"
PATHS="v3/coach/workouts v2/coach/workouts v2/coach/exercise_alternatives"
echo "Logging in"
export ID_TOKEN=`curl --silent -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
@SeriousM
SeriousM / Howto convert a PFX to a seperate .key & .crt file
Created October 31, 2017 16:35 — forked from TemporaryJam/Howto convert a PFX to a seperate .key & .crt file
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`
@SeriousM
SeriousM / openssl.MD
Created October 31, 2017 13:30 — forked from jchandra74/openssl.MD
HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

Overview

My main development workstation is a Windows 10 machine, so we'll approach this from that viewpoint.

Recently, Google Chrome started giving me a warning when I open a site that uses https and self-signed certificate on my local development machine due to some SSL certificate issues like the one below:

Self-Signed SSL Issue in Chrome

@SeriousM
SeriousM / gist:eb7b35bc44c02f1cc1f7e4c80a42eb87
Created January 15, 2017 20:45 — forked from LukasBombach/gist:2943fc2a1cb5fd4bbd1c3e6b477ce033
Installing Plex Media Server on Debian on a Pine64
sudo apt-get install apt-transport-https
sudo dpkg --add-architecture armhf
echo "deb [arch=armhf] https://dev2day.de/pms/ jessie main" | sudo tee /etc/apt/sources.list.d/pms.list
sudo apt-get update
sudo apt-get install binutils:armhf plexmediaserver-installer -y --force-yes
@SeriousM
SeriousM / ngrxintro.md
Created October 30, 2016 22:55 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

#Comprehensive Introduction to @ngrx/store By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@SeriousM
SeriousM / readme.md
Created August 8, 2014 11:28
Extract Generic Type Definition in C#
void Main()
{
	GetTypeFromList(new List<string>()).Dump();
	GetTypeFromFunc((string s, int i) => true).Dump();
}

public Type GetTypeFromList<TType>(IEnumerable<TType> dummy)
{
	return typeof(TType);
// Author: Darren Schnare, modified by Bernhard Millauer
// Keywords: javascript,interpolation,string,ruby
// License: MIT ( http://www.opensource.org/licenses/mit-license.php )
// Repo: https://gist.github.com/SeriousM/908ee1e67c79681e8c52
String.prototype.interpolate = function (o) {
if (!o) return this;
function getValue(str, context) {
var ix = str.lastIndexOf('()');
if (ix > 0 && ix + '()'.length == str.length){
return context[str.substring(0, ix)]();
@SeriousM
SeriousM / introrx.md
Created January 26, 2016 17:49 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
using System;
using System.Runtime.InteropServices;
// ReSharper disable SuspiciousTypeConversion.Global
// ReSharper disable InconsistentNaming
namespace VideoPlayerController
{
/// <summary>
/// Controls audio using the Windows CoreAudio API
/// from: http://stackoverflow.com/questions/14306048/controling-volume-mixer
@SeriousM
SeriousM / readme.md
Created July 7, 2013 19:18
Gem development

loading gem git clone <git repo>

install local gem (this will load the local one instead the official one) gem install <gem name>

release new version rake release