References:
From man page: man apt_preferences
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
References:
From man page: man apt_preferences
Docker issues are frequently logged for DNS resolution in containers because it doens't inhert or get values for DNS from NetworkManager which leverages a built in dnsmasq to inteligently manage DNS.
sudo bash -c "echo listen-address=$(ip -4 addr show dev docker0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}') > /etc/NetworkManager/dnsmasq.d/docker-bridge"
sudo systemctl reload NetworkManager
sudo bash -c 'echo -e "{\n\t\"dns\": [\"$(ip -4 addr show dev docker0 | grep -oP "(?<=inet\s)\d+(\.\d+){3}")\"]\n}" > /etc/docker/daemon.json'
sudo systemctl restart docker
Syntax
${varName/Pattern/Replacement}
Given a variable
$ val="test"
The newer versions of bash (>= 3.0) include a regex operator =~
Simple example
$ re='t(es)t'
$ [[ "test" =~ $re ]]
$ echo $?
0
$ echo ${BASH_REMATCH[1]}
es
In this example
$'\n'
is the way to specify the newling within the subsitution$ t='1
> 2
A quick set of notes looking into Ubuntu mirror locations for South Africa from my home fiber (Vumatel). The examples should apply in general.
There are two phases
When testing performance of package list info downloads via upt-get update
, clear previous package info downloaded. If this isn't done, cached package info could skew results.
Some notes about:
These notes assume some basic background knowledge about memory management, ulimits and cgroups.
# Python script to test ssl via ssllabs service | |
# - input: space or newline delimited set of hostnames to test | |
# - process: sends request, polls till results are complete | |
# - output: saves html page | |
# - output: prints summary results per site in csv | |
# - output format: <fqdn/hostname>,<http status code>,<overall rating>,<certficate score %>,<protocol support score %>,<key exchange score %>,<cipher strength score %> | |
# python libs to use | |
import csv | |
from lxml import html |