Skip to content

Instantly share code, notes, and snippets.

View f9n's full-sized avatar
💭
I may be slow to respond.

Fatih Sarhan f9n

💭
I may be slow to respond.
View GitHub Profile
@f9n
f9n / VagrantMacosBox.md
Last active November 26, 2018 19:21
Vagrant kullanarak Macos kurmak.
$ # Ilk once Virtualbox'in yaninda <Oracle VM VirtualBox Extension Pack> 'ide indirmelisiniz.
$ ### Arch Linux
$ yay virtualbox-ext-oracle
Vagrant.configure("2") do |config|
  # Box'in boyutu yaklasik 9GB'dir.
 config.vm.box = "jhcook/macos-sierra"
@f9n
f9n / GeneratePdf.md
Last active January 1, 2019 10:29
Generate pdf for websites

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

Ssh client use only password

$ ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no <login_username>@<host>
@f9n
f9n / RemoveNetworkInterfaceOnVagrant.md
Created August 16, 2019 09:47
Remove unused network interfaces on Vagrant

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
@f9n
f9n / MacOsDockerLoginProblem.md
Last active September 4, 2019 13:55
MacOS docker login problem

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 / Spacewalk2.9_Centos7.md
Created September 16, 2019 07:51
Install Spacewalk 2.9 on Centos 7

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 / erlang-cookie-generator.sh
Last active September 30, 2019 13:36
Erlang Cookie Generator for Rabbitmq
@f9n
f9n / kube-cluster-merger.sh
Last active August 10, 2021 20:24
Kube Cluster Merger
#!/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 / RabbitmqAllQueuesOnAllVhosts.sh
Created November 7, 2019 12:31
rabbitmq list queues on all vhosts
#!/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 / redis_delete_keys_without_ttl.sh
Last active February 3, 2023 09:05 — forked from patrickhulce/findkeys.sh
Delete all keys without a TTL in Redis
#!/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