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 July 22, 2024 18:44
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 July 21, 2024 23:25
How to have multiple profiles on git

Last update: 30-01-2024
Last view: 30-01-2024

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 July 13, 2024 14:28
Angular CLI, Angular, Node.js, TypeScript, and RxJS version compatibility matrix. Officially part of the Angular documentation as of 2023-04-19 https://angular.io/guide/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
@destan
destan / ParseRSAKeys.java
Last active July 9, 2024 08:22
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 July 18, 2024 17:12
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();
@stevethomas
stevethomas / Myapp.php
Last active September 2, 2020 17:53
Example of how to extend Lumen monolog implementation for New Relic and potentially other handlers
<?php namespace Foo;
// app/Myapp.php
use Monolog\Logger;
use Laravel\Lumen\Application;
use Monolog\Handler\StreamHandler;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\NewRelicHandler;
class Myapp extends Application