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 / 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 Oct 16, 2019
Kube Cluster Merger
View kube-cluster-merger.sh
#!/usr/bin/env bash
DIRPATH="$HOME/.kube/clusters"
OUTFILE="$HOME/.kube/config"
_KUBECONFIG=""
for file_cluster in $(ls $DIRPATH); do
if [ -z "$_KUBECONFIG" ]; then
_KUBECONFIG=$DIRPATH/$file_cluster
else
_KUBECONFIG=$_KUBECONFIG:$DIRPATH/$file_cluster
@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>
@f9n
f9n / ModernCommandLineTools.md
Created Jan 1, 2019
Modern command line tools
View ModernCommandLineTools.md
@f9n
f9n / GeneratePdf.md
Last active Jan 1, 2019
Generate pdf for websites
View GeneratePdf.md

Generate Pdf for Websites

Wkhtmltopdf

$ sudo pacman -S wkhtmltopdf
$ wkhtmltopdf  http://www.google.com google.pdf
qt5ct: using qt5ct plugin
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
You can’t perform that action at this time.