Skip to content

Instantly share code, notes, and snippets.

View weibeld's full-sized avatar

Daniel Weibel weibeld

View GitHub Profile
@weibeld
weibeld / kubernetes-books.md
Last active November 8, 2022 21:37
List of Kubernetes books
@weibeld
weibeld / screen-size.r
Created July 31, 2019 07:00
Screen size
# Calculate the size of an HTML element, whose size is specified with CSS, on
# the screen of a specific device (laptop, tablet, phone, ...).
#
# Where to get the needed information?
# - ppi: https://www.gsmarena.com/ or http://dpi.lv/
# - dpr: http://devicepixelratio.com/
# - linres: https://www.gsmarena.com/
# - viewport: default viewport width for mobile only, first line of:
# http://whatsmy.browsersize.com/
#
@weibeld
weibeld / webcrawler-1.go
Created July 31, 2019 06:46
Go webcrawler from "A Tour of Go"
package main
import (
"fmt"
"sync"
//"jrrors"
)
type Fetcher interface {
// Fetch returns the body of URL and
@weibeld
weibeld / medium-article-with-canonical-link.sh
Created July 31, 2019 06:19
Bash script for creating a Medium article with a canonical URL through the Medium API
#!/bin/bash
set -e
TITLE=$1
CANONICAL_URL=$2
if [[ "$#" -ne 2 ]]; then
cat <<EOF
USAGE
@weibeld
weibeld / prometheus.yml
Created July 31, 2019 06:07
Example Prometheus configuration (scrape config)
global:
scrape_interval: 10s
scrape_configs:
- job_name: node
static_configs:
- targets:
- localhost:9100
- job_name: python-app
static_configs:
- targets:
@weibeld
weibeld / amazon-eks-availability.md
Last active October 31, 2020 10:08
List of AWS regions where Amazon EKS is available

2018-12-07

During the last days, figured out a couple of things.

Creating and deleting users and vhosts through the RabbitMQ Management REST API

This is done through simple HTTP calls to different endpoints under http://host:15672/api/. All the calls use HTTP Basic Authentication with username and password of a RabbitMQ user with appropriate permissions.

To create a user and vhost and grant the user access to this vhost only:

@weibeld
weibeld / install-cloud-foundry.sh
Created August 28, 2018 08:41
Cloud Foundry installation script
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | apt-key add -
echo "deb https://packages.cloudfoundry.org/debian stable main" | tee /etc/apt/sources.list.d/cloudfoundry-cli.list
apt-get -y install apt-transport-https
apt-get -y update
apt-get -y install cf-cli
@weibeld
weibeld / blocked-apps-in-china.txt
Created August 28, 2018 08:05
Blocked applications in China (2018)
Blocked:
- WhatsApp
- Telegram
- Slack
- Reddit
- Medium
- Facebook
- Instagram
- Twitter
@weibeld
weibeld / install-docker-ec2-ubuntu.sh
Created August 3, 2018 07:59
Install Docker on AWS EC2 instance
#!/bin/bash
# Install Docker
apt-get update
apt-get install -y docker.io
# Add user 'ubuntu' to group 'docker'
usermod -aG docker ubuntu