Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Drechsler draptik

View GitHub Profile
@draptik
draptik / slides.md
Created Jun 9, 2021
slidev-resolution-01
View slides.md
theme layout
default
default

This is a long title, but it's on a single line with 4k

There are 13 bullet points

  • foo01
@draptik
draptik / fsharp-safe-problems.md
Last active Jan 1, 2021
Problems with F# SAFE linux 2020
View fsharp-safe-problems.md

Problems with SAFE Demos

I'm having trouble using the provided documentation/demos.

Main problems:

  • linux: demos are often windows-centric
  • since I'm using linux, I can't use .NET-Framework4.x... -> dotnet core (dotnet core 5)
  • FAKE and Paket have evolved, but most of the examples provided on https://safe-stack.github.io/docs/learning/ will not compile under linux
    • NOTE: while learning SAFE, I don't want to spend my time also learning a new build system (FAKE) and
@draptik
draptik / create-certificate.sh
Created Mar 18, 2020
create self-signed server and client certificate with openssl
View create-certificate.sh
#!/bin/bash
## Create self signed certificate (server and client)
##
## Combination of
##
## - https://medium.com/the-new-control-plane/generating-self-signed-certificates-on-windows-7812a600c2d8
## - https://www.makethenmakeinstall.com/2014/05/ssl-client-authentication-step-by-step/
##
## Configuration file: `openssl.cnf` contains information about the site being configured.
View raspberry-pi-restart-wifi.sh
crontab -e
*/5 * * * * /usr/bin/sudo -H /home/pi/my-scripts/checkwifi.sh >> /dev/null 2>&1
View sql-murder-mystery-solution.sql
-- https://mystery.knightlab.com/walkthrough.html
-- witness 1
--SELECT * from interview where person_id = 14887
--select * from get_fit_now_member where id like '48Z%' and membership_status = 'gold'
--select * from drivers_license where plate_number like '%H42W%'
-- witness 1
--select p.* from person p
--join drivers_license dl on p.license_id = dl.id
@draptik
draptik / clmystery-solution.md
Last active Jan 14, 2020
A solution to clmystery: A Command line murder mystery (https://github.com/veltman/clmystery)
View clmystery-solution.md

Solving the riddle

A solution to clmystery: Command line murder mystery.

Get all clues

grep "CLUE" crimescene

CLUE: Footage from an ATM security camera is blurry but shows that the perpetrator is a tall male, at least 6'.
View combine-pdf-pages
#!/bin/bash
INPUT_FILE="vo_all.pdf"
OUTPUT_FILE_BASE="vo_all_output"
pdfjam --nup 2x3 \
--frame true \
--noautoscale false \
--delta "0.2cm 0.3cm" \
--scale 0.95 \
View FAKE5-setup-beta020.sh
#!/bin/bash
## Temporary workaround for ncurses bug (https://github.com/dotnet/corefx/issues/26966#issuecomment-367066252)
export TERM=xterm
DEMOPROJECT=MyLib
## Cleanup
rm -rf $DEMOPROJECT
@draptik
draptik / monitor-temperatures.py
Last active Sep 14, 2017
Python script for monitoring temperatures sent from ciseco sensors and weather underground.
View monitor-temperatures.py
#!/usr/bin/env python
import sqlite3
import threading
from time import time, sleep, gmtime, strftime
import serial
import requests
# global variales
@draptik
draptik / Class1.cs
Created Jul 31, 2017
xunit-net-collection-fixtures
View Class1.cs
using FluentAssertions;
using Xunit;
namespace FooTests
{
/// <summary>
/// https://xunit.github.io/docs/shared-context.html#collection-fixture
///
/// Important note: Fixtures can be shared across assemblies, but collection definitions must
/// be in the same assembly as the test that uses them.