Skip to content

Instantly share code, notes, and snippets.

Avatar

Anh Tu Nguyen xgenvn

View GitHub Profile
@xgenvn
xgenvn / libsecret-git-credentials.sh
Created Oct 15, 2020
Setup libsecret git gnome git credential
View libsecret-git-credentials.sh
sudo apt-get install libsecret-1-0 libsecret-1-dev libglib2.0-dev
sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret
git config --global credential.helper \
/usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
@xgenvn
xgenvn / blackd.service
Created Sep 30, 2020
BlackD Formatter as service
View blackd.service
# /etc/systemd/system/blackd.service
# sudo systemctl start blackd
# sudo systemctl enable blackd
# sudo systemctl status blackd
[Unit]
Description=Black Formatter Service
[Service]
ExecStart=/home/brian/bin/miniconda3/bin/blackd
@xgenvn
xgenvn / Fix sleep awake issues ubuntu 20.04.md
Created Sep 7, 2020
Fix sleep awake issues ubuntu 20.04
View Fix sleep awake issues ubuntu 20.04.md
  • Symstom: NVIDIA 440.100, GPU 1060, Ubuntu 20.04
  • Solution: Edit /etc/default/grub
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" #
GRUB_CMDLINE_LINUX="nouveau.modeset=0 acpi_osi=! acpi_osi=\"Windows 2015\" acpi_backlight=vendor mem_sleep_default=deep acpiphp.   disable=1" GRUB_CMDLINE_LINUX="nouveau.blacklist=1 acpi_rev_override=1 acpi_osi=Linux nouveau.modeset=0 pcie_aspm=force drm.vblankoffdelay=1   scsi_mod.use_blk_mq=1 nouveau.runpm=0 mem_sleep_default=deep"
@xgenvn
xgenvn / Makefile
Created Aug 12, 2020 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
View Makefile
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
View kde-latte-dock-win-key.md
kwriteconfig5 --file ~/.config/kwinrc --group ModifierOnlyShortcuts --key Meta "org.kde.lattedock,/Latte,org.kde.LatteDock,activateLauncherMenu"
qdbus org.kde.KWin /KWin reconfigure

Binding to Expose All or Present Windows

@xgenvn
xgenvn / 99-noto-mono-color-emoji.conf
Created Jul 29, 2020 — forked from IgnoredAmbience/99-noto-mono-color-emoji.conf
Noto Emoji Color fontconfig for Konsole
View 99-noto-mono-color-emoji.conf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Noto Mono + Color Emoji Font Configuration.
Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole.
Usage:
0. Ensure that the Noto fonts are installed on your machine.
1. Install this file to ~/.config/fontconfig/conf.d/99-noto-mono-color-emoji.conf
View ssh-tunneling-guide.md
  1. Run on a terminal
 ssh -D 1337 -q -C -N <user>@ip -v
  1. Firefox:
  • Install FoxyProxy
  • Enter new configuration:
    • type: socks5
    • host: localhost
View Dockerfile
FROM golang:1.9 as ecr-helper
RUN go get -u github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login
WORKDIR /go/src/github.com/awslabs/amazon-ecr-credential-helper
RUN make
FROM busybox as busybox
RUN which busybox
FROM portainer/portainer:latest
ENV HOME=/
View proxy.js
const httpProxy = require('http-proxy')
const proxy = httpProxy.createProxyServer()
const API_URL = process.env.API_URL || 'https://api.mydomain.com'
export default function(req, res, next) {
proxy.web(req, res, {
target: API_URL
})
}
@xgenvn
xgenvn / dgraph.yml
Created Jul 20, 2020
dgraph docker-compose example
View dgraph.yml
version: "3.2"
services:
zero:
image: dgraph/dgraph:latest
volumes:
- ./.data/dgraph:/dgraph
ports:
- 5080:5080
You can’t perform that action at this time.