Skip to content

Instantly share code, notes, and snippets.

View lichti's full-sized avatar
👨‍💻
🏊🏻🚴🏻🏃🏻

Gustavo Lichti lichti

👨‍💻
🏊🏻🚴🏻🏃🏻
View GitHub Profile
@lichti
lichti / yubikey_pam_auth.sh
Created February 6, 2019 18:02
Script to configure yubikey as a 2FA in linux login
# 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 February 6, 2019 17:52
This process do lock all sessions when a yubikey is removed from device
#!/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 / install-wildfly.sh
Last active November 23, 2018 20:17
Install Wildfly 10 - Debian, Centos, RHEL
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 10.x
#usage :/bin/bash wildfly-install.sh
#tested-version1 :10.0.0.Final
#tested-distros1 :Ubuntu 15.10; Debian 7,8; CentOS 7; Fedora 22
#tested-version2 :10.1.0.Final
#tested-distros2 :Debian 8, Centos 6
WILDFLY_VERSION=10.1.0.Final
@lichti
lichti / lichti-swap-usage.sh
Created November 3, 2018 20:44
who is using your swap?
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 September 11, 2018 13:51
Python Bandit Howto SAST
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
@lichti
lichti / sast-ast-tools.txt
Created September 11, 2018 04:20
SAST - AST - Tools
[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 September 2, 2018 16:58
Grafana dashboard generator
https://github.com/uber/grafana-dash-gen
https://github.com/weaveworks/grafanalib
@lichti
lichti / gdrive-linux.txt
Created September 1, 2018 16:31
Google Drive no linux
*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
import subprocess
from flask import (Flask, abort, request, jsonify, Response)
from pybitbucket.bitbucket import Bitbucket, Client
from pybitbucket.auth import (
Authenticator,
Anonymous, BasicAuthenticator,
OAuth1Authenticator,
OAuth2Grant, OAuth2Authenticator)
from pybitbucket.repository import (
RepositoryRole, RepositoryType, RepositoryForkPolicy,
@lichti
lichti / k8s-pi.md
Created February 15, 2018 14:34 — forked from alexellis/k8s-pi.md
K8s on Raspbian

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