Skip to content

Instantly share code, notes, and snippets.

Gustavo Lichti lichti

Block or report user

Report or block lichti

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lichti
lichti / yubikey_unlock_luks.sh
Created Feb 6, 2019
Using yubikey to unlock LUKS partitions
View yubikey_unlock_luks.sh
# Using yubikey to unlock LUKS partitions
# My SDB3 is a partitions with luks, with lvm and ma root fs (/)
# My SDA1 ia my data partition with luks mounted at /data
# I will use yubikey as 2FA to unlock the SDB3 and the SDA1 will be unlocked by a key file
## On SDB3
# Configure the slot two of yubikey to challenge mode
@lichti
lichti / yubikey_pam_auth.sh
Created Feb 6, 2019
Script to configure yubikey as a 2FA in linux login
View yubikey_pam_auth.sh
# Script to configure yubikey as a 2FA in linux login
# Distro Ubuntu 18.04
# Install pam module
sudo apt install libpam-u2f
# Register device for user
pamu2fcfg -u<user> | sudo tee -a /etc/u2f_mappings
# Cofigure yubike as required to login
@lichti
lichti / yubikey_lock_device.sh
Created Feb 6, 2019
This process do lock all sessions when a yubikey is removed from device
View yubikey_lock_device.sh
#!/bin/bash
# This process do lock all sessions when a yubikey is removed from device
# Script to block all open sessions
cat <<-'EOF' | sudo tee /usr/local/bin/gnome_lock_all_sessions
#!/bin/sh
for bus in /run/user/*/bus; do
echo "bus: ${bus}"
uid=$(basename $(dirname $bus))
@lichti
lichti / lichti-swap-usage.sh
Created Nov 3, 2018
who is using your swap?
View lichti-swap-usage.sh
function lichti-swap-usage {
echo "Mem status";
echo "========================================";
free -m
echo "========================================";
SORT="kb"; # {pid|kB|name} as first parameter, [default: kb]
[ "$1" != "" ] && { SORT="$1"; }
[ ! -x `which mktemp` ] && { echo "ERROR: mktemp is not available!"; exit; }
MKTEMP=`which mktemp`;
@lichti
lichti / Bandit.txt
Created Sep 11, 2018
Python Bandit Howto SAST
View Bandit.txt
git clone xxxx
cd xxxx
virtualenv .venv
source .venv/bin/activate
pip install bandit
bandit -r ./src -f html -o output.html -x /tests -v -ll -lll
View sast-ast-tools.txt
[all]
https://github.com/mre/awesome-static-analysis
https://www.owasp.org/index.php/Source_Code_Analysis_Tools
https://samate.nist.gov/index.php/Source_Code_Security_Analyzers.html
[Python]
https://bandit.readthedocs.io/en/latest/
https://github.com/PyCQA/bandit
https://github.com/python-security/pyt
@lichti
lichti / grafana-dash-gen.txt
Created Sep 2, 2018
Grafana dashboard generator
View grafana-dash-gen.txt
https://github.com/uber/grafana-dash-gen
https://github.com/weaveworks/grafanalib
@lichti
lichti / gdrive-linux.txt
Created Sep 1, 2018
Google Drive no linux
View gdrive-linux.txt
*google-drive-ocamlfuse*
https://github.com/astrada/google-drive-ocamlfuse/
https://github.com/astrada/google-drive-ocamlfuse/wiki
https://www.edivaldobrito.com.br/monte-google-drive-no-linux-com-o-google-drive-ocamlfuse/
https://github.com/astrada/google-drive-ocamlfuse/issues/288
https://software.opensuse.org/package/google-drive-ocamlfuse
@lichti
lichti / k8s-pi.md
Created Feb 15, 2018 — forked from alexellis/k8s-pi.md
K8s on Raspbian
View k8s-pi.md

K8s on (vanilla) Raspbian Lite

Yes - you can create a Kubernetes cluster with Raspberry Pis with the default operating system Raspbian. Carry on using all the tools and packages you're used to with the officially-supported OS.

Pre-reqs:

  • You must use an RPi2 or 3 for Kubernetes
  • I'm assuming you're using wired ethernet (Wi-Fi also works)

Master node setup

View install-flameshot.sh
GIT_URL=https://github.com/lupoDharkael/flameshot.git
GIT_BRANCH=v0.5.0
SRC_DIR=$(mktemp -d)
BIN_DIR=/usr/bin
xPWD=$(pwd)
sudo apt update \
&& sudo apt install -y git g++ build-essential qt5-qmake qt5-default qttools5-dev-tools \
You can’t perform that action at this time.