Skip to content

Instantly share code, notes, and snippets.

View abel0b's full-sized avatar
🐉
Compiling

Abel Calluaud abel0b

🐉
Compiling
  • Voie lactée
View GitHub Profile
@abel0b
abel0b / gpu.md
Created January 18, 2020 19:35
Get GPU info on linux

Get OpenGL information for the graphics processor

glxinfo
lscpi
lspci | grep VGA
@abel0b
abel0b / nginx.conf
Created January 16, 2020 17:22
nginx + TLS + docker
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@abel0b
abel0b / encryption.md
Created January 15, 2020 20:05
File encryption on linux

With openssl

Encryption

openssl aes-256-cbc -in attack-plan.txt -out message.enc

Decryption:

openssl aes-256-cbc -d -in message.enc -out plain-text.txt
function makee() {
make $@ 2>&1 | grep -v AVERTISSEMENT
}
@abel0b
abel0b / hardware.md
Last active January 11, 2020 11:01
Check hardware information on linux
cat /proc/cpuinfo

Get number of cores

grep "cpu cores" /proc/cpuinfo

Get cpu topology

@abel0b
abel0b / keybase.md
Created January 8, 2020 19:25
Keybase proof

Keybase proof

I hereby claim:

  • I am abel0b on github.
  • I am abel0b (https://keybase.io/abel0b) on keybase.
  • I have a public key whose fingerprint is 9314 D1AD B327 B2D3 EA8C D38A 3BE0 2A92 7CB2 7ACC

To claim this, I am signing this object:

@abel0b
abel0b / version.sh
Created December 31, 2019 10:32
Git version number
echo $(git rev-list --all --count).$(git rev-parse --short HEAD)$([[ -z "$(git status --porcelain --untracked-files=no)" ]] || echo "+")
@abel0b
abel0b / timer.sh
Created December 29, 2019 14:34
Measure time in millisecond in bash
start=$(date +%s%3N)
sleep 42
end=$(date +%s%3N)
echo done in $((end-start))ms
@abel0b
abel0b / expand_home.sh
Created December 27, 2019 14:59
Expand ~ in path
function expand_home() {
echo "${1/#\~/$HOME}"
}
@abel0b
abel0b / network.sh
Created December 21, 2019 13:04
Networking commands
# Show all hosts in lan
arp -n
# Show hostname
nslookup xxx.xxx.xxx.xxx