Skip to content

Instantly share code, notes, and snippets.

@matheusmota
matheusmota / displaymanager.sh
Last active August 1, 2026 23:56
displaymanager - how to select and disable a monitor on macos
#!/usr/bin/env bash
# Traps Ctrl+C to ensure the cursor is restored if the user aborts the script
trap 'tput cnorm; echo -e "\nAborted."; exit 1' INT
# 1. Alias Installation Check
if [[ "$1" != "--skip-install" ]]; then
user_shell=$(basename "$SHELL")
if [[ "$user_shell" == "zsh" ]]; then
config_file="$HOME/.zshrc"
@matheusmota
matheusmota / #wacom-setup-ubuntu.md
Last active June 20, 2022 09:12
My Wacom Intuos Tablet configuration (buttons) for Ubuntu

Installation

sudo apt-get -y install python3-pip
sudo apt-get -y install npm nodejs
sudo npm install -g configurable-http-proxy
sudo pip3 install jupyterhub jupyterlab

Running jupyterhub as a system service

My settings for VSCode.

Path to the settings.json file:

  • Linux: ~/.config/Code/User on Linux
  • Windows 10: C:\Users\username\AppData\Roaming\Code\User
  • Mac OS X: ~/Library/Application Support/Code/User/
A step by step guide
Best setup for fail2ban for hosts with ssh and apache
Jails (monitored services):
- apache - Blocks failed login attempts use the below jail
- apache-overflows - Blocks the remote host that is trying to request suspicious URLs, use the below jail
- apache-noscript - Block the remote host that is trying to search for scripts on the website to execute, use the below jail
- apache-badbots - Block the remote host that is trying to request malicious bot, use below jail
- http-get-dos - Stops DOS attack from remote host
- ssh - Blocks failed login attempts on the SSH server
@matheusmota
matheusmota / .bash_aliases
Last active March 13, 2019 19:10
my bash_aliases
We couldn’t find that file to show.
@matheusmota
matheusmota / Badger for binderhub.md
Last active June 6, 2019 19:51
My own badges for launching repositories at Binder (BinderHub mybinder.org) and Google Colaboratory ( Jupyter / Jupyter Lab / RStudio )

My library of badges for binderhub.