Skip to content

Instantly share code, notes, and snippets.

View Finkregh's full-sized avatar
🚲

Oluf Lorenzen Finkregh

🚲
View GitHub Profile
@Finkregh
Finkregh / install.sh
Created February 8, 2024 14:01 — forked from llimllib/install.sh
The script I use to set up a new mac just the way I like it
#!/usr/bin/env bash
# many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos
# many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac
# instructions on finding the default you've changed: https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/
# previous install notes at:
# https://gist.github.com/llimllib/ee591266e05bd880629a4e7511a61bb3
# https://gist.github.com/llimllib/e864a92da94ceb1ef0da2e06fd1f8d70
# https://gist.github.com/llimllib/3fc4fefcfc0152dad8c58201246d8802
#
# this script's URL is: https://gist.github.com/llimllib/c4dd0a98a426022b0365d4c0a9090460
@Finkregh
Finkregh / semantic-layout.html
Created December 23, 2020 21:30 — forked from thomd/semantic-layout.html
Standard HTML5 Semantic Layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
<link href="stylesheets/main.css" rel="stylesheet" />
</head>
<body>
<header>
<hgroup>
@Finkregh
Finkregh / otp.txt
Created November 26, 2020 10:00 — forked from sshimko/otp.txt
Yubikey + FreeIPA Manual Setup
In Yubikey tool:
1. Click OATH+HOTP tab
2. Click Advanced
3. Deselect token identifier.
4. Press Generate to create a new random seed.
@Finkregh
Finkregh / docker-for-mac.md
Created January 9, 2020 10:24 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker for Mac Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Moby VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@Finkregh
Finkregh / google_dns.md
Created August 2, 2019 15:38 — forked from dwallraff/google_dns.md
Google DNS rate limiting of ICMP - (blatantly stolen from @dupuy's post https://goo.gl/pPjWH7)

TL;DR: At the risk of repeating myself: Google Public DNS is a Domain Name System service, not an ICMP network testing service.

If you want to measure the quality of your DNS service from Google Public DNS, you should use a dnsping tool (https://github.com/farrokhi/dnsdiag [Python] or https://sourceforge.net/projects/dnsping/ [C#]) to send real DNS queries and check for responses. Note that while traceroute -U sends UDP/53 packets, they are not DNS queries, and traceroute -U is not a substitute for dnsping.

If dnsping shows significant levels of unanswered queries (and especially if ping and traceroute do not show any drops), you should check whether your IP address is generating more than 100 queries per second (the default per-IP address QPS limit for Google Public DNS). If you are legitimately generating more than 100 QPS and need to increase your QPS limit, you can [request an increase through the Google Public DNS is

@Finkregh
Finkregh / delete_git_submodule.md
Created July 5, 2019 14:50 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@Finkregh
Finkregh / nginx-tuning.md
Created April 29, 2019 11:19 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@Finkregh
Finkregh / hfsc-shape.sh
Created April 11, 2018 17:46 — forked from eqhmcow/hfsc-shape.sh
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.
@Finkregh
Finkregh / rancher-zerotier.yml
Created March 26, 2018 21:33 — forked from elcritch/rancher-zerotier.yml
Run ZeroTier on RancherOS
#cloud-config
rancher:
services:
zerotier:
image: zerotier/zerotier-containerized:1.2.4
labels:
io.rancher.os.scope: system
volumes:
- /var/lib/zerotier-one:/var/lib/zerotier-one
restart: always
#!/bin/bash
# Make this executable and name it .git/hooks/pre-commit to have commits
# randomly rejected with a prompt to rethink it. The odds are higher for
# longer commits
set -eu
# How many lines a commit must have before it's considered long and should
# have the highest odds of getting an extra prompt