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 / oracle-container-notes.md
Created March 25, 2021 05:38
Running Oracle XE in Docker (local testing)
@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 / 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");

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 / 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??

@nicc777
nicc777 / win10-ssh-copy-id.md
Created July 6, 2021 04:07
Windows 10 equivalent to ssh-copy-id
@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 / gitlab-ce-docker.md
Last active April 26, 2022 08:17
Gitlab Community Edition (Docker) with persistant volumes

Prepare volumes

Also refer to the GitLab Documentation

docker volume create gitlab-data
docker volume create gitlab-logs
docker volume create gitlab-config
@nicc777
nicc777 / dns-test.groovy
Last active April 29, 2022 12:34
Groovy: Script to run from Jenkins Script Console to Quickly Test DNS to GitHub
import java.net.InetAddress;
import java.net.UnknownHostException;
void displayStuff(String whichHost, InetAddress inetAddress) {
print("--------------------------" + "\n");
print("Which Host:" + whichHost + "\n");
print("Canonical Host Name:" + inetAddress.getCanonicalHostName() + "\n");
print("Host Name:" + inetAddress.getHostName() + "\n");
print("Host Address:" + inetAddress.getHostAddress() + "\n");
}