Skip to content

Instantly share code, notes, and snippets.

@laszlomiklosik
laszlomiklosik / gist:2229643
Created March 28, 2012 19:18
Enable Windows style RDP server in Ubuntu
Why would you need this?
Because NxServer or VNC needs a special client installed in order to connect.
If your destination Ubuntu machine has multiple displays installed, you will eventually go crazy configuring it to be correctly seen from a Windows machine with a single display. It will show you 2 desktops on a single monitor...
Enabling Windows style RDP server in Ubuntu in easy.
Steps:
1. sudo apt-get install xrdp
2. cd ~
3. echo "gnome-session --session=gnome-classic" > .xsession
@ansemjo
ansemjo / gitlab-backup-to-minio.md
Last active March 5, 2024 23:30
upload gitlab omnibus backups to minio

setup Minio somewhere

Minio is an object storage server compatible with the S3 protocol. Head to https://minio.io/ to learn more.

Hint: You might want to use MINIO_WORM=on to pretect against accidental or malicious deletion of your backups.

seperate users with iam policies

Since RELEASE.2018-10-18T00-28-58Z minio supports seperate users with attached IAM policies. Instead of (or additionally to) using MINIO_WORM=on you could create a new user and attach a writeonly policy:

@superseb
superseb / README.md
Last active December 21, 2023 12:32
Retrieve kubeconfig from RKE or Rancher 2 custom cluster controlplane node for RKE v0.1.x and Rancher v2.0.x and Rancher v2.1.x
@superseb
superseb / README.md
Last active July 14, 2024 09:47
Retrieve kubeconfig from RKE or Rancher 2 custom cluster controlplane node for RKE v0.2.x+ and Rancher v2.2.x+

Retrieve kubeconfig from RKE v0.2.x or Rancher v2.2.x custom cluster controlplane node

For RKE v0.1.x and Rancher v2.0.x/v2.1.x, see https://gist.github.com/superseb/3d8de6092ebc4b1581185197583f472a

This needs to be run on a node with the controlplane role, as it rewrites the server endpoint to https://127.0.0.1:6443, you can of course manually change this if necessary.

Applicable for:

  • RKE v0.2.x
  • Rancher v2.2.x
@mattmattox
mattmattox / rke_recovery.sh
Last active May 28, 2024 22:09
Recovering cluster.yml and cluster.rkestate from kubeconfig
#!/bin/bash
echo "Building cluster_recovery.yml..."
echo "Working on Nodes..."
echo 'nodes:' > cluster_recovery.yml
kubectl --kubeconfig kube_config_cluster.yml -n kube-system get configmap full-cluster-state -o json | jq -r .data.\"full-cluster-state\" | jq -r .desiredState.rkeConfig.nodes | yq r - | sed 's/^/ /' | \
sed -e 's/internalAddress/internal_address/g' | \
sed -e 's/hostnameOverride/hostname_override/g' | \
sed -e 's/sshKeyPath/ssh_key_path/g' >> cluster_recovery.yml
echo "" >> cluster_recovery.yml
@GusAntoniassi
GusAntoniassi / README.md
Last active July 17, 2024 10:15
Configure autocompletion to kubectl with zsh

kubectl with ZSH (oh-my-zsh)

How to configure

Use the following commands to add the kubectl autocomplete to zsh:

mkdir -p ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/
kubectl completion zsh > ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/kubectl-autocomplete.plugin.zsh
@juancols
juancols / stm32-on-macos-m1.md
Last active May 14, 2024 22:10
STM32 toolchain setup on macOS M1

STM32 toolchain setup on macOS M1

Note: these steps were tested on a MacBook Air M1 2020, 8 GB RAM and macOS Ventura 13.0.1

STM32CubeProgrammer

1. Download

You can get the latest version of the STM32CubePrg-Mac package at STm dev-tools website. The version I used in this guide was the 2.12.0. image

2. Installation