Skip to content

Instantly share code, notes, and snippets.

@Raboo
Raboo / migrate-dockerhub-to-ghcr.sh
Last active Dec 14, 2022 — forked from charlieoleary/migrate-to-ecr.sh
Migrate your Docker Hub organization(docker.io) to Github Container Registry(ghcr.io).
View migrate-dockerhub-to-ghcr.sh
#!/bin/bash
#
# A simple bash script to migrate your Docker Hub organization to Github Container Registry.
# forked from https://gist.github.com/charlieoleary/05c1dab2e19703f73a041e585e060dc9
#
# In order for this to work you must run this from a system that is logged in to both the GHCR
# repository you are migrating to and the Docker Hub organization you are migrating FROM with
# podman.
#
# Due to how Docker works (pulling / pushing images), this script can be run over and over
@Raboo
Raboo / 1vcpu-2GBram-64GBnvme-vultr-se-sto.log
Created Jan 14, 2022
Vultr 10$ per month, 1vcpu, 2GB RAM, 64GB NVMe, DC Sweden Stockholm yabs.sh
View 1vcpu-2GBram-64GBnvme-vultr-se-sto.log
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2021-12-28 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Fri 14 Jan 2022 10:33:16 AM UTC
Basic System Information:
---------------------------------
@Raboo
Raboo / force_uninstall_hive.sh
Last active Dec 17, 2021
Ambari force uninstall components without dependencies.
View force_uninstall_hive.sh
#!/bin/sh
# https://cwiki.apache.org/confluence/display/AMBARI/Using+APIs+to+delete+a+service+or+all+host+components+on+a+host
AMBARI_USER='admin'
AMBARI_PASSWORD='PWPWPW'
AMBARI_HOST='ambari.local'
CLUSTER_NAME='hdp'
NODE='hadoop-master04.se-ix.delta.prod'
# curl -u $AMBARI_USER:$AMBARI_PASSWORD -H "X-Requested-By: ambari" -X GET http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER_NAME/components/ | grep component_name
curl -u $AMBARI_USER:$AMBARI_PASSWORD -H "X-Requested-By:ambari" -i -X DELETE http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER_NAME/hosts/$NODE/host_components/WEBHCAT_SERVER
@Raboo
Raboo / kubeswitcher.1m.sh
Created Jun 11, 2021
xbar/bitbar Kubeconfig Namespace & Context Switcher
View kubeswitcher.1m.sh
#!/bin/bash
# -*- coding: utf-8 -*-
# <xbar.title>Kubeconfig Namespace & Context Switcher</xbar.title>
# <xbar.version>v0.1</xbar.version>
# <xbar.author>Elias Abacioglu</xbar.author>
# <xbar.author.github>Raboo</xbar.author.github>
# <xbar.desc>Displays active kubeconfig namespace and allows you to easily change namespaces.</xbar.desc>
# <xbar.dependencies>bash,kubectl</xbar.dependencies>
@Raboo
Raboo / aptly_ubuntu.rb
Last active Mar 4, 2019
chef aptly cookbook mirroring ubuntu repos
View aptly_ubuntu.rb
# ubuntu
excluded_sections = '!Section (comm), !Section (debug), !Section (fonts), !Section (games), !Section (gnome), !Section (graphics), !Section (kde), !Section (localization), !Section (math), !Section (restricted/x11), !Section (science), !Section (sound), !Section (translations), !Section (universe/comm), !Section (universe/debug), !Section (universe/electronics), !Section (universe/embedded), !Section (universe/fonts), !Section (universe/games), !Section (universe/gnome), !Section (universe/gnustep), !Section (universe/graphics), !Section (universe/hamradio), !Section (universe/kde), !Section (universe/localization), !Section (universe/math), !Section (universe/news), !Section (universe/science), !Section (universe/sound), !Section (universe/translations), !Section (universe/video), !Section (universe/x11), !Section (universe/xfce), !Section (universe/zope), !Section (video), !Section (x11), !Section (zope)'
# packages that we want to include from excluded sections
included_packages = '| fonts-dejavu|
@Raboo
Raboo / netcat-tar-pipe.sh
Last active Oct 18, 2022
Command line snippets
View netcat-tar-pipe.sh
# should be faster than rsync
# 1. receiver
nc -l 6001 | tar xvpP
# 2. sender
tar cfP - /etc/profile.d | nc ${HOST} 6001
@Raboo
Raboo / sshuttle.sh
Last active Jun 15, 2022 — forked from rchrd2/sshuttle.sh
BitBar + sshuttle
View sshuttle.sh
#!/usr/bin/env bash
#
# Easily start/stop sshuttle
#
# <xbar.title>sshuttle</xbar.title>
# <xbar.version>v1.2</xbar.version>
# <xbar.author>Elias Abacioglu</xbar.author>
# <xbar.author.github>Raboo</xbar.author.github>
# <xbar.desc>Easily start/stop a background sshuttle.</xbar.desc>
# <xbar.dependencies>sshuttle</xbar.dependencies>
View kontorsnätet.txt
+-----------------------------------------------------------------------------------------+
|Ena änden av vår lokal Andra änden av vår lokal |
| |
| |
| |
+------------+ +-------------------+
|| Upplänk | 1Gbit/s CAT 6.e/CAT 7 kabel |Switch med ||
|| + +--------------------------------------------------------+anslutning till ||
|| LAN Router| |alla accesspunkter||
|| 1 Gbit/s | +-------------------+
@Raboo
Raboo / coreos_test01.sh
Last active Sep 26, 2017
testing CoreOS on Vultr
View coreos_test01.sh
#!/bin/bash
cat > "cloud-config.yaml" <<EOF
#cloud-config
ssh_authorized_keys:
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwYfh0FG1DK+VIePvOGKaU/maBFYppeZ8CtwlzSaemx0t8ZjUBkzgXZKiqdqWkm2TR713UHCa2d0ZV4168XaEBrnRHk+zJoH5yOInaByMJ30bR1SDI850adi7Wu6Lp3qwvyW5DLMfAX9gOXFrD40MQyetSNnazEFDuNG0knOTlGeKR5O2aTiQTVI8ich3e35DESS3COmo3gdI7zCJas9sQ5jsDa Macbook"
- "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwSQ36wK1WJIdJBECFL92F0CjKH5u7jYdZ9MEv9wKOzmeFpbw9qWwAjrW++kcj3Kg5QoieYqGDDPvaFlfuH32G8WhXrRPXykjxaNbsylKPtVmpjB9cr6JZ8GhzZW+hdeDx2O2nx8xZikxV08+D/fzqyV5+0OcfY1Q/ooLGtnkVO8wUw30WJp7Wbt9JTUxCpp0hQVVfXkpwIWIF7vKLpOG+QbIkSGzVTwJg95h0gIvkpWdyYF4eK0whYAwR3/rzchvPRsyQJnS9sdWYYBl/wvvFxNUFA05KFxw7r4LUPmw+vzPdYJP0m0uXvw9IgGGTM/3ntPMa1rgoJnBQI1G7bqmFw== Windows"
coreos:
@Raboo
Raboo / consul2etcd.sh
Last active Aug 22, 2017
A one liner to migrate data from consul kv to etcd kv.
View consul2etcd.sh
./consul kv get -http-addr=[CONSUL ADDR]:8500 -recurse | grep : | cut -d: -f1 | while read line ; do ./consul kv get -http-addr=[CONSUL ADDR]:8500 $line |head -c-1 | ./etcdctl --endpoints http://[ETCD ADDR]:2379 set $line ; done