Skip to content

Instantly share code, notes, and snippets.

View tamasgal's full-sized avatar

Tamas Gal tamasgal

View GitHub Profile
@goll
goll / README.md
Last active April 4, 2024 22:20
Docker nftables configuration for Debian 10
@haproxytechblog
haproxytechblog / blog20191008-01.sh
Last active March 27, 2024 20:59
HAProxy and Docker Swarm
$ apt update
$ apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
$ apt update
$ apt install docker-ce docker-ce-cli containerd.io
@carceneaux
carceneaux / remove_gitlab_artifacts.sh
Last active March 22, 2024 18:25
Script for removing GitLab Job Artifacts.
#!/bin/bash
#
# Written by Chris Arceneaux
# GitHub: https://github.com/carceneaux
# Email: carcenea@gmail.com
# Website: http://arsano.ninja
#
# Note: This code is a stop-gap to erase Job Artifacts for a project. I HIGHLY recommend you leverage
# "artifacts:expire_in" in your .gitlab-ci.yml
#
@rossant
rossant / glwidget.py
Created November 26, 2018 17:14
Minimal modern PyQt5, OpenGL, QOpenGLWindow working example
#!/usr/bin/env python3
"""
Code from http://www.labri.fr/perso/nrougier/python-opengl/#the-hard-way
"""
import ctypes
import logging
@onigoetz
onigoetz / docker-compose.yml
Created October 16, 2018 06:06
Rocket Chat sticky load balancing with docker-compose and haproxy
version: '2'
services:
rocketchat1:
image: rocketchat/rocket.chat:0.65.1
restart: unless-stopped
volumes:
- ./uploads:/app/uploads
environment:
- PORT=3000
@superseb
superseb / get_kubeconfig_custom_cluster_rancher2.sh
Last active October 13, 2023 05:51
Get kubeconfig for custom cluster in Rancher 2.x
#!/bin/bash
# Usage: ./get_kubeconfig_custom_cluster_rancher2.sh cluster_name
# Needs to be run on the server running `rancher/rancher` container
# Check if jq exists
command -v jq >/dev/null 2>&1 || { echo "jq is not installed. Exiting." >&2; exit 1; }
# Check if clustername is given
if [ -z "$1" ]; then
echo "Usage: $0 [clustername]"
@MetalArend
MetalArend / swarm.yml
Last active April 16, 2024 13:54
Run a GitLab Runner on your Swarm
version: '3.4'
secrets:
# Find your registration token at: "Your project" > "Settings" > "CI/CD" > "Runners settings" > "Specific Runners" (look for registration token)
# Register it as `GITLAB_REGISTRATION_TOKEN`: `docker secret create GITLAB_REGISTRATION_TOKEN YOUR_REGISTRATION_TOKEN`
GITLAB_REGISTRATION_TOKEN:
external: true
# Find your personal access token at: "Your user account" > "Settings" > "Access Tokens" > "Create personal access token" (for api)
# Register it as `GITLAB_PERSONAL_ACCESS_TOKEN`: `docker secret create GITLAB_PERSONAL_ACCESS_TOKEN <YOUR ACCESS TOKEN>`
@rkrzr
rkrzr / auto_tags.py
Last active April 10, 2024 11:14
Automatically generate ansible tags of the same name for each role in a playbook
"""
This module implements an Ansible plugin that is triggered at the start of a playbook.
The plugin dynamically generates a tag for each role. Each tag has the same name as its role.
The advantage of this is that it saves you some boilerplate, because you don't have to wrap
all tasks of a role in an additional block and assign a tag to that.
Additionally, it works automatically when you add new roles to your playbook.
Usage is exactly the same as without this plugin:
@oifland
oifland / Jenkinsfile
Last active March 23, 2024 17:59
Loops in Jenkinsfiles
// Related to https://issues.jenkins-ci.org/browse/JENKINS-26481
abcs = ['a', 'b', 'c']
node('master') {
stage('Test 1: loop of echo statements') {
echo_all(abcs)
}
stage('Test 2: loop of sh commands') {
@pbugnion
pbugnion / ipython_notebook_in_git.md
Last active October 22, 2023 12:25
Keeping IPython notebooks under Git version control

This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.

To use the script, follow the instructions given in the script's docstring.

For further details, read this blogpost.

The procedure outlined here is inspired by this answer on Stack Overflow.