Skip to content

Instantly share code, notes, and snippets.

View zenthangplus's full-sized avatar
🎯
Focusing

Thang Bui zenthangplus

🎯
Focusing
View GitHub Profile
@zenthangplus
zenthangplus / Dockerfile
Last active April 3, 2019 09:22
Redirect logs from file to docker's output
# To do that, you need to create symlink from your file (inside container) to docker's output file.
# Add bellow line to your Dockerfile
RUN ln -sf /proc/1/fd/1 /var/log/cronjob.log
# EXPLAIN:
# The first 1 is the PID of docker process.
# The second 1 is standard output
@zenthangplus
zenthangplus / fix-permission-docker-kill.sh
Created January 15, 2019 04:21
Fix permission denied when execute stop or kill docker containers on Ubuntu
#!/usr/bin/env bash
# Error example:
# ERROR: for redis cannot stop container: 16028f9:
# Cannot kill container 16028f9: unknown error after kill: docker-runc did not terminate sucessfully:
# container_linux.go:393: signaling init process caused "permission denied"
#
# This error was caused by AppArmor service in Ubuntu
# It was not working normally due to some unknown issues.
# Run following commands to fix it.
@zenthangplus
zenthangplus / rs256.sh
Last active March 17, 2024 16:26
How to generate RS256 Key Pair for Mac & Linux
#!/usr/bin/env bash
# Generate rsa keys pair
ssh-keygen -t rsa -b 4096 -f rs256.rsa
# Don't add passphrase
openssl rsa -in rs256.rsa -pubout -outform PEM -out rs256.rsa.pub
# Done
cat rs256.rsa