Skip to content

Instantly share code, notes, and snippets.

@thaim
thaim / error.log
Last active March 30, 2022 11:56
terraform-provider-aws debug log for aws_codebuild_project
2022-03-30T11:56:04.476Z [INFO] Terraform version: 1.1.7
2022-03-30T11:56:04.476Z [INFO] Go runtime version: go1.17.2
2022-03-30T11:56:04.476Z [INFO] CLI args: []string{"/home/thaim/.tfenv/versions/1.1.7/terraform", "plan"}
2022-03-30T11:56:04.476Z [DEBUG] Attempting to open CLI config file: /home/thaim/.terraformrc
2022-03-30T11:56:04.476Z [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2022-03-30T11:56:04.476Z [INFO] Loading CLI configuration from /home/thaim/.terraform.d/credentials.tfrc.json
2022-03-30T11:56:04.476Z [DEBUG] checking for credentials in "/home/thaim/.terraform.d/plugins"
2022-03-30T11:56:04.476Z [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2022-03-30T11:56:04.476Z [DEBUG] will search for provider plugins in /home/thaim/.terraform.d/plugins
2022-03-30T11:56:04.476Z [DEBUG] ignoring non-existing provider search directory /home/thaim/.local/share/terraform/plugins
@thaim
thaim / harbor_restore_1-2.sh
Created August 11, 2018 13:47
restore harbor 1.2
db_pwd='root123'
harbor_db_path='/data/database'
harbor_cfg='/home/thaim/harbor-1.2.2/harbor.cfg'
backup_path='/backup'
tag='1.2'
docker run -it --rm \
-e DB_USR=root \
-e DB_PWD=${db_pwd} \
@thaim
thaim / harbor_migrate_1-2_1-5.sh
Created August 11, 2018 10:00
migrate harbor 1.2 to 1.5
db_pwd='root123'
harbor_db_path='/data/database'
harbor_cfg='/home/thaim/harbor-1.5.2/harbor.cfg'
tag='v1.5.0'
docker run -it --rm \
-e DB_USR=root \
-e DB_PWD=${db_pwd} \
-v ${harbor_db_path}:/var/lib/mysql \
-v ${harbor_cfg}:/harbor-migration/harbor-cfg/harbor.cfg \
@thaim
thaim / harbor_migrate_1-1_1-2.sh
Created August 11, 2018 09:49
migrate harbor 1.1 to 1.2
db_pwd='root123'
harbor_db_path='/data/database'
harbor_cfg='/home/thaim/harbor-1.1.1/harbor.cfg'
tag='1.2'
docker run -it --rm \
-e DB_USR=root \
-e DB_PWD=${db_pwd} \
-v ${harbor_db_path}:/var/lib/mysql \
-v ${harbor_cfg}:/harbor-migration/harbor-cfg/harbor.cfg \
@thaim
thaim / backup_harbor_1_2.sh
Last active August 11, 2018 13:45
harbor backup script (for v1.2)
db_pwd='root123'
harbor_db_path='/data/database'
harbor_cfg='/home/thaim/harbor-1.2.2/harbor.cfg'
backup_path='/backup'
tag='1.2'
docker run -it --rm \
-e DB_USR=root \
-e DB_PWD=${db_pwd} \
-v ${harbor_db_path}:/var/lib/mysql \
@thaim
thaim / build.sh
Created October 14, 2017 11:53
generate ssh key with docker let's encrypt
#!/bin/bash
docker run -it --rm \
-p 443:443 \
--name letsencrypt \
-v "/etc/letsencrypt:/etc/letsencrypt" \
-v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
quay.io/letsencrypt/letsencrypt:latest certonly
@thaim
thaim / show_subprojects_in_table.js
Last active May 2, 2018 12:01
redmine 'view customize plugin' script to show subprojects in table
// Path pattern: /projects/[a-z0-9\-_]+$
// Type : JavaScript
$(function() {
var box = document.getElementsByClassName('projects box')[0]
var leaf = $(box).children('a');
var rows = [];
for (var i=0; i<leaf.length; i++) {
rows.push(createRow(leaf.eq(i)));
@thaim
thaim / configuration.log
Last active July 10, 2016 15:40
configuration result for OpenCV 3.1.0
-- General configuration for OpenCV 3.1.0 =====================================
-- Version control: 3.1.0
--
-- Platform:
-- Host: Linux 4.4.0-21-generic x86_64
-- CMake: 3.5.1
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: RELEASE
--
gitlab:
image: gitlab/gitlab-ce:8.3.0-ce.0
volumes_from:
- gitlab-datavolume
ports:
- "8070:80"
net: "devel"
gitlab-datavolume:
image: busybox
@thaim
thaim / ChooseTheBestOne.java
Created May 5, 2014 20:31
SRM619Div2Medium (500pt)
import java.util.ArrayList;
import java.util.List;
public class ChooseTheBestOne {
public int countNumber(int N) {
int idx = 0;
List<Integer> remain = new ArrayList<Integer>();
for (int i=0; i<N; i++) {
remain.add(i+1);
}