Skip to content

Instantly share code, notes, and snippets.

@palewire
palewire / README.md
Last active June 21, 2024 17:08
How to push tagged Docker releases to Google Artifact Registry with a GitHub Action

How to push tagged Docker releases to Google Artifact Registry with a GitHub Action

Here's how I configured a GitHub Action so that a new version issued by GitHub's release interface will build a Dockerfile, tag it with the version number and upload it to Google Artifact Registry.

Before you attempt the steps below, you need the following:

  • A GitHub repository that contains a working Dockerfile
  • The Google Cloud SDK tool gcloud installed and authenticated

Create a Workload Identity Federation

@heyfluke
heyfluke / remap_docker_user_to_host_user.md
Last active May 10, 2024 21:57
remap docker user to host user.

Problem

When I use docker to work with the shared workspace with host under Ubuntu, I find that files created by docker user is owned by root. This is not the same with macOS.

Maybe this is becuase docker is run by root user and the default user mapping mechanism is to map container-root to host-user or host-root. So can I map the container-root or container-any-user to host-current-user?

Fortunately the latest docker supports the re-map the container user to any host user via Linux namespace. Refer to this.

Linux namespace

@bgauduch
bgauduch / multiple-repository-and-identities-git-configuration.md
Last active July 2, 2024 01:50
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@taija
taija / uptime-robot-microsoft-teams
Created May 15, 2017 14:31
Webhook for integrating Uptime Robot with Microsoft Teams
{
"text": " *alertDetails* - ID: *monitorID*. URL: [*monitorURL*](*monitorURL*)",
"title": "*monitorFriendlyName* is *alertTypeFriendlyName*"
}
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@bgromov
bgromov / git-reset-author.sh
Created June 23, 2016 17:50
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@f3l1x
f3l1x / aliases
Last active January 29, 2024 19:21
Docker - installation, tips, commands, aliases
# ------------------------------------
# Docker alias and function
# ------------------------------------
# Get latest container ID
alias dl="docker ps -l -q"
# Get container process
alias dps="docker ps"
@jleinonen
jleinonen / gdal_mmap.py
Created June 14, 2013 12:02
Use a GDAL memory-mapped file to open an image retrieved via HTTP directly as a NumPy array without saving to a temporary file.
from gzip import GzipFile
from io import BytesIO
import urllib2
from uuid import uuid4
import gdal
def open_http_query(url):
try:
request = urllib2.Request(url,