Skip to content

Instantly share code, notes, and snippets.

View nicc777's full-sized avatar
🏠
Working from home

Nico Coetzee nicc777

🏠
Working from home
  • Utrecht, Netherlands
View GitHub Profile
@nicc777
nicc777 / connect-k8s.md
Last active April 18, 2022 06:41 — forked from Piotr1215/connect-k8s.md
Keep cluster connections separate

How to keep cluster connections cleanly separated

With time the .kube/config file will contain a mix of dev, test and prod cluster references. It is easy to forget switching off from a prod cluster context and make a mistake and run for example kubectl delete ns crossplane-system.

Direnv based setup

Use the following setup to avoid these kinds of errors and keep clusters separate.

Install direnv

@nicc777
nicc777 / win10-ssh-copy-id.md
Created July 6, 2021 04:07
Windows 10 equivalent to ssh-copy-id
@nicc777
nicc777 / vscode-and-lombok.md
Created July 2, 2021 05:15
VSCode and lombok

Ran into a problem in VSCode recetnly with Lombok logging annotation causing a "log cannot be resolved" warning in VSCode.

Also, when running the project, as soon as that particular log.info line is hit, and exception is thrown.

First, I realized I didn't add the lombok plugin - so make sure that is installed.

I also opted to restart the Java language server when VSCode prompted me to do so.

Now, the log.info line was no longer "underlined" in VSCode, but the error still persisted... What was going on??

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@nicc777
nicc777 / code_examples.md
Last active April 28, 2021 06:55
Generating PKCE Code Verifier and Code Challange

Generating PKCE Code Verifier and Code Challange

Python

The following example was taken from openstack-archive/deb-python-oauth2client which was an archived project at the time of writing.

# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@nicc777
nicc777 / post-install-sudo-and-ssh.md
Created April 2, 2021 09:28
Debian from scratch notes

These steps were originally documented by mediatemple.net and I am copying it here for incase that source disappears on me.

STEP 1 - Add the user. In the following example, we will use the user name admin. The command adduser will automatically create the user, initial group, and home directory.

[root@root ~]# adduser admin
[root@root ~]# id admin
uid=10018(admin) gid=10018(admin) groups=10018(admin)
[root@root ~]# ls -lad /home/admin/
drwx------ 2 admin admin 4096 Jun 25 16:01 /home/admin/
@nicc777
nicc777 / oracle-container-notes.md
Created March 25, 2021 05:38
Running Oracle XE in Docker (local testing)
@nicc777
nicc777 / clean-up-boot-partition-ubuntu.md
Created March 4, 2021 08:58 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@nicc777
nicc777 / get_kubectl.sh
Last active May 9, 2022 19:16
Get latest kubectl (Linux)
#!/bin/sh
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
mkdir -p ~/opt/bin
chmod 700 kubectl
mv kubectl ~/opt/bin