Skip to content

Instantly share code, notes, and snippets.


Dreampuf dreampuf

View GitHub Profile
dreampuf /
Created Jul 8, 2020
How to create a vuejs3 project
vue create PROJECT_NAME
# select features you need
vue add vue-next
rm src/shims-tsx.d.ts
sed -i '' 's/RouteConfig/RouteRecordRaw/g' src/router/index.ts #
patch -p1 <<'EOF'
diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue
index dc773ba..01a7286 100644
--- a/src/components/HelloWorld.vue
dreampuf /
Last active Jul 2, 2020
Install JDK8 on Jessie in 2020
cat > /etc/apt/sources.list.d/openjdk.list <<"EOF"
deb [check-valid-until=no] jessie-backports main
apt-get update
apt install -t jessie-backports openjdk-8-jdk
update-alternatives --config java # select java1.8
dreampuf / bash
Last active Mar 21, 2020
How to get the golang package version of the latest git repo commit
View bash
# Credit:
TZ=UTC git --no-pager show \
--quiet \
--abbrev=12 \
--date='format-local:%Y%m%d%H%M%S' \
dreampuf / main.go
Last active Dec 10, 2019
Golang SSHAgent Usage Example
View main.go
package main
Golang SSHAgent Usage
import (
dreampuf / chicken_soup.ipynb
Last active Nov 19, 2019
Greasy Chiken Soup
View chicken_soup.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
dreampuf / ssh_test.go
Created Aug 27, 2019
Golang SSH Interactively shell show case
View ssh_test.go
package main
import (
dreampuf / calc.y
Last active Aug 22, 2019
hostlist generate by goyacc
View calc.y
package main
dreampuf /
Created Aug 7, 2019
Build a Node Exporter RPM package
# Extract Node Exporter RPM package
# Download the official tar package
dreampuf /
Created Apr 8, 2019
How to enable admission-pulgins in kubernetes of docker-desktop
# Install docker and kubernetes first
# Helpful link:
# Then you need to get into the virtual machine by (it may change in the future, but the path should be similar)
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
# Change the line in /etc/kubernetes/manifests/kube-apiserver.yaml
# - --enable-admission-plugins=Initializers,NodeRestriction
# to
# - --enable-admission-plugins=Initializers,NodeRestriction,ValidatingAdmissionWebhook,MutatingAdmissionWebhook
dreampuf /
Last active Feb 22, 2021
How to use Amazon ECR as service in GitlabCI jobs


OK, I've experimented a lot getting this going with the docker+machine executor (specifically with the amazonec2 driver, which I suspect is quite common for people looking at this thread!), it may also be helpful to others when debugging what's going on for them.

docker+machine is interesting because it has several relevant contexts (i.e. a file system and environment variables), which I shall refer to as:

  • "runner": what is running the gitlab-runner binary - in my case this is an ECS-managed docker container for the gitlab/gitlab-runner image on docker hub, but it could the systemd service configuration if you're running directly on the machine.
  • "job host": the docker-machine created machine (e.g. EC2 instance) that runs the docker daemon
  • "job container": the docker container for the image specified in the project .gitlab-ci.yaml (or the default in config.toml)