Skip to content

Instantly share code, notes, and snippets.

View weikangchia's full-sized avatar

Wei Kang weikangchia

View GitHub Profile
@johnervan
johnervan / Setup Lima with Docker
Last active January 31, 2022 14:53
Docker for Desktop Alternative
# Install with Homebrew. All are open source.
1. brew install lima
2. brew install docker
3. brew install docker-compose
# Setup Lima Docker VM
1. Copy https://github.com/lima-vm/lima/blob/master/examples/docker.yaml to .lima/ (Can choose any directory actually)
2. limactl start ~/.lima/docker.yaml
3. export DOCKER_HOST=unix:///Users/<user_id>/.lima/docker/sock/docker.sock
@SwitHak
SwitHak / 20211210-TLP-WHITE_LOG4J.md
Last active November 24, 2025 11:24
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-20 2238 UTC

Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)

Errors, typos, something to say ?

  • If you want to add a link, comment or send it to me
  • Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak

Other great resources

  • Royce Williams list sorted by vendors responses Royce List
  • Very detailed list NCSC-NL
  • The list maintained by U.S. Cybersecurity and Infrastructure Security Agency: CISA List
@aldobongio
aldobongio / ZuulConfiguration.java
Created August 18, 2021 14:12
Fix for Spring Boot 2.5.x + Zuul - NoSuchMethodError: ErrorController.getErrorPath()
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.cglib.proxy.Callback;
import org.springframework.cglib.proxy.CallbackFilter;
import org.springframework.cglib.proxy.Enhancer;
@Icaruk
Icaruk / multipleGitProfiles.md
Last active November 25, 2025 21:48
How to have multiple profiles on git

Last update: 30-01-2024
Last view: 25-11-2025

Step 1

Go to your work folder, mine is located at: F:/Work/EnterpriseName/

And then create a .gitconfig-work with the following data:

@evan-boissonnot
evan-boissonnot / trainer-calendar.service.spec.ts
Created February 6, 2019 10:22
Unit test of service with http client, with Spy,
/* tslint:disable:no-unused-variable */
let httpClientSpy: { get: jasmine.Spy };
import { TestBed, async, inject } from '@angular/core/testing';
import { TrainerCalendarService } from './trainer-calendar.service';
import { asyncData } from '../helpers/async-observable-helpers';
import { Appointment } from '../models/appointment';
let service: TrainerCalendarService;
describe('Service: TrainerCalendar', () => {
@LayZeeDK
LayZeeDK / angular-cli-node-js-typescript-rxjs-compatiblity-matrix.csv
Last active November 12, 2025 17:59
Angular CLI, Angular, Node.js, TypeScript, and RxJS version compatibility matrix. Officially part of the Angular documentation as of 2023-04-19 https://angular.dev/reference/versions
Angular CLI version Angular version Node.js version TypeScript version RxJS version
~16.0.0 ~16.0.0 ^16.13.0 || ^18.10.0 >=4.9.5 <5.1.0 ^6.5.5 || ^7.4.0
~15.2.0 ~15.2.0 ^14.20.0 || ^16.13.0 || ^18.10.0 >=4.8.4 <5.0.0 ^6.5.5 || ^7.4.0
~15.1.0 ~15.1.0 ^14.20.0 || ^16.13.0 || ^18.10.0 >=4.8.4 <5.0.0 ^6.5.5 || ^7.4.0
~15.0.5 ~15.0.4 ^14.20.0 || ^16.13.0 || ^18.10.0 ~4.8.4 ^6.5.5 || ^7.4.0
~14.3.0 ~14.3.0 ^14.15.0 || ^16.10.0 >=4.6.4 <4.9.0 ^6.5.5 || ^7.4.0
~14.2.0 ~14.2.0 ^14.15.0 || ^16.10.0 >=4.6.4 <4.9.0 ^6.5.5 || ^7.4.0
~14.1.3 ~14.1.3 ^14.15.0 || ^16.10.0 >=4.6.4 <4.8.0 ^6.5.5 || ^7.4.0
~14.0.7 ~14.0.7 ^14.15.0 || ^16.10.0 >=4.6.4 <4.8.0 ^6.5.5 || ^7.4.0
~13.3.0 ~13.3.0 ^12.20.2 || ^14.15.0 || ^16.10.0 >=4.4.4 <4.7.0 ^6.5.5 || ^7.4.0
@lornajane
lornajane / mac.md
Last active October 21, 2025 00:44
Keyboard Only OS X

Keyboard-only Mac Cheatsheet

Hi, I'm Lorna and I don't use a mouse. I have had RSI issues since a bad workstation setup at work in 2006. I've tried a number of extra hardware modifications but what works best for me is to use the keyboard and only the keyboard, so I'm in a good position and never reaching for anything else (except my coffee cup!). I rather unwisely took a job which required me to use a mac (I've been a linux user until now and also had the ability to choose my tools carefully) so here is my cheatsheet of the apps, tricks and keyboard shortcuts I'm using, mostly for my own reference. Since keyboard-only use is also great for productivity, you may also find some of these ideas useful, in which case at least something good has come of this :)

Apps List

There's more detail on a few of these apps but here is a quick overview of the tools I've installed and found helpful

Tool Link Comments
@destan
destan / ParseRSAKeys.java
Last active September 16, 2025 13:23
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
@subfuzion
subfuzion / curl.md
Last active December 5, 2025 19:15
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@cangoal
cangoal / ReservationManager.java
Created February 22, 2016 22:04
Design a reservation system for restaurant
public class ReservationManager {
List<Reservation> reservations;
List<Table> tables;
Set<Customer> customers;
private static ReservationManager instance;
private ReservationManager(){
customers = new HashSet<>();
init();