Skip to content

Instantly share code, notes, and snippets.

View nordineb's full-sized avatar

Nordine Ben Bachir nordineb

View GitHub Profile
@nordineb
nordineb / .gitconfig
Last active October 14, 2021 05:33 — forked from tomdwp/.gitconfig
Git diff and merge with p4merge (macOS)
[merge]
keepBackup = false
tool = p4merge
[mergetool "p4merge"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\""
keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
tool = p4merge
@nordineb
nordineb / README.md
Created June 22, 2021 19:08
Sleep transition timed out after 180 seconds while creating hibernation file or while calling rootDomain's clients about upcoming rootDomain's state changes

No solution

sudo pmset -a hibernatemode 0
pmset -g | grep hibernatemode
 hibernatemode        0
@nordineb
nordineb / README.md
Created June 10, 2021 11:10
PGP check encrypted file
gpg --pinentry-mode cancel --list-packets 
```
@nordineb
nordineb / README.md
Created June 10, 2021 10:47
helm2 and helm3 on MacOS
brew install helm@2
brew install helm
cd /usr/local/bin
ln -s /usr/local/opt/helm@2/bin/tiller tiller
ln -s /usr/local/opt/helm@2/bin/helm helm2
ln -s helm helm3
@nordineb
nordineb / readme.MD
Last active July 10, 2022 18:59
Enable EPOCCAM on Teams for Mac and Discord on Mac

Enable EPOCCAM on Teams for Mac

xcode-select --install (only if you haven't already)
sudo codesign --remove-signature "/Applications/Microsoft Teams.app"
sudo codesign --remove-signature "/Applications/Microsoft Teams.app/Contents/Frameworks/Microsoft Teams Helper.app"
sudo codesign --remove-signature "/Applications/Microsoft Teams.app/Contents/Frameworks/Microsoft Teams Helper (GPU).app"
sudo codesign --remove-signature "/Applications/Microsoft Teams.app/Contents/Frameworks/Microsoft Teams Helper (Plugin).app"
sudo codesign --remove-signature "/Applications/Microsoft Teams.app/Contents/Frameworks/Microsoft Teams Helper (Renderer).app"
@nordineb
nordineb / readme.MD
Created March 9, 2021 07:40
multipass + qemu on macos

Multipass can launch and run virtual machines and configure them with cloud-init like a public cloud

brew install multipass libvirt
sudo multipass set local.driver=qemu
@nordineb
nordineb / readme.MD
Created March 9, 2021 07:36
Touch ID for sudo

sudo vi /etc/pam.d/sudo

# sudo: auth account password session
auth       sufficient     pam_tid.so
auth       sufficient     pam_smartcard.so
auth       required       pam_opendirectory.so
account    required       pam_permit.so
password   required       pam_deny.so
session required pam_permit.so
@nordineb
nordineb / script-template.sh
Created December 16, 2020 22:32 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@nordineb
nordineb / readme.MD
Last active December 12, 2020 14:29
Kubectl tips

Can be added to ~/.bashrc

alias k='kubectl'
alias kgp='kubectl get pods'
alias kgpa='kubectl get pods --all-namespaces'
alias kgs='kubectl get svc'
alias kgsa='kubectl get svc --all-namespace
export dry='--dry-run=client -o yaml'
k run nginx --image=nginx --restart=Never $dry