Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Bui Thang zenthangplus

🎯
Focusing
Block or report user

Report or block zenthangplus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zenthangplus
zenthangplus / Dockerfile
Last active Apr 3, 2019
Redirect logs from file to docker's output
View Dockerfile
# 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 Jan 15, 2019
Fix permission denied when execute stop or kill docker containers on Ubuntu
View fix-permission-docker-kill.sh
#!/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 Jan 15, 2019
How to generate RS256 Key Pair for Mac & Linux
View rs256.sh
#!/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
You can’t perform that action at this time.