Skip to content

Instantly share code, notes, and snippets.

View scalp42's full-sized avatar
🪂

Anthony Scalisi scalp42

🪂
View GitHub Profile
@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 January 5, 2026 14:33
Designing a GraphQL API

About the pic

Choria supports Federating multiple collectives of nodes into a large Federated collective for the purpose of orchestrating.

Federation Requests have:

  • A orchestration request as normal
  • Special headers listing which nodes its for

The client chops a large request into bundles of 200 nodes and publish them to the network for federation. Multiple federation brokers can thus take care of distributing it.

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active March 5, 2026 18:07
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@AtulKsol
AtulKsol / db_backup_commands.md
Last active December 28, 2024 02:23
Commands to backup & restore database
  1. pg_dump is a nifty utility designed to output a series of SQL statements that describes the schema and data of your database. You can control what goes into your backup by using additional flags.
    Backup: pg_dump -h localhost -p 5432 -U postgres -d mydb > backup.sql

    Restore: psql -h localhost -p 5432 -U postgres -d mydb < backup.sql

    -h is for host.
    -p is for port.
    -U is for username.
    -d is for database.

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
@matsukaz
matsukaz / application.rb
Last active May 13, 2025 06:14
Rails connection management to handle Amazon Aurora's failover
module xxx
class Application < Rails::Application
#(中略)
config.middleware.swap ActiveRecord::ConnectionAdapters::ConnectionManagement,
'ActiveRecord::ConnectionAdapters::ReconnectOnErrorManagement'
end
end