-
abs(float)
- Returns the absolute value of a given float. Example:abs(1)
returns1
, andabs(-1)
would also return1
, whereasabs(-3.14)
would return3.14
. See also thesignum
function. -
basename(path)
- Returns the last element of a path. -
base64decode(string)
- Given a base64-encoded string, decodes it and returns the original string.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
curl -L https://gist.github.com/dgk/9229027/raw/git_config.sh | sh | |
curl -L https://gist.github.com/dgk/a1a8a30e94f63524af0a36ee34518771/raw/.vimrc > "${HOME}/.vimrc" | |
curl -L https://gist.github.com/dgk/a1a639ff7bb4a4e0ecbf20233c7394db/raw/.zshrc > "${HOME}/.zshrc" |
This file contains 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
meta: | |
id: psd | |
file-extension: psd | |
endian: be | |
seq: | |
- id: file_header | |
type: file_header | |
- id: color_mode_data | |
type: color_mode_data | |
- id: image_resources |
This file contains 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 | |
set -o xtrace | |
rm -rf /etc/cni/net.d/* | |
ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) | |
REGION=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.region') | |
LIFECYCLE=$(aws ec2 describe-instances --region=$REGION --instance-ids=$ID | jq -r '.Reservations[].Instances[].InstanceLifecycle') | |
if [[ $LIFECYCLE = "spot" ]]; then | |
EXTRA_ARGS="--node-labels=lifecycle=Ec2Spot,aws.amazon.com/spot=true,node-role.kubernetes.io/spot-worker="; | |
else |
This file contains 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
resource "hcloud_server" "server" { # Create a server | |
name = "server-${local.name}" # Имя сервера | |
image = "${var.image}" # Базовый образ | |
server_type = "${var.server_type}" # Тип инстанса | |
location = "${var.location}" # Регион | |
backups = "false" # Включать ли бекапы | |
ssh_keys = ["${hcloud_ssh_key.user.id}"] # SSH ключ | |
user_data = "${data.template_file.instance.rendered}" # Скрипт, который отработает при старте | |
provisioner "file" { # Копирование файлов на инстанс |
This file contains 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
acme.challengeType=http-01 | |
acme.email=hostmaster@domain.tld | |
acme.enabled=true | |
acme.staging=false | |
acme.logging=true | |
acme.persistence.enabled=true | |
acme.persistence.size=1Gi | |
acme.persistence.storageClass=longhorn | |
dashboard.domain=traefik.clusterXY.domain.tld | |
dashboard.enabled=true |
This file contains 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
# .style.yapf | |
# | |
# DESCRIPTION | |
# Configuration file for the python formatter yapf. | |
# | |
# This configuration is based on the generic | |
# configuration published on GitHub. | |
# | |
# AUTHOR | |
# krnd |
See this issue.
Docker best practise to Control and configure Docker with systemd.
-
Create
daemon.json
file in/etc/docker
:{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
Did you know that you can have multiple helm tillers running in a cluster?
This may actually be useful to us for both security as well as isolating what our cluster ops team does from what our customers can do.
Helm security is such that "If you can talk to tiller, you can use that tiller" To be able to contact tiller, one needs to be able to create a pod in the namespace tiller resides in. Otherwise you will get an error message like:
NewerOlder