Skip to content

Instantly share code, notes, and snippets.

View vietanhduong's full-sized avatar

Viet-Anh Duong vietanhduong

  • Hanoi, Vietnam
  • 15:14 (UTC +07:00)
View GitHub Profile
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active May 22, 2025 02:45
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

ELF

ELF Header

The first portion of any ELF file is the ELF header. This generally provides offsets to other headers (program headers and section headers) within an ELF.

typedef struct {
  unsigned char e_ident[EI_NIDENT];
 uint16_t e_type;
@gsauthof
gsauthof / filter_env.c
Created February 6, 2020 20:24
Remove environment variable from /proc/$pid/environ under Linux
/* Demonstrate how to remove an environment variable from /proc/$pid/environ,
under Linux.
This pseudo file is accessible by other processes with sufficient privileges
(i.e. same user or root) and exposes the original environment vector.
Removing sensitive variables from it can be part of a defense in depth
strategy (i.e. to make it harder for a casual attacker to access it).
*/
/** {{{ MIT No Attribution
@corvuscrypto
corvuscrypto / main.go
Last active October 17, 2024 15:30
Golang fork + prctl PDEATHSIG control example
package main
import (
"fmt"
"os"
"os/exec"
"os/signal"
"strconv"
"syscall"
)
@cleanunicorn
cleanunicorn / kitty.conf
Created September 27, 2018 11:00
Kitty config
# vim:fileencoding=utf-8:ft=conf
# You can include secondary config files via the "include" directive.
# If you use a relative path for include, it is resolved with respect to the
# location od the current config file. For example:
# include other.conf
# Fonts {{{
# Font family. You can also specify different fonts for the
# bold/italic/bold-italic variants. By default they are derived automatically,
@andre3k1
andre3k1 / install-gnu-sed-on-mac-osx.sh
Created July 26, 2018 18:39
How to install gnu sed on Mac OS X and set it as the default
# Check which version of sed is used when you run the `sed` command
# The version that ships with Mac OS X is
# /usr/bin/sed
which sed
# Install gnu-sed using Homebrew
# The `--with-default-names` option configures `sed` to use gnu-sed
# Without that option, you'll need to type `gsed` to use gnu-sed
brew install --default-names gnu-sed

ELF

ELF Header

The first portion of any ELF file is the ELF header. This generally provides offsets to other headers (program headers and section headers) within an ELF.

typedef struct {
  unsigned char e_ident[EI_NIDENT];
 uint16_t e_type;
@alfredodeza
alfredodeza / iterm-to-hex.py
Created April 23, 2018 12:55
read an itermcolors export file and spit out Vim 8's ansi color var
#!/usr/bin/env python
#
# Convert .itermcolors files to hex colors
import sys
import xml.etree.ElementTree as ET
def rgb_to_hex(rgb):
return '#%02x%02x%02x' % rgb
@legendtkl
legendtkl / proxy.go
Created August 18, 2016 11:49
simple golang tcp proxy (forward request)
package main
import (
"fmt"
"net"
"io"
)
func main() {
//http.HandleFunc("/", handler)
@ericflo
ericflo / proxy.go
Last active April 17, 2024 21:27
Golang TCP Proxy
package proxy
import (
"io"
"net"
"sync"
log "github.com/Sirupsen/logrus"
)