Skip to content

Instantly share code, notes, and snippets.

View scalp42's full-sized avatar
πŸ‘¨β€πŸŽ¨

Anthony Scalisi scalp42

πŸ‘¨β€πŸŽ¨
View GitHub Profile
@svey
svey / maintenance.html
Last active June 8, 2020 04:30
maintenance page
<title>Maintenance</title><link href=https://gistcdn.githack.com/svey/79925db8db68fad5c0b65cdd105c23ba/raw/e9728abed18a117bcc640411366d98f70b57bd49/maintenance.css rel=stylesheet><div> <h1>W</h1> <img height=100 src=https://gistcdn.githack.com/svey/483b903af548ddaf053642ed0e897b22/raw/160c866bf9d3fafaadbce065401850e944cb5cf4/cog.svg width=100> <h1>n</h1> <img height=100 src=https://gistcdn.githack.com/svey/2f989026419c2f81bed8c0d8ddddbafb/raw/bddab7c3fe723380c88634889393b27bf8c67c2e/cog2.svg width=100> <h1>l</h1> <img height=100 src=https://gistcdn.githack.com/svey/c7f7010ee5d2e2983536f3abaee612e4/raw/d101366ec2c6abea1c55b77b87fda5bf265484d7/cog3.svg width=100></div><div> <h2>Scheduled Maintenanceβ€” Be back soon!</h2> <p>The Wonolo Customer Portal and App are undergoing maintenance. <p>For assistance contact [email protected].</div>
@kyleconroy
kyleconroy / 01_existing.go
Last active March 15, 2021 10:04
Go 2 - Error Handling Proposals
func CopyFile(src, dst string) error {
r, err := os.Open(src)
if err != nil {
return err
}
defer r.Close()
w, err := os.Create(dst)
if err != nil {
return err
@zoilomora
zoilomora / README.md
Last active April 20, 2025 20:46
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@artizirk
artizirk / gnupg_scdaemon.md
Last active March 4, 2025 10:54
OpenPGP SSH access with Yubikey and GnuPG

NB: This document describles a 'Old-School' way of using Yubikey with SSH

Modern OpenSSH has native support for FIDO Authentication. Its much simpler and should also be more stable with less moving parts. OpenSSH also now has support for signing arbitary files witch can be used as replacement of gnupg. Git also supports signing commits/tags with ssh keys.

Pros of FIDO

  • Simpler stack / less moving parts
  • Works directly with ssh, ssh-add and ssh-keygen on most computers
  • Simpler
  • Private key can never leave the FIDO device

Cons of FIDO

@sethwebster
sethwebster / README.md
Last active April 12, 2023 19:06
Make Docker Cache Gem Installs to speed up Bundle Install

Gem Install Dockerfile Hack

If you're hacking on your Gemfile and using Docker, you know the pain of having the bundle install command run after you've added or removed a gem. Using docker-compose you could mount a volume and stage your gems there, but this adds additional complexity and doesn't always really solve the problem.

Enter this imperfect solution:

What if we installed every gem into it's own Docker layer which would be happily cached for us?

gem-inject-docker does just that. It takes the list of gems used by your app via bundle list and transforms it into a list of RUN gem install <your gem> -v <gem version> statements and injects them into the Dockerfile at a point of your choosing.

@lox
lox / README.md
Last active November 13, 2019 04:17
How Buildkite Environment is Created

I've done a bit of a deep dive into how we produce our env. The flow is slightly complicated as some environment comes from the shell that the agent runs in and some comes from buildkite.com and then some is generated each job.

For context, the code that generates the job environment is here: https://github.com/buildkite/agent/blob/2f3d6935996d45877071c01f7b19ae07db302d69/agent/job_runner.go#L307-L426

Paraphrased, the process is:

  • A build is triggered on buildkite.com, with user-provided environment (step or pipeline level) and bk specific env
  • Write out base job environment to an env file for future reference and set BUILDKITE_ENV_FILE
  • The agent job runner merges in it's env (overwriting anything set above, creating "protected" env)
@kosyfrances
kosyfrances / site-to-site.md
Last active September 30, 2024 10:41
Steps to set up one tunnel IPSec Site to site VPN on AWS and a VM on another cloud provider (Packet) running Strongswan
@athyuttamre
athyuttamre / ip.py
Last active January 27, 2024 01:19
import requests
import json
import csv
import sys
KEY = "1dd922548150f47ec2980e90b659b793"
BULK = False
# One-by-one
def map_ip_to_location(ip):
@gottfrois
gottfrois / Dockerfile
Created September 6, 2018 09:06
medium-multi-stage-dockerfile-final-dockerfile
###############################
# Stage wkhtmltopdf
FROM madnight/docker-alpine-wkhtmltopdf as wkhtmltopdf
######################
# Stage: ruby
FROM ruby:2.5.1-alpine3.7 as ruby
LABEL description="Base ruby image used by other stages"
######################
@swalkinshaw
swalkinshaw / tutorial.md
Last active February 26, 2025 21:15
Designing a GraphQL API