Skip to content

Instantly share code, notes, and snippets.

@hardyscc
hardyscc / docker-on-windows.md
Last active November 2, 2023 04:20
Docker on Windows

Docker on Windows

Ubuntu on WSL

First make sure uninstall all of the old Ubuntu installation under App & Features.

Install Windows Subsystem for Linux under App & Features > Optional features > More Windows features, then

wsl --update
@hardyscc
hardyscc / docker-on-mac.md
Created September 18, 2023 03:57
Docker on Mac

Docker on mac

Colima

brew install colima

Add insecure registry

@hardyscc
hardyscc / CipherHelper.java
Created September 15, 2023 06:24
RSA & AES encryption
package com.example.cipher;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.KeyStore;

Self-hosted Sonarqube

Start Docker Instance

docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest

Generate Token

@hardyscc
hardyscc / install-win11-mac-arm.md
Created July 27, 2023 12:02
install windows 11 on mac m1
brew install --cask utm

brew install cabextract wimlib cdrtools aria2
brew tap minacle/chntpw
brew install minacle/chntpw/chntpw

# download windows 11 arm under https://docs.getutm.app/guides/windows/
cd <unziped_folder>
./uup_download_macos.sh
@hardyscc
hardyscc / class-diagram.md
Last active September 30, 2022 03:36
Sample Class Diagram
classDiagram
    class Order {
        + id: Long
        + status: RecordStatus
        + createDate: Date
        + updateDate: Date
        + version: Long
    }
    class Customer {
set nocompatible " be iMproved, required
filetype off " required
" Auto install VimPlug
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
@hardyscc
hardyscc / settings.json
Last active October 13, 2023 07:05
Visual Studio Code Settings
{
"vim.insertModeKeyBindings": [
{
"before": ["j", "k"],
"after": ["<esc>"]
}
],
"vim.startInInsertMode": false,
"files.exclude": {
"**/node_modules": true,
@hardyscc
hardyscc / macos-m1-setup.md
Last active March 15, 2024 01:35
MacOS Setup

install homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

install fish & oh-my-fish

@hardyscc
hardyscc / .tmux.conf
Last active November 18, 2022 15:34
tmux config (need reattach-to-user-namespace for copy & paste on macos) https://tmuxcheatsheet.com/
# enable mouse support
set -g mouse on
# set default shell
set -g default-shell $SHELL
set -g default-command "reattach-to-user-namespace -l ${SHELL}"
# copy and paste
setw -g mode-keys vi
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"