Skip to content

Instantly share code, notes, and snippets.

View neidiom's full-sized avatar
🌴
On vacation

Nedim Hadzimahmutovic neidiom

🌴
On vacation
View GitHub Profile
@palewire
palewire / README.md
Last active April 17, 2025 17:18
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

@erankitcs
erankitcs / 1.web_ami_image.json
Last active April 5, 2022 14:53
Packer Image builder and CI/CD Pipeline
{
"variables": {
"aws_region": "us-east-1",
"base_ami": ""
},
"builders": [
{
"type": "amazon-ebs",
"region": "{{user `aws_region`}}",
"source_ami": "{{user `base_ami`}}",
@mikesparr
mikesparr / main.tf
Last active March 9, 2023 11:34
Terraform GCP Secure Example (Infra)
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 3.37"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 3.37"
}
@wenerme
wenerme / k3s-new-cert.sh
Created July 12, 2020 06:12
K3S Create Client Cert
#!/bin/bash
set -e
fail(){
echo "error: $*"
echo "usage: ./k3s-new-cert <name> [subject=/O=admin]"
exit 1
}
@pedrohdz
pedrohdz / extract-credentials.groovy
Last active March 24, 2025 12:28
Export credentials for Jenkins Configuration as Code (JCasC)
// This Jenkins Groovy script extracts credentials in Jenkins and outputs them
// in a JSON format that can be digested by "Jenkins Configuration as Code".
// Just pass the output into a JSON to YAML converter. You can run this
// through the Jenkins Script Console or similar.
//
// Thank you:
// - https://github.com/tkrzeminski/jenkins-groovy-scripts/blob/master/show-all-credentials.groovy
//
// To conver to YAML `json2yaml | sed '/^[[:space:]]*$/d'`
//
@bacongravy
bacongravy / tar-gz.rb
Last active November 1, 2024 04:34
Creates a gzipped tar archive using vanilla Ruby and no temporary files
require 'rubygems/package'
filenames_and_contents = {
"filename" => "content",
}
File.open("archive.tar.gz", "wb") do |file|
Zlib::GzipWriter.wrap(file) do |gzip|
Gem::Package::TarWriter.new(gzip) do |tar|
filenames_and_contents.each_pair do |filename, content|
@gabrielrojasnyc
gabrielrojasnyc / file_go_no.go
Created October 22, 2017 22:28
file_go_no.go
package main
import (
"fmt"
"log"
"io"
"os"
"net/http"
"time"
)
@jcorioland
jcorioland / create-acs-kubernetes.md
Created October 16, 2017 15:29
Create an Azure Container Service Kubernetes Cluster with Azure CLI

Create an Azure Container Service Kubernetes Cluster with Azure CLI

Login (interactive) to your Azure subscription using Azure CLI

az login

Create a resource group

@miladoll
miladoll / execute_once.rb
Last active December 12, 2021 09:22
Itamaeでなんかいちどだけexecuteを実行するための適当なプラグイン
require 'fileutils'
require 'digest/md5'
require "itamae/resource/base"
require "itamae/logger"
module Itamae
module Plugin
module Resource
class ExecuteOnce < Itamae::Resource::Base
define_attribute :action, default: :execute_once
define_attribute :cmd, type: String, default_name: true
@section-io-gists
section-io-gists / varnish-anonymous-wordpress.vcl
Created September 11, 2017 15:49
This Varnish configuration is meant for Wordpress sites where site users are always anonymous.
# Please note: There is an underlying default Varnish behavior that occurs after the VCL logic
# you see below. You can see the bultin code here
# https://github.com/varnishcache/varnish-cache/blob/5.1/bin/varnishd/builtin.vcl
#
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
# and http://varnish-cache.org/trac/wiki/VCLExamples for more examples.
# Marker to tell the VCL compiler that this VCL has been adapted to the
# new 4.0 format.
vcl 4.0;