Skip to content

Instantly share code, notes, and snippets.

From self[at]sungpae.com Mon Nov 8 16:59:48 2021
Date: Mon, 8 Nov 2021 16:59:48 -0600
From: Sung Pae <self[at]sungpae.com>
To: security@docker.com
Subject: Permissive forwarding rule leads to unintentional exposure of
containers to external hosts
Message-ID: <YYmr4l1isfH9VQCn@SHANGRILA>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
protocol="application/pgp-signature"; boundary="QR1yLfEBO/zgxYVA"
@andriyudatama
andriyudatama / VS Code Disable GPU Acceleration
Last active May 7, 2024 14:18
Disable Hardware Acceleration (GPU) on Visual Studio Code
Visual Studio Code frequently crashes linux. Using NVIDIA GPU
1. Open command pallete (Ctrl + Shift + P)
2. Enter "Preferences: Configure Runtime Arguments"
3. Add config: "disable-hardware-acceleration": true
4. Restart VS Code
@devops-school
devops-school / terraform-install-ansible-playbook-example.tf
Created December 21, 2019 10:59
Terraform Install Ansible and Run Playbook Example
provider "aws" {
region = "eu-west-1"
access_key = ""
secret_key = ""
}
resource "aws_instance" "example" {
ami = "${var.ami-mine}"
instance_type = "t2.micro"
key_name = "rajesh"
@ivmm
ivmm / gnome_install.sh
Created July 25, 2017 13:33
gnome_install.sh
#!/bin/bash
# init_centos shell
#安装说明参见 https://sadsu.com/?p=266
#----------------------------------------------------------#
# Variables&Functions #
#----------------------------------------------------------#
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
plain='\033[0m'
@nicor88
nicor88 / bootstrap_jupyter.sh
Created April 20, 2017 10:23
Bootstrap action to install Conda and Jupyter on EMR
#!/usr/bin/env bash
set -x -e
JUPYTER_PASSWORD=${1:-"myJupyterPassword"}
NOTEBOOK_DIR=${2:-"s3://myS3Bucket/notebooks/"}
# home backup
if [ ! -d /mnt/home_backup ]; then
sudo mkdir /mnt/home_backup
sudo cp -a /home/* /mnt/home_backup
@bzamecnik
bzamecnik / README.md
Last active November 16, 2023 08:58
Anaconda Python script running as systemd service

Anaconda Python script running as systemd service

This way a Python daemon can be installed on Rasbian, Ubuntu or similar systems using systemd.

Installing:

sudo cp hello.service /lib/systemd/system/hello.service
sudo systemctl daemon-reload
sudo systemctl enable hello.service
@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active May 5, 2024 10:12
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

@rioshen
rioshen / Backtrack.java
Created September 24, 2014 00:25
Backtracking Template
public class Backtrack {
public static List<List<Object>> backtrack(int[] A) {
// Set up a list of list to hold all possible solutions
List<List<Object>> result = new LinkedList<List<Object>>();
if (A == null || A.length == 0) {
return result;
}
// As we need to recursively generate every solution,
// a variable is needed to store single solution.
@wdullaer
wdullaer / docker-cleanup
Last active August 17, 2023 14:17
Cleanup unused Docker images and containers
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'