This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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'}' |
NewerOlder