Skip to content

Instantly share code, notes, and snippets.

View nhthai2005's full-sized avatar

Thai H. NGUYEN (Bob) nhthai2005

View GitHub Profile
@nhthai2005
nhthai2005 / Readme.md
Last active August 23, 2021 01:36
How can you completely remove a package?

How can you completely remove a package?

$ sudo apt-get --purge remove octave3.2
$ sudo apt-get purge --auto-remove packagename
$ sudo apt-get autoremove
$ sudo apt --purge autoremove
@nhthai2005
nhthai2005 / .zshrc
Last active August 18, 2021 02:12
.zshrc for linux, windows
# Set up the prompt
autoload -Uz promptinit
promptinit
prompt adam1
setopt histignorealldups sharehistory
# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e
@nhthai2005
nhthai2005 / obs_run.sh
Last active August 14, 2021 11:12
Fix Failed to initialize video. Your GPU may not be supported, or your graphics drivers may need to be updated.
#!/bin/env bash
# Fix Failed to initialize video. Your GPU may not be supported, or your graphics drivers may need to be updated.
# sudo nano /usr/share/applications/com.obsproject.Studio.desktop
# Exec=env LIBGL_ALWAYS_SOFTWARE=1 obs
LIBGL_ALWAYS_SOFTWARE=1 obs
@nhthai2005
nhthai2005 / archlinux
Created August 12, 2021 16:11
Arch Linux Docker
$ docker run -it archlinux:base-devel-20210131.0.14634 bash
[root@ec8c7574f481 /]# pacman -Syy
:: Synchronizing package databases...
core 131.1 KiB 478 KiB/s 00:00 [########] 100%
extra 1649.2 KiB 345 KiB/s 00:05 [########] 100%
community 5.4 MiB 133 KiB/s 00:42 [########] 100%
@nhthai2005
nhthai2005 / .bashrc
Last active November 18, 2021 11:04
Customize PS1
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
@nhthai2005
nhthai2005 / README.md
Created August 10, 2021 05:01 — forked from ptflp/README.md
docker tun device into container

Docker tun device into container install openvpn or other soft, which uses tun devices

@nhthai2005
nhthai2005 / Dockerfile
Last active July 17, 2021 16:16
Exposing a port on a live Docker container
FROM debian:7
RUN apt-get update && \
apt-get -y install socat && \
apt-get clean
USER nobody
CMD socat -dddd TCP-LISTEN:1521,reuseaddr,fork TCP:db:1521
@nhthai2005
nhthai2005 / docker_dind.sh
Last active July 16, 2021 15:28
How to run docker in docker
#!/bin/bash
docker network create some-network
docker volume create some-docker-certs-ca
docker volume create some-docker-certs-client
docker run --privileged --name some-docker -d \
--network some-network --network-alias docker \
-e DOCKER_TLS_CERTDIR=/certs \
-v some-docker-certs-ca:/certs/ca \
-v some-docker-certs-clients:/certs/client \
docker:dind
@nhthai2005
nhthai2005 / vault_install.md
Created July 11, 2021 12:05
Howto install vault in Alpine linux
apk add --no-cache vault libcap
setcap cap_ipc_lock= /usr/sbin/vault
@nhthai2005
nhthai2005 / sublimetext_useful_shortcuts_pc.md
Created July 10, 2021 11:34 — forked from twalker/sublimetext_useful_shortcuts_pc.md
A fork of useful sublime text keyboard shortcuts. Using markdown and making more readable from github.

Sublime Text - Useful Shortcuts (linux)

Sublime Text 3 documentation
= Right Mouse Button
= Left Mouse Button
= Shift
= Delete
= Enter
←↑→↓ = Arrow keys

Editing