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
package main | |
import ( | |
"fmt" | |
) | |
func removeDuplicatesFromSlice(s []string) []string { | |
m := make(map[string]bool) | |
for _, item := range s { | |
if _, ok := m[item]; ok { |
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
setenv USERID `id -u` | |
if ($?prompt) then | |
set sshagentcount = `ps x | grep -c ssh-agent` | |
if !($sshagentcount > 1 ) then | |
eval `ssh-agent -s` | |
else | |
setenv SSH_AGENT_PID `pgrep -u $USERID ssh-agent` | |
@ sshagentsocknum = $SSH_AGENT_PID - 1 | |
setenv SSH_AUTH_SOCK `find /tmp -maxdepth 2 -name agent.$sshagentsocknum |& grep -v "Permission denied"` | |
endif |
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
#!py | |
import salt.utils.http | |
def run(): | |
ret = salt.utils.http.query('http://169.254.169.254/openstack/2012-08-10/meta_data.json', decode=True) | |
return ret['dict'] |
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
/* This jenkins job builds locally and deploys {master}@{booking} to {test-deploy-target} for {bp} project (applying {bp} config) | |
*/ | |
pipeline { | |
agent any | |
options { | |
timestamps() | |
ansiColor('xterm') | |
withCredentials([sshUserPrivateKey(credentialsId: 'jenkins-deployer__test-deploy-target', keyFileVariable: 'SSH_KEY_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
[alias] | |
lg1 = log --graph --pretty=format:'%C(bold red)%h%Creset -%C(bold yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) %C(bold yellow)%d%C(reset) - %C(white)%s%C(reset) %C(cyan)- %an%C(reset)%C(bold green)(%ar)%C(reset)' --all | |
lg3 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all | |
lg = !"git lg1" |
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
- source_labels: [__address__] | |
regex: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3}).*' | |
target_label: __address__ | |
replacement: 'ip-$1-$2-$3-$4.eu-west-2.compute.internal' | |
action: replace |
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
--- | |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: django-service-boilerplate | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: |
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
clickhouse-exporter-discovery: | |
module.run: | |
- name: consul.catalog_register | |
- node: mynode | |
- address: mynode | |
- service: clickhouse_exporter | |
- service_address: {{ salt['network.interfaces']()['ens3']['inet'][0]['address'] }} | |
- service_port: 9116 | |
- service_id: {{ grains['id'] }} | |
- consul_url: http://consulhost:8500 |
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
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY" [75/167] | |
set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock | |
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf | |
set-option -g status-bg colour235 #base02 | |
set-option -g status-fg colour136 #yellow | |
set-option -g status-attr default | |
# set window split | |
bind-key - split-window -v |