Skip to content

Instantly share code, notes, and snippets.

View dungdt88's full-sized avatar

Richard Dam dungdt88

  • Ho Chi Minh City, Vietnam
View GitHub Profile
@dungdt88
dungdt88 / Hugo_CLI.md
Created September 1, 2018 07:01
Hugo Commands

Export to static HTML:

hugo -s [/path/to/source] -d [/path/to/destination] -b [/base/url]
@dungdt88
dungdt88 / tmux_example.md
Created July 6, 2018 05:05
Tmux to share bash session

Create a new session

tmux new -s <session-name>

List all current session

tmux ls
@dungdt88
dungdt88 / .vimrc
Created April 15, 2018 04:10
Sample .vimrc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer:
" Amir Salihefendic
" http://amix.dk - [email protected]
"
" Version:
" 5.0 - 29/05/12 15:43:36
"
" Blog_post:
" http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github
@dungdt88
dungdt88 / nginx_handle_proxy_down.md
Created September 29, 2017 09:46
Nginx - Handle Response when Proxy is down

When the proxied service is unavailable, Nginx will by default return HTTP code 502. We can change this response by the following config:

server {
  location {
      proxy_pass http://somehost/someuri
  }
  ...
@dungdt88
dungdt88 / linux_date_time.md
Last active September 29, 2017 06:43
Set Date / Time on Linux

Update Time

date +%T -s "HH:mm:ss"

For example:

date +%T -s "15:28:00"

Create the CA Key and Certificate for signing Client Certs

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 1095 -key ca.key -out ca.crt

Create the Server Key, CSR, and Certificate

openssl genrsa -out server.key 4096
openssl req -new -key server.key -out server.csr
@dungdt88
dungdt88 / fix_httpd_selinux_permission_denied.sh
Created December 30, 2016 07:44
Fix issue when apache user cannot write to some directory due to SELinux
chcon -R -t httpd_sys_content_t /path/to/directory
chcon -R -t httpd_sys_content_rw_t /path/to/directory
@dungdt88
dungdt88 / firewall-cmd-rich-rule.md
Last active September 26, 2023 22:42
Allow docker to access all containers within host with firewall-cmd rich rule in Centos 7
@dungdt88
dungdt88 / Reset Archiva Admin Password.md
Last active September 25, 2020 08:56
How to reset archiva admin password

I don't know how to reset Archiva admin password -.- My work around is to create a new admin by deleting Archiva's user database.

Steps

  1. Delete Archiva user database. Don't forget to make a backup.
 mv /archiva-root/data/databases/users /archiva-root/data/databases/users_bak
## Create a new Bridge network
docker network create --driver=bridge --subnet=172.17.0.1/24 --gateway=172.17.0.1 --ip-range=172.17.0.0/24 network-name