This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Need install: `sudo apt install osinfo-db-tools` | |
``` | |
sudo osinfo-db-import --local --latest | |
sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virtinst libvirt-daemon virt-manager -y | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_gw_by_iface(){ | |
# Return router ip of interface | |
# Usage: get_gw_by_iface IFACE | |
sudo traceroute -n -i $1 -m1 $(get-extip) 2>/dev/null | tail -1 | awk '{print $2}' | |
} | |
get_gw_by_iface2(){ | |
# Return router ip of interface (multitable) | |
# Usage: get_gw_by_iface IFACE | |
ip route list table all | awk '/default via/' | grep enp1s0 | awk '{print $3}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dst=$1 | |
dstport=$2 | |
while [ 1 ]; do | |
ts=$(date +%s.%N) | |
line=$(ss -eipn dst "$dst:$dstport" | grep "bbr") | |
rto=$(echo $line | grep -oP '\brto:.*?(\s|$)' | awk -F '[:,]' '{print $2}' | tr -d ' ') | |
rttvals=$(echo $line | grep -oP '\brtt:.*?(\s|$)' | awk -F '[:/]' '{print $2","$3}' | tr -d ' ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NGINX Hello app | |
docker run --rm --name nginx-hello -p 8081:80 -d nginxdemos/hello | |
# GOOGLE Hello app ver 1.0 | |
docker run --rm --name hello-app -p 8080:8080 -d gcr.io/google-samples/hello-app:1.0 | |
# Test in browser with http://localhost:8080 or http://localhost:8081 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Default Header": { | |
"prefix": "header", | |
"body": [ | |
"#!/usr/bin/env python", | |
"# -*- coding: utf-8 -*-", | |
"\"\"\"${1:Custom module name or brief description}.\n", | |
"${2:Enter description of this module}", | |
"", | |
"__author__ = ${3:[authors]}", | |
"__copyright__ = Copyright 2018", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo cp ~/.config/monitors.xml /var/lib/gdm3/.config/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d \ | |
--name=mariadb \ | |
--restart=always \ | |
-v /etc/localtime:/etc/localtime:ro \ | |
-e MYSQL_ROOT_PASSWORD=root \ | |
-v /storage/mariadb:/var/lib/mysql \ | |
-p 3306:3306 \ | |
mariadb:latest | |
docker run -d \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get Local IP Address | |
* | |
* @returns Promise Object | |
* | |
* getLocalIP().then((ipAddr) => { | |
* console.log(ipAddr); // 192.168.0.122 | |
* }); | |
*/ | |
function getLocalIP() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stop all containers | |
docker stop `docker ps -qa` | |
# Remove all containers | |
docker rm `docker ps -qa` | |
# Remove all images | |
docker rmi -f `docker images -qa ` | |
# Remove all volumes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
_______ ______ | |
|_ _\ \ / / ___| | |
| | \ \ / /\___ \ | |
| | \ V / ___) | | |
|_| \_/ |____/ | |
Teske Virtual System |