Skip to content

Instantly share code, notes, and snippets.

View AndreSteenveld's full-sized avatar

Andre Steenveld AndreSteenveld

View GitHub Profile
@nileshtrivedi
nileshtrivedi / home-server.md
Last active January 10, 2024 06:30
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.

@tjmoses
tjmoses / mssql_dump.sh
Last active June 17, 2022 07:02
Bash Script to Automate SQL Server Database Backups with mssql-scripter
#!/bin/bash
###################################################################
#Script Name : mssql_dump.sh
#Description : will create SQL scripts as defined by mssql-scripter
# and will zip backup files and store for X days (set to 30)
#Author : Tim Moses
#Github : https://github.com/tjmoses
#Notes : Make sure to add the appropriate MSSQL_SCRIPTER_CONNECTION_STRING
# for your db connection. Also, revise your target & edition
# sql server for the mssql-scripter command below. The zip library is
@gmanny
gmanny / OptionJsonConverter.cs
Last active May 17, 2022 15:54
JsonConverter for LanguageExt.Option which serializes empty Options as nulls.
using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Reflection;
using LanguageExt;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
public class OptionJsonConverter : JsonConverter
{
@CarlosDomingues
CarlosDomingues / python-poetry-cheatsheet.md
Last active May 19, 2024 05:20
Python Poetry Cheatsheet

Create a new project

poetry new <project-name>

Add a new lib

poetry add <library>

Remove a lib

@NikolayS
NikolayS / becnh_m5.2xlarge.out
Last active November 17, 2021 21:52
pgbench: simple INSERTs, UPDATEs with and without triggers
# m5.2xlarge 32.0 GiB 8 vCPUs
# s=100, n=10
*** Only SELECTs, -T 30 -j4 -c12
transaction type: <builtin: select only>
scaling factor: 100
query mode: prepared
number of clients: 12
number of threads: 4
duration: 30 s
@styblope
styblope / docker-api-port.md
Last active May 24, 2024 03:00
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@Warchant
Warchant / sonarqube-docker-compose.yml
Last active March 15, 2024 13:04
docker-compose file to setup production-ready sonarqube
version: "3"
services:
sonarqube:
image: sonarqube
expose:
- 9000
ports:
- "127.0.0.1:9000:9000"
networks:
@cmendible
cmendible / Roslyn.CodeGeneration.Program.cs
Created August 16, 2017 09:30
Create a class with dotnet core and roslyn with using statements outside the namespace
using System;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace Roslyn.CodeGeneration
{
public class Program
{
public static void Main(string[] args)
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@samgooi4189
samgooi4189 / bcm57765or57785fix
Last active April 19, 2024 04:20
Fixing Broadcom Corporation BCM57765/57785 SDXC/MMC Card Reader
Follow the WORKAROUND:
1. Add a comand to /etc/rc.local, add the following line above "exit 0":
setpci -s 00:1c.2 0x50.B=0x41
2. Add the same comand to /etc/apm/resume.d/21aspm (which does not exist yet):
setpci -s 00:1c.2 0x50.B=0x41
3. Add the following to /etc/modprobe.d/sdhci.conf:
options sdhci debug_quirks2=4
4. Re-generate initrd:
sudo update-initramfs -u -k all
5. Reboot or reload sdhci module: