Skip to content

Instantly share code, notes, and snippets.

View dserodio's full-sized avatar
🐕

Daniel Serodio dserodio

🐕
View GitHub Profile
@santisbon
santisbon / Search my gists.md
Last active April 22, 2024 14:15
How to #search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@josh-padnick
josh-padnick / README.md
Last active March 16, 2024 15:19
Manually Edit AWS Console "Switch Role" Configuration in Bash

Manually Edit AWS Console "Switch Role" Configuration in Bash

Motivation

At Gruntwork, we work with multiple software teams. That means we have to modify the "Switch Role" history multiple times. But the only way to do that today is to delete your cookie and clear all AWS Console saved settings. That got old after a while, so these instructions enable you to modify the "Switch Roles" configuration directly.

The Big Picture

@bvis
bvis / Jenkinsfile
Last active January 3, 2023 20:45
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
#! /bin/bash
set -euo pipefail
# This script will remove automatic association for all networks not listed in the whitelist
# passed as the first argument. Passwords will NOT be removed from the Keychain.
#
# Alternatively, you can untick "Remember networks" in Network Preferences > Wi-Fi > Advanced,
# but then you won't be able to auto-join networks even temporarily, and you might already
# have a long list to go through.
#
@citrusui
citrusui / dropdown.md
Last active April 21, 2024 18:44
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@dserodio
dserodio / scrap.sh
Last active November 29, 2018 15:27
ps(1) tips and tricks
# show process start time for a give PID (GNU ps)
ps -o lstart= -p $PID
# show process start time for all processes (GNU ps)
ps ax -O lstart
# show process environment variables (BSD grep)
ps -Eww -p $PID

Source Code Typography

Presentation: http://www.slideshare.net/vancura/source-code-typography

Quotes

Dumb quotes (also known as straight quotes) are straight and vertical. Proper typography never uses straight quotes. They are left over from the age of typewriters, and their only modern use is for coding.

@alecl
alecl / Chef_test_kitchen_getting_started.md
Last active April 11, 2017 18:41 — forked from lamont-granquist/getting_started.md
Forked and adjusted notes for creating a sample cookbook and running it through test kitchen with docker.

ChefDK, Test Kitchen Driven NTP Cookbook via Docker

This gist is a fork from lamont-granquist modified to be even easier and faster by taking advantage of Docker. Given the rapid development and change rate of Chef finding this gist with instructions that still are valid and reasonable was much appreciated.

This gist uses TK+Berkshelf to drive creating a vagrant virts and converging a simple recipe to install and configure NTPd. This is a simple cookbook that has one recipe, one template (for ntp.conf) and one attribute file. It works on Ubuntu 12.04/14.04 and CentOS 6.4/7.1 (and derviatives) and the attribute file is used to support both distros.

This should work on Mac (where I developed it) and any chef-supported Linux that you can get Docker onto (Ubuntu/CentOS).

Because I use ChefDK and Test Kitchen, I can largely ignore setting up Docker and Berkshelf and can get right to work on writing recipe code.

@koreno
koreno / README.md
Last active April 1, 2020 10:44
'rebaser' improves on 'git rebase -i' by adding information per commit regarding which files it touched.

Prebase

git-prebase improves on 'git rebase -i' by adding information per commit regarding which files it touched.

  • Each file gets an alpha-numeric identifier at a particular column, a list of which appears below the commit list. (The identifiers wrap around after the 62nd file)
  • Commits can be moved up and down safely (without conflicts) as long as their columns don't clash (they did not touch the same file).

Installation

Add the executable to your path and git will automatically expose it as