Skip to content

Instantly share code, notes, and snippets.

@gnzsnz
gnzsnz / keybase.md
Created March 23, 2018 18:07
keybase proof

Keybase proof

I hereby claim:

  • I am gnzsnz on github.
  • I am gnzsnz (https://keybase.io/gnzsnz) on keybase.
  • I have a public key ASBN5_YPczA4_V9gQ00UrbBgwRDbMFFGP40GNawbYooaKQo

To claim this, I am signing this object:

@gnzsnz
gnzsnz / blackscholes.gs
Last active February 21, 2021 09:41
Black-Scholes Equations for Google Sheets
/**
Source: ϴ gang
URL: https://www.reddit.com/r/thetagang/comments/j1az74/blackscholes_equations_for_google_sheets/
Instructions:
Open a new or existing Google Sheets spreadsheet
Navigate to Tools > Script Editor
Paste the code below into the empty "code.gs" file and save it
@gnzsnz
gnzsnz / ubuntu_cleanup.md
Last active August 31, 2022 15:12
Ubunu clean up - keep ubuntu nice and tidy

Ubuntu Clean-up

As times goes by and ubuntu releases arrive i keep updating my good old home server and laptop. This leaves behind removed packages with remaining files.

These are my steps to keep ubuntu nice and tidy. I don't do this often, so i'm writing it here to remember on my next LST upgrade.

deborphan

The first util is deborphan, deborphan finds packages that have no packages depending on them. Which makes them a perfect candidate for removal. As usual, read the deborphan man page before start using it

@gnzsnz
gnzsnz / How to pass arguments to a container.md
Created September 1, 2022 10:20
Short notes on container arguments

How to pass arguments to a container

This short note covers container arguments by going through some use cases. First we create a test container

FROM ubuntu:latest
COPY ./entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/bin/top", "-H"]
@gnzsnz
gnzsnz / rsync_cheat_sheet.md
Last active October 21, 2022 08:54
A quick and dirty cheat sheet for rsync

rsync cheat sheet

rsync -rtva -e ssh --delete Documents/Work user@hostname:~/Documents

  • r recurisve
  • t preserve times
  • v verbose
  • a archive - preserve ownership permisions, timestamp, same as -rlptgoD
  • e ssh - specify the remote shell to use
@gnzsnz
gnzsnz / ssh_config.md
Last active October 2, 2023 12:49
SSH client config
@gnzsnz
gnzsnz / SSHD_config.md
Last active October 1, 2022 16:57
SSHD config
@gnzsnz
gnzsnz / list_linux_users.md
Created September 15, 2022 07:57
List linux users

List linux users

this will list non system users only

getent passwd | awk -F: '$3 >= 1000 && $3 <=60000 { print $1}'
@gnzsnz
gnzsnz / git_aliases.md
Created October 13, 2022 11:42
Git alias

List of git aliases

Simple log

git config --global alias.slog "log --graph --all --topo-order --pretty='format:%h %ai %s%d (%an)'"

List git aliases

@gnzsnz
gnzsnz / SSH_Certificates.md
Last active August 21, 2023 12:36
SSH Certificates

SSH Certificates

Create CA

A certificate authority is a third party trusted by hosts and users to sign each other public certificates. So user would need it's pub key signed by the CA in order to access host. And host would need it's pub certificate signed by the CA for users to trust that it's the host they intend to connect.

Host CA

Generate a host certificate authority