Skip to content

Instantly share code, notes, and snippets.

@strigazi
strigazi / gist:936caf0ce820ff13e4c47c3d083ffafe
Last active June 27, 2022 13:43
nginx to traefik annotations
kubernetes.io/ingress.class: nginx-cluster
kubernetes.io/ingress.class: traefik
nginx.ingress.kubernetes.io/proxy-body-size: "0"
# doesn't exitst
nginx.ingress.kubernetes.io/rewrite-target: /
traefik.ingress.kubernetes.io/rewrite-target: /
# tls will be terminated at the pod
@superseb
superseb / create_user_and_kubeconfig_rancher2.sh
Last active November 1, 2023 18:51
Create local user and generate kubeconfig in Rancher 2 via API
#!/bin/bash
RANCHERENDPOINT=https://your_rancher_endpoint/v3
# The name of the cluster where the user needs to be added
CLUSTERNAME=your_cluster_name
# Username, password and realname of the user
USERNAME=username
PASSWORD=password
REALNAME=myrealname
# Role of the user
GLOBALROLE=user
@stefanfoulis
stefanfoulis / docker_for_mac_disk_default_size.md
Last active June 29, 2023 12:02
How to resize Docker for Mac Disk image and set the default size for new images

Set the default size for new Docker for Mac disk images

UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).

If you are getting the error: No space left on device

Configuring the qcow2 size cap is possible in the current versions:

# my disk is currently 64GiB
@instaBOT
instaBOT / ubuntu-14.04-install-python-3.5.sh
Created October 13, 2016 15:13
Install Python 3.5.x in Ubuntu 14.04. Includes packages 'python3.5' and 'python3.5-dev', and latest 'pip'
#!/usr/bin/env bash
set -eu
sudo add-apt-repository --yes ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install --yes python3.5 python3.5-dev
@bmuschko
bmuschko / OfflineMavenRepository.groovy
Created December 4, 2015 04:58
Creating an offline Maven repository with Gradle
package org.gradle.training
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import org.gradle.api.DefaultTask
import org.gradle.util.GFileUtils
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.component.ModuleComponentIdentifier
import org.gradle.maven.MavenModule
@pboos
pboos / annotation-processor-build.gradle
Last active August 7, 2020 06:38
Gradle stuff for Android
configurations {
apt
}
dependencies {
compile 'com.squareup.dagger:dagger:1.1.0'
apt 'com.squareup.dagger:dagger-compiler:1.1.0'
}
android.applicationVariants.all { variant ->
@elentok
elentok / script_dir.sh
Created May 9, 2013 11:33
Current script directory (works in bash and zsh)
SCRIPT_DIR=`dirname ${BASH_SOURCE[0]-$0}`
SCRIPT_DIR=`cd $SCRIPT_DIR && pwd`