Skip to content

Instantly share code, notes, and snippets.

View dmgolembiowski's full-sized avatar

David M. Golembiowski dmgolembiowski

View GitHub Profile
@dmgolembiowski
dmgolembiowski / md5.js
Created June 3, 2020 03:21 — forked from MichaelPote/md5.js
invalid reference fix and fixed add32 not being overwritten properly.
/*
* http://www.myersdaily.org/joseph/javascript/md5-text.html
*/
(function (global) {
var md5cycle = function (x, k) {
var a = x[0],
b = x[1],
c = x[2],
d = x[3];

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

@dmgolembiowski
dmgolembiowski / vimcat.sh
Created December 1, 2021 00:25 — forked from RichardBronosky/vimcat.sh
Modified version of Matthew Wozniski's vimcat.sh
#!/bin/bash
#!/usr/bin/env vim
#! This is a bash script that executes itself as a vimscript to do its work
#! vim:ft=vim:ts=2:sts=2:sw=2
: if 0
tmpfile=$(mktemp -t vimcat.XXXXXXXX)
exec 9<>"$tmpfile"
rm "$tmpfile"
@dmgolembiowski
dmgolembiowski / .storybook_main.cjs
Created February 16, 2022 01:29 — forked from bryanmylee/.storybook_main.cjs
Svelte (kit) + Storybook + Webpack 5 configuration to support all modern features (optional chaining and nullish coalescence in templates)
const path = require('path');
const postcss = require('postcss');
const preprocess = require('svelte-preprocess');
const replaceFileExtension = (filePath, newExtension) => {
const { name, root, dir } = path.parse(filePath);
return path.format({
name,
root,
dir,
version: "3"
services:
sonarr:
image: linuxserver/sonarr
container_name: sonarr
volumes:
- /volume2/docker/sonarr/config:/config
- /volume2/data:/data
environment:
- PUID=1039
@dmgolembiowski
dmgolembiowski / docker-automatic-media-server.md
Created April 7, 2022 02:40 — forked from matthewdowns/docker-automatic-media-server.md
Docker Automatic Media Server - Setup Guide

Introduction

This guide is focused on building a completely autonomous request-based media server using individual docker containers.

Most of the images we will be using are maintiained by linuxserver.io. They maintain many up-to-date versions of the most popular tools used for media servers.

Our full stack includes:

  • Plex Media Server - Plex Media Server is the back-end component to Plex, a self-hosted media platform.
  • Transmission - A lightweight torrent downloading client.
@dmgolembiowski
dmgolembiowski / svelte-summit-2020-summary.md
Created July 19, 2022 00:01 — forked from vedam/svelte-summit-2020-summary.md
links and ressources from the svelte-summit-2020 talks

You'll find the talks here


Morgan Williams @mrgnw

The Zen of Svelte

Approaching frontend as a backend developer, Svelte feels surprisingly pythonic. Let's take a quick look at what's familiar, what's foreign, and how to explore the gap.

server {
listen 443;
ssl on;
ssl_certificate /etc/letsencrypt/live/{{ nginx_pem_dir }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ nginx_pem_dir }}/privkey.pem;
ssl_prefer_server_ciphers On;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_dhparam /etc/nginx/ssl/certs/dhparam.pem;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
@dmgolembiowski
dmgolembiowski / fastio.py
Created October 12, 2022 16:50 — forked from jart/fastio.py
Multithreaded Python os.walk
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,