su
sudo nano /etc/sudoers.d/allow_myuser_all
Add your new user in the following syntax. Confirm by: cat /etc/sudoers.d/allow_myuser_all
docker run \ | |
--name {{printf "%q" .Name}} \ | |
{{- with .HostConfig}} | |
{{- if .Privileged}} | |
--privileged \ | |
{{- end}} | |
{{- if .AutoRemove}} | |
--rm \ | |
{{- end}} | |
{{- if .Runtime}} |
Taken from: https://unix.stackexchange.com/a/224348/260245 and: https://unix.stackexchange.com/a/224239/260245
If you have [GParted][1] open, close it. Its Swapoff feature does not appear to to be permanent.
Open terminal and become [root
][2] ([su
][3]); if you have [sudo
][4] enabled, you may also do for example sudo -i
; see [man sudo
][5] for all options):
sudo -i
Turn off the particular [swap][6] partition and / or all of the [swap][6]s:
#!/usr/local/bin/bash | |
# pkg install bash | |
# add to shellcmd as "/root/push_ip_metrics.sh &" via Services/shellcmd | |
pushgatewayip="192.168.1.2:9091" | |
network="192.168.1.0/24" | |
interface="bce1" | |
interval="1" | |
rate -i "${interface}" -r "${interval}" -e -n -Ab -a 255 -c "${network}" -d | while read -r line; do |
#!/bin/bash | |
version="${VERSION:-1.0.1}" | |
arch="${ARCH:-linux-amd64}" | |
bin_dir="${BIN_DIR:-/usr/local/bin}" | |
wget "https://github.com/prometheus/node_exporter/releases/download/v$version/node_exporter-$version.$arch.tar.gz" \ | |
-O /tmp/node_exporter.tar.gz | |
mkdir -p /tmp/node_exporter |
Replace default apt us mirror (http://us.archive.ubuntu.com/ubuntu/) to au mirror (http://au.archive.ubuntu.com/ubuntu/) in Vim:
:%s/us.archive.ubuntu.com/au.archive.ubuntu.com/g
Replace default apt us mirror (http://us.archive.ubuntu.com/ubuntu/) to au mirror (http://au.archive.ubuntu.com/ubuntu/) in Terminal:
# For MAC:
sed -i '' -e 's/us.archive.ubuntu.com/au.archive.ubuntu.com/g' /etc/apt/sources.list
# Other Linux:
// Place your key bindings in this file to override the defaults | |
[ | |
{ | |
"key": "ctrl+shift+l", | |
"command": "editor.action.insertSnippet", | |
"when": "editorTextFocus", | |
"args": { | |
"snippet": "console.log(\"${TM_SELECTED_TEXT}\", ${TM_SELECTED_TEXT});" | |
} | |
} |
# the general idea | |
ImageTag="git" | |
FilePath="/Dockerfile" | |
RepoURI="123456789012.dkr.ecr.eu-west-1.amazonaws.com/repo" | |
Stages=$(cat $FilePath | grep -oP '^FROM .+ (AS|as) \K(.+)$') | |
CacheArgs=$(for Stage in $Stages; do echo "--cache-from $RepoURI:cache-$Stage"; done | paste -sd ' ') | |
BuildArgs="--file $FilePath $CacheArgs" | |
for Stage in $Stages; do docker pull $RepoURI:cache-$Stage || true; done | |
for Stage in $Stages; do docker build $BuildArgs --tag $RepoURI:cache-$Stage --target $Stage . || break; done | |
docker build $BuildArgs --tag $RepoURI:$ImageTag . |
aws ssm get-parameters-by-path --recursive --path "/CodeBuild/" --max-items 100 |
import { Directus } from "@directus/sdk"; | |
const DIRECTUS_ENDPOINT = process.env.DIRECTUS_HOST || ""; | |
const DIRECTUS_TOKEN = process.env.DIRECTUS_TOKEN || ""; | |
const directus = new Directus(DIRECTUS_ENDPOINT, { | |
auth: { | |
staticToken: DIRECTUS_TOKEN, | |
}, | |
}); |