Monday, March 9, 2020
Delete Docker images filter by Name
docker images | grep -E "name_of_images" | awk '{print $1}' | xargs docker rmi
Thursday, March 5, 2020
KONG & KONGA
#!/bin/sh
export VERSION=latest
docker network create kong-net
docker run -d --name kong-database \
--network=kong-net \
-p 5432:5432 \
-e "POSTGRES_USER=kong" \
-e "POSTGRES_DB=kong" \
-e "POSTGRES_HOST_AUTH_METHOD=trust" \
postgres:9.6
sleep 5
docker run --rm \
--network=kong-net \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=kong-database" \
kong:$VERSION kong migrations bootstrap
docker run -d --name kong \
--network=kong-net \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=kong-database" \
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
-p 8000:8000 \
-p 8443:8443 \
-p 8001:8001 \
-p 8444:8444 \
kong:$VERSION
docker run -d --name konga-database \
--network=kong-net \
-e "POSTGRES_USER=kong" \
-e "POSTGRES_DB=kong" \
-e "POSTGRES_HOST_AUTH_METHOD=trust" \
postgres:9.6
sleep 5
docker run --rm --network=kong-net pantsel/konga -c prepare -a postgres -u postgresql://kong@konga-database:5432/konga_db
docker run -d -p 1337:1337 \
--network=kong-net \
-e "DB_ADAPTER=postgres" \
-e "DB_HOST=konga-database" \
-e "DB_USER=kong" \
-e "DB_DATABASE=konga_db" \
-e "KONGA_HOOK_TIMEOUT=120000" \
-e "NODE_ENV=production" \
--name konga \
pantsel/konga
export VERSION=latest
docker network create kong-net
docker run -d --name kong-database \
--network=kong-net \
-p 5432:5432 \
-e "POSTGRES_USER=kong" \
-e "POSTGRES_DB=kong" \
-e "POSTGRES_HOST_AUTH_METHOD=trust" \
postgres:9.6
sleep 5
docker run --rm \
--network=kong-net \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=kong-database" \
kong:$VERSION kong migrations bootstrap
docker run -d --name kong \
--network=kong-net \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=kong-database" \
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
-p 8000:8000 \
-p 8443:8443 \
-p 8001:8001 \
-p 8444:8444 \
kong:$VERSION
docker run -d --name konga-database \
--network=kong-net \
-e "POSTGRES_USER=kong" \
-e "POSTGRES_DB=kong" \
-e "POSTGRES_HOST_AUTH_METHOD=trust" \
postgres:9.6
sleep 5
docker run --rm --network=kong-net pantsel/konga -c prepare -a postgres -u postgresql://kong@konga-database:5432/konga_db
docker run -d -p 1337:1337 \
--network=kong-net \
-e "DB_ADAPTER=postgres" \
-e "DB_HOST=konga-database" \
-e "DB_USER=kong" \
-e "DB_DATABASE=konga_db" \
-e "KONGA_HOOK_TIMEOUT=120000" \
-e "NODE_ENV=production" \
--name konga \
pantsel/konga
Monitor Docker Services
docker volume create portainer_data
docker run \
--name portainer-docker-info \
--restart always\
-d \
-p 80:9000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer
Tuesday, March 3, 2020
netsh portproxy WSL2
netsh interface portproxy show all
netsh interface portproxy add v4tov4 listenport=HOST_PublishPort listenaddress=0.0.0.0 connectport=WSL_Port connectaddress=WSL_IPAddress
ex:
netsh interface portproxy add v4tov4 listenport=8000 listenaddress=0.0.0.0 connectport=8000 connectaddress=172.28.81.216
netsh interface portproxy add v4tov4 listenport=8080 listenaddress=0.0.0.0 connectport=8080 connectaddress=172.28.81.216
netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=172.28.81.216
netsh interface portproxy add v4tov4 listenport=5000 listenaddress=0.0.0.0 connectport=5000 connectaddress=172.28.81.216
netsh interface portproxy add v4tov4 listenport=HOST_PublishPort listenaddress=0.0.0.0 connectport=WSL_Port connectaddress=WSL_IPAddress
ex:
netsh interface portproxy add v4tov4 listenport=8000 listenaddress=0.0.0.0 connectport=8000 connectaddress=172.28.81.216
netsh interface portproxy add v4tov4 listenport=8080 listenaddress=0.0.0.0 connectport=8080 connectaddress=172.28.81.216
netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=172.28.81.216
netsh interface portproxy add v4tov4 listenport=5000 listenaddress=0.0.0.0 connectport=5000 connectaddress=172.28.81.216
Wednesday, February 26, 2020
Nginx redirect from http to https non-standard Port
create nginx config file on /etc/nginx/conf.d
ex. /etc/nginx/conf.d/redirect.conf
server {
listen 80;
server_name localhost;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name localhost;
ssl_certificate /etc/nginx/ssl/certs.crt;
ssl_certificate_key /etc/nginx/ssl/key.key;
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
ssl_ciphers 'kEECDH+ECDSA+AES128 kEECDH+ECDSA+AES256 kEECDH+AES128 kEECDH+AES256 kEDH+AES128 kEDH+AES256 DES-CBC3-SHA +SHA !aNULL !eNULL !LOW !kECDH !DSS !MD5 !RC4 !EXP !PSK !SRP !CAMELLIA !SEED';
ssl_protocols TLSv1.2;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;
return 301 $scheme://$host:6081$request_uri;
}
server {
listen 6081 ssl;
server_name localhost;
ssl_certificate /etc/nginx/ssl/certs.crt;
ssl_certificate_key /etc/nginx/ssl/key.key;
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
ssl_ciphers 'kEECDH+ECDSA+AES128 kEECDH+ECDSA+AES256 kEECDH+AES128 kEECDH+AES256 kEDH+AES128 kEDH+AES256 DES-CBC3-SHA +SHA !aNULL !eNULL !LOW !kECDH !DSS !MD5 !RC4 !EXP !PSK !SRP !CAMELLIA !SEED';
ssl_protocols TLSv1.2;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;
location / {
include /etc/nginx/conf.d/common_location.conf;
root /usr/share/nginx/html;
index index.html index.htm;
# proxy_pass http://11.11.11.250:5000; #pass_to_backendserver
}
}
Friday, January 17, 2020
Using Vue Variable in Jinja Python Flask
- Using {% raw %} directive
ex.
<div id="app">
{% raw %}
{{ var_from_vue }}
{% endraw %}
</div>
- Using Vue delemiters in Vue Instant
ex.
var app = new Vue({
el: '#app',
data: {
v1: 'variable 1'
},
delimiters: ['[[', ']]']
})
- Custom Directive in Python Flask Jinja
ex.
app = Flask(__name__)
jinja_options = app.jinja_options.copy()
jinja.options.update(dict(
variable_start_string='[[',
variable_end_string=']]'
))
app.jinja_options = jinja_options
Thursday, December 5, 2019
Subscribe to:
Posts (Atom)
ALCATEL 6900
write memory copy running certified reload from working no rollback-timeout
-
SET LLDP System NAME: system name ALL-Uplink system location SIAM-FL11 SHOW LLDP Configure: show lldp config or show lldp local-syste...
-
grant execute on utl_http to wc grant execute on dbms_lock to wc; BEGIN DBMS_NETWORK_ACL_ADMIN.create_acl ( acl => ...
-
:system view system-view or sys :show all config dis current-configuration :create vlan vlan vlan_number :show ip interface ...