Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Fatih Sarhan f9n

💭
I may be slow to respond.
Block or report user

Report or block f9n

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
@f9n
f9n / inventory
Created Jan 9, 2020
Alertmanager Cluster Setup
View inventory
[alertmanagers]
10.250.250.1
10.250.250.2
10.250.250.3
@f9n
f9n / redis_delete_keys_without_ttl.sh
Last active Dec 29, 2019 — forked from patrickhulce/findkeys.sh
Delete all keys without a TTL in Redis
View redis_delete_keys_without_ttl.sh
#!/bin/sh
LIMIT=$1
redis-cli keys "*" | head -n $LIMIT > keys.txt
cat keys.txt | xargs -n 1 -L 1 redis-cli ttl > ttl.txt
paste -d " " keys.txt ttl.txt | grep .*-1$ | cut -d " " -f 1 | xargs redis-cli del
@f9n
f9n / RabbitmqAllQueuesOnAllVhosts.sh
Created Nov 7, 2019
rabbitmq list queues on all vhosts
View RabbitmqAllQueuesOnAllVhosts.sh
#!/bin/bash
# https://stackoverflow.com/questions/43799932/rabbitmq-list-queues-on-all-vhosts
for i in $(rabbitmqctl list_vhosts); do
echo "vhost: $i" && rabbitmqctl list_queues -p $i;
done
@f9n
f9n / kube-cluster-merger.sh
Last active Nov 20, 2019
Kube Cluster Merger
View kube-cluster-merger.sh
#!/usr/bin/env bash
DIRPATH=$1
OUTFILE=$2
if [ -z "$1" ]; then
DIRPATH="$HOME/.kube/clusters"
fi
if [ -z "$2" ]; then
OUTFILE="$HOME/.kube/config"
@f9n
f9n / hosts_generator_from_ansible_inventory.sh
Created Oct 2, 2019
Hosts generator from ansible inventory
View hosts_generator_from_ansible_inventory.sh
#!/usr/bin/env bash
IFS=$'\n'
for h in $(grep hostname inventory); do
ip=$(echo $h | cut -d' ' -f1)
hostname=$(echo $h | cut -d' ' -f2 | cut -d'=' -f2)
echo -e "- ip: $ip\n alias: $hostname"
done
@f9n
f9n / erlang-cookie-generator.sh
Last active Sep 30, 2019
Erlang Cookie Generator for Rabbitmq
View erlang-cookie-generator.sh
@f9n
f9n / Spacewalk2.9_Centos7.md
Created Sep 16, 2019
Install Spacewalk 2.9 on Centos 7
View Spacewalk2.9_Centos7.md

Installation

  • Add the environment variables to /etc/environment
$ vi /etc/environment
LC_ALL="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LANGUAGE="en_US.UTF-8"
@f9n
f9n / MacOsDockerLoginProblem.md
Last active Sep 4, 2019
MacOS docker login problem
View MacOsDockerLoginProblem.md

Problem

Error saving credentials: error storing credentials - err: exit status 1, out: The user name or passphrase you entered is not correct.

Resolution

  • Remove the line "credsStore": "osxkeychain" from ~/.docker/config.json
  • Deleting the file /usr/local/bin/docker-credential-osxkeychain
@f9n
f9n / RemoveNetworkInterfaceOnVagrant.md
Created Aug 16, 2019
Remove unused network interfaces on Vagrant
View RemoveNetworkInterfaceOnVagrant.md

Vagrant no longer removes unused network interfaces and leaves it up to the user. This can forcibly be re-enabled using VirtualBox provider-specific config:

config.vm.provider "virtualbox" do |v|
  v.destroy_unused_network_interfaces = true
end
View ssh-client-configuration.md

Ssh client use only password

$ ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no <login_username>@<host>
You can’t perform that action at this time.