Skip to content

Instantly share code, notes, and snippets.

Admir Trakic atrakic

  • pwnd
  • Copenhagen
Block or report user

Report or block atrakic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View resume.json
{
"basics": {
"name": "Admir Trakic",
"label": "DevOps engineer",
"email": "xomodo@gmail.com",
"phone": "(45) 29133654",
"website": "https://atrakic.github.io",
"summary": "Software engineer with hands on experience in building and running resilient solutions in the cloud.",
"location": {
"city": "Vanloese",
View better-ssh-authorized-keys-management.md

Better SSH Authorized Keys Management

A seemingly common problem that people encounter is how to handle all of your users authorized_keys file.

People struggle over management, ensuring that users only have specific keys in the authorized_keys file or even a method for expiring keys. A centralized key management system could help provide all of this functionality with a little scripting.

One piece of functionality overlooked in OpenSSH is the AuthorizedKeysCommand configuration keyword. This configuration allows you to specify a command that will run during login to retrieve a users public key file from a remote source and perform validation just as if the authorized_keys file was local.

Here is an example directory structure for a set of users with SSH public keys that can be shared out via a web server:

View setup-pihole.sh
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 123.123.123.123 password"
echo "Specify your host's LAN IP and the desired Pihole password"
exit 1
fi
IP=$1
PASSWORD=$2
View setup-pihole.sh
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 123.123.123.123 password"
echo "Specify your host's LAN IP and the desired Pihole password"
exit 1
fi
IP=$1
PASSWORD=$2
@atrakic
atrakic / gitlab-ci.yaml
Created Oct 16, 2019 — forked from lucj/gitlab-ci.yaml
kube deployment
View gitlab-ci.yaml
deploy-kube:
stage: deploy
environment: test
image: dtzar/helm-kubectl:2.12.3
script:
- kubectl config set-cluster sophia-cluster --server=${KUBE_URL} --certificate-authority="${KUBE_CA_PEM_FILE}"
- kubectl config set-credentials sophia-admin --token=${KUBE_TOKEN}
- kubectl config set-context sophia-context --cluster=sophia-cluster --user=sophia-admin --namespace ${KUBE_NAMESPACE}
- kubectl config use-context sophia-context
- helm upgrade --reuse-values --set image.tag=$CI_BUILD_REF sophia k8s-chart
@atrakic
atrakic / urlencode
Created Oct 14, 2019 — forked from cbron/urlencode
URL encode/decode script
View urlencode
#!/usr/bin/python
import urllib
import sys
text = sys.argv[1]
encoded = urllib.quote_plus(text)
print encoded
@atrakic
atrakic / rioStart.sh
Created Oct 14, 2019 — forked from daxmc99/rioStart.sh
rioStart.sh
View rioStart.sh
#!/bin/bash
#set -x
#set -e
k3d delete --name='rio'
k3d create -n rio --image rancher/k3s:v0.8.1 --publish 80:80 --publish 443:443 --publish 9443:9443 --publish 9080:9080 &&
declare -i i; i=0
until k3d get-kubeconfig --name='rio'
do
if (( i > 20 )); then
break
View gist:5a3a5bc974c98ab1b71dd69eee0e5856
image:
name: hashicorp/terraform:light
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
before_script:
- rm -rf .terraform
- terraform --version
- mkdir -p ./creds
View Howto_kubespray_vagrant
# 1) Install
git clone https://github.com/kubernetes-sigs/kubespray.git
# 2) Fix port fwd:
cat vagrant/config.rb
$forwarded_ports = {6443 => 6443}
# 3) Follow steps 3-8: (https://github.com/polyaxon/polyaxon/issues/349#issuecomment-462052351)
# 4) Verify installment (still while on vagrant host)
View java_docker_debug_centos_query_app.sh
#!/bin/bash
# install RPM package (due to its size intentinally omited from Dockerfile):
yum install -y java-1.8.0-openjdk-devel.x86_64
# get id in which java process we are interested:
JPID=$(jps -l|grep query | awk '{print $1}')
# prepare for filegen:
FILE=dump-$(date +"%s").hprof
You can’t perform that action at this time.