Skip to content

Instantly share code, notes, and snippets.

@snc
snc / InteractiveLoginListener.php
Created October 25, 2011 13:44
Custom FOSUB redirects
<?php
namespace My\Bundle\EventListener;
use My\Bundle\User\User;
use Symfony\Component\Routing\Router;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
class InteractiveLoginListener
{
@jtimberman
jtimberman / knife.rb
Created February 1, 2012 19:33
Commented knife.rb for all the things
# Knife Configuration File.
#
# This is a Ruby DSL to set configuration parameters for Knife's
# general options. The default location for this file is
# ~/.chef/knife.rb. If multiple Chef repositories are used,
# per-repository configuration files can be created. A per repository
# configuration file must be .chef/knife.rb in the base directory of
# the Chef repository. For example,
#
# ~/Development/chef-repo/.chef/knife.rb
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 5, 2024 22:16 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@trestletech
trestletech / instance-types.sh
Created June 15, 2016 16:41
Get all EC2 Instance Types in All Availability Zones
#!/bin/bash
echo "Getting list of Availability Zones"
all_regions=$(aws ec2 describe-regions --output text --query 'Regions[*].[RegionName]' | sort)
all_az=()
while read -r region; do
az_per_region=$(aws ec2 describe-availability-zones --region $region --query 'AvailabilityZones[*].[ZoneName]' --output text | sort)
while read -r az; do
@endeepak
endeepak / influxdb_measurement_series_count_per_measurement.sh
Created January 30, 2017 14:05
Influxdb : Print cardinality / series count per measurement
#!/usr/bin/env bash
if [ "$#" -ne 1 ]
then
echo "Usage: $0 <db_name>"
exit 1
fi
db_name=$1
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: cheese
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: stilton.example.com
http:
@rohancme
rohancme / grafana-prometheus-values.yaml
Last active June 23, 2021 19:20
Values for the grafana helm chart to talk to an existing prometheus datasource
persistence:
enabled: true
accessModes:
- ReadWriteOnce
size: 5Gi
datasources:
datasources.yaml:
apiVersion: 1
datasources:
@danisla
danisla / README.md
Last active November 7, 2022 13:59
GKE GPU Sharing Daemonset

GPU Sharing on GKE DaemonSet

NOTE: This is not a Google supported product.

Example Usage

  1. Create a GKE cluster with a GPU node pool:
gcloud container clusters create gpu-sharing-demo --zone us-central1-c
@HenriTEL
HenriTEL / daemonset.yml
Created October 17, 2019 10:09
A custom driver installer for gke ubuntu based images that includes nvidia-docker.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nvidia-driver-installer
namespace: kube-system
labels:
k8s-app: nvidia-driver-installer
spec:
selector:
matchLabels:
@mucst
mucst / log-to-console-from-shared-lib-class.groovy
Last active February 9, 2024 07:01
How to println to console log from jenkins shared library class
/*
* If you develop a jenkins shared library, you might eventually face the issue described at:
* https://stackoverflow.com/questions/47320406/propagating-logs-in-shared-library-to-jenkins-job-console
*
* Many across the internet suggest to pass the "steps" object to the class as some (constructor) parameter, such as in
* https://www.jenkins.io/doc/book/pipeline/shared-libraries/#accessing-steps
*
* ... which works, however this might be difficult if there are many usages of the class where you "just" want to print something to
* the console, maybe just for some debugging purposes. Unfortunatelly standard java Logger (in the momemnt of writing this gist at least)
* does not work. A not so nice, however working solution can be the following.