Skip to content

Instantly share code, notes, and snippets.

View igorjs's full-sized avatar
🌏
Away

igor.js igorjs

🌏
Away
View GitHub Profile
@igorjs
igorjs / docker-for-mac.md
Created July 31, 2023 01:08 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@igorjs
igorjs / gpg_git_signing.md
Created May 3, 2023 22:24 — forked from alopresto/gpg_git_signing.md
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@igorjs
igorjs / cli-libs.md
Created April 22, 2023 11:24 — forked from thomd/cli-libs.md
An opinionated list of libraries for creating command line interfaces #list #cli
@igorjs
igorjs / lima-on-m1-mac-installation-guide.md
Created April 17, 2023 05:53 — forked from toricls/lima-on-m1-mac-installation-guide.md
Using Lima to run containers with containerd and nerdctl (without Docker Desktop) on M1 Macs

Lima (Linux virtual machines, on macOS) installation guide for M1 Mac.

Sep. 27th 2021 UPDATED

Now we can install patched version of QEMU via Homebrew (thank you everyone for the info!). Here is the updated instruction with it:

Used M1 Mac mini 2020 with macOS Big Sur Version 11.6.

1. Install QEMU & Lima

@igorjs
igorjs / angularjs-providers-explained.md
Created February 22, 2023 05:56 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@igorjs
igorjs / change-codec.md
Created February 1, 2023 01:47 — forked from dvf/change-codec.md
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@igorjs
igorjs / git-branch-protection.md
Created October 28, 2022 06:26 — forked from edudobay/git-branch-protection.md
Command-line script for protecting/unprotecting branches in a GitHub repository

(To be improved)

Requirements

  • httpie (which provides the http command) — pip install httpie

Setup

  • Save the git-branch-protection.sh as git-branch-protection somewhere in your path (something like ~/bin or ~/.local/bin if you already use it)
  • Generate a GitHub token and save it as ~/.config/github_token.
@igorjs
igorjs / ci-yarn-install.md
Created October 24, 2022 13:45 — forked from belgattitude/ci-yarn-install.md
Composite github action to improve CI time with yarn 3+ / node-modules linker.

Not using yarn ? see the corresponding pnpm action gist

Why

While @setup/node has a built-in cache parameter for popular package managers, it discards the cache on every lock file update. This composite action allows to run install with (almost always) warm cache. Depending on repo usage, that might reduces the monthly ci-time and decrease the carbon emissions. See also actions/setup-node#325.

Bench

Based on the nextjs-monorepo-example. A cold cache install on the ci is more than 2 minutes. With warmed cache: 1 minute. Crafted from benchmarks results in https://gist.github.com/belgattitude/0ecd26155b47e7be1be6163ecfbb0f0b. Depending on repo (renovatebot...), the slight complexity increase in ci setup might worth it.

image: dnxsolutions/musketeers:1.1.1-ecr
services:
- docker:18.03.1-ce-dind # needs to match gitlab runner version
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
AWS_DEFAULT_REGION: ap-southeast-2
AWS_HOSTED_ZONE: dev.cloud.example.com.au