Skip to content

Instantly share code, notes, and snippets.

View outofcoffee's full-sized avatar

Pete Cornish outofcoffee

View GitHub Profile
@thaJeztah
thaJeztah / README.md
Last active February 8, 2023 19:38
Docker Compose as a Docker CLI plugin

Run Docker Compose as a Docker CLI plugin

Just a quick fun experiment to try to make docker-compose work as a Docker CLI plugin

To use it (assuming you have docker compose installed):

  1. download a and install nightly build of the docker cli (linux macOS)
@ubergesundheit
ubergesundheit / index.md
Created November 6, 2017 13:19
ngrok on raspberrypi on systemd
  • Download ngrok binary
  • Create /etc/systemd/system/ngrok.service
  • Create /opt/ngrok/ngrok.yml
@fishi0x01
fishi0x01 / baseURL.groovy
Last active June 15, 2023 19:55
This is a collection of groovy scripts I gathered and use for bootstrapping Jenkins. Most of this can also be achieved with the CasC Plugin https://github.com/jenkinsci/configuration-as-code-plugin
#!groovy
/*
* This script configures the Jenkins base URL.
*/
import jenkins.model.JenkinsLocationConfiguration
JenkinsLocationConfiguration location = Jenkins.instance.getExtensionList('jenkins.model.JenkinsLocationConfiguration')[0]
location.url = 'https://jenkins-as-code-poc.devtail.io/'
@reda-alaoui
reda-alaoui / ChildFirstClassLoader.java
Last active June 20, 2017 22:37 — forked from dcshock/ChildFirstClassLoader.java
Child First ClassLoader
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
public class ChildFirstClassLoader extends URLClassLoader {
import groovy.json.JsonSlurper
import org.sonatype.nexus.repository.storage.Asset
import org.sonatype.nexus.repository.storage.StorageFacet
def DOCKER_REPOSITORY_NAME = 'docker-hosted'
def dockerRepository = repository.repositoryManager.get(DOCKER_REPOSITORY_NAME)
def dockerBlobStore = blobStore.blobStoreManager.get(dockerRepository.configuration.attributes.storage.blobStoreName)
def storageTx = dockerRepository.facet(StorageFacet.class).txSupplier().get()
try {
@petrabarus
petrabarus / command.sh
Created October 28, 2016 06:01
Execute random variable for each xargs argument
#!/usr/bin/env bash
seq 10 | xargs -I X bash -c "echo X \$RANDOM"
@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active January 6, 2024 22:04
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@juhaelee
juhaelee / react-typescript.md
Last active January 26, 2023 00:52
React + Typescript Cheatsheet

React + Typescript Cheatsheet

Setup

If you use atom... download & install the following packages:

What are Typescript type definition files? (*.d.ts)

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
import org.jboss.aesh.cl.CommandDefinition;
import org.jboss.aesh.cl.GroupCommandDefinition;
import org.jboss.aesh.cl.Option;
import org.jboss.aesh.console.AeshConsole;
import org.jboss.aesh.console.AeshConsoleBuilder;
import org.jboss.aesh.console.Prompt;
import org.jboss.aesh.console.command.Command;
import org.jboss.aesh.console.command.CommandResult;
import org.jboss.aesh.console.command.invocation.CommandInvocation;
import org.jboss.aesh.console.command.registry.AeshCommandRegistryBuilder;