Skip to content

Instantly share code, notes, and snippets.

View lackdaz's full-sized avatar

Seth Loh lackdaz

View GitHub Profile
@lackdaz
lackdaz / list_aliases.txt
Last active October 5, 2018 19:01
an alias to parse your .aliases file (or .bashrc, .profile) for aliases and their documentation
alias alias-ls='cat ~/.aliases | grep -i "^alias" | grep -v "#{3}" | awk -F"[ =]" '\''{print $2 "\t" substr($0, index($0, "#") + 1)}'\''' # List Aliases
@lackdaz
lackdaz / alias_header.txt
Last active April 8, 2020 15:48
Edit/reload/list aliases conveniently
alias alias-ls='cat ~/.aliases | grep -i "^alias" | grep -v "#{3}" | awk -F"[ =]" '\''{print $2 "\t" substr($0, index($0, "#") + 1)}'\''' # List Aliases
alias alias-edit='vi ~/.aliases' # Edit aliases
alias alias-reload='source ~/.aliases' # Reload aliases after editing
@lackdaz
lackdaz / install-node-yarn-arm.sh
Last active January 9, 2022 13:44
Installs node and yarn on an arm64 (armv8) OS (Jetson Nano)
#!/bin/bash
set -e
## Check for versions compiled with ARM at http://nodejs.org/dist/
## Inspired by http://oskarhane.com/raspberry-pi-install-node-js-and-npm/
## Fill in the Node Version here:
##########################################################################
NODE_VERSION="v12.16.1"
##########################################################################
@lackdaz
lackdaz / better-git.sh
Last active December 9, 2025 09:53
An even better git lg
git config --global alias.tree "log --graph --all --pretty=format:'%C(magenta)%h%C(auto)%d %s %C(green)(%cr) %C(bold blue)%an%C(white)/%C(cyan)%cn'"
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@lackdaz
lackdaz / arm-node-yarn-install.sh
Created April 20, 2020 18:51
Example of remote curl bash script
curl -s https://gist.githubusercontent.com/lackdaz/15f929aeb0fee44369af1d96635769b8/raw/a23a0c604f1236cb1ae709da9930dc0922b6cdb0/install-node-yarn-arm.sh | bash /dev/stdin param1 param2
@lackdaz
lackdaz / monitor.sh
Created May 28, 2020 16:51
credit to @aneisch for developing this script to monitor SSH connections on an ubuntu device
#!/bin/bash
authorized_keys="/home/seth/.ssh/authorized_keys"
ssh_login_file="/var/log/auth.log"
ports=$(netstat -tn -o state established | grep -F ":22" | awk '{ print $5 }' | sed -e 's/.*://')
echo "Active logins:"
# Iterate through established peer ports connected to :22
@lackdaz
lackdaz / delete-known-host.sh
Last active June 11, 2020 15:10
deletes a known_hosts entry with pattern matching port 3095
sed '/3095/d' ~/.ssh/known_hosts > ~/.ssh/known_hosts
@lackdaz
lackdaz / fix-jetson-io
Created June 12, 2020 16:59
run to fix the jetson-io bug
sudo find /opt/nvidia/jetson-io/ -mindepth 1 -maxdepth 1 -type d -exec touch {}/__init__.py \;
@lackdaz
lackdaz / tick-tock.txt
Last active June 18, 2020 14:25
Yet another spinner code: tick tock reboot
#!/bin/bash
# Copyright (c) 2020, lackdaz
# All rights reserved.
### Contributions
# Written by Seth Loh Wei Chen github.com/lackdaz
# Contribution by John Rehwinkel gitlab.com/bodger
# Share with me the modifications in the comments below!!
###
@lackdaz
lackdaz / x86_deepstream_install.md
Last active September 8, 2020 17:07
Installation steps for Deepstream 5.0 for x86_64

remove previous gst installations:

$ sudo rm -rf /usr/local/deepstream /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnv* /usr/bin/deepstream* /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libnvdsgst*
/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream*
/opt/nvidia/deepstream/deepstream*
$ sudo rm -rf /usr/lib/x86_64-linux-gnu/libv41/plugins/libcuvidv4l2_plugin.so

install dependencies