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
# /etc/profile.d/teleport.sh | |
# Set environment in Teleport session | |
if [ -n "${SSH_TELEPORT_USER}" ] | |
then | |
USER_FIRSTNAME=$(echo "${SSH_TELEPORT_USER%%@*}" | cut -d'.' -f1) | |
USER_LASTNAME=$(echo "${SSH_TELEPORT_USER%%@*}" | cut -d'.' -f2) | |
export USER_FULLNAME="${USER_FIRSTNAME^} ${USER_LASTNAME^}" | |
export GIT_AUTHOR_NAME="${USER_FULLNAME}" | |
export GIT_AUTHOR_EMAIL="${SSH_TELEPORT_USER}" |
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 | |
# | |
# Example: ./kubectl-copy-secret.sh s3access default gitlab-runnner | |
SECRET_NAME=${1:?} | |
NS_SRC=${2:?} | |
NS_SRC=${3:?} | |
kubectl get secret $SECRET_NAME \ | |
--namespace=$NS_SRC \ |
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
affinity: | |
nodeAffinity: | |
requiredDuringSchedulingIgnoredDuringExecution: | |
nodeSelectorTerms: | |
- matchExpressions: | |
- key: kubernetes.io/hostname | |
operator: In | |
values: | |
- node_hostname |
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
KUBECONFIG=file1:file2:file3 kubectl config view --merge --flatten > config.yaml |
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
Signature: 8a477f597d28d172789f06886806bc55 | |
# This file is a cache directory tag. | |
# For information about cache directory tags, see: | |
# http://www.brynosaurus.com/cachedir/ |
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
#!/usr/bin/env bash | |
curl -i -X POST -H 'Content-Type: application/json' -d '{"channel_id":"<channel-id>", "message":"This is a message from a bot", "props":{"attachments": [{"pretext": "Look some text","text": "This is text"}]}}' -H 'Authorization: Bearer <bot-access-token>' <mattermost-url>/api/v4/posts |
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
#!/usr/bin/env bash | |
# | |
# usage: git-log-show-jira-commit.bash <JIRA_KEY> | |
# | |
JIRA_KEY=${1:?} | |
REGEX="^.*(${JIRA_KEY}-\d+).*\$" | |
git log -P --grep="${REGEX}" --pretty=%H | while read line | |
do |
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
$ brew install socat picocom | |
$ socat -d -d exec:/usr/bin/login,pty,setsid,setpgid,stderr,ctty pty,raw,echo=0 | |
2018/05/25 23:22:38 socat[81257] N forking off child, using pty for reading and writing | |
2018/05/25 23:22:38 socat[81257] N forked off child process 81258 | |
2018/05/25 23:22:38 socat[81257] N forked off child process 81258 | |
2018/05/25 23:22:38 socat[81257] N PTY is /dev/ttys004 | |
2018/05/25 23:22:38 socat[81257] N starting data transfer loop with FDs [5,5] and [7,7] | |
2018/05/25 23:22:38 socat[81258] W setpgid(0, 1): Operation not permitted | |
2018/05/25 23:22:38 socat[81258] W open("/dev/tty", O_NOCTTY, 0640): Device not configured |
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
#!/usr/bin/env python3 | |
import os | |
os.execvp("bash", ["-l"]) |
NewerOlder