Skip to content

Instantly share code, notes, and snippets.

@bonsi
bonsi / setup-nut-and-netdata-on-ubuntu.md
Created January 16, 2023 10:47 — forked from Jiab77/setup-nut-and-netdata-on-ubuntu.md
Setup nut and netdata on Ubuntu

Setup nut and netdata on Ubuntu

In this document, I will explain how to setup nut (Network UPS Tools) on Ubuntu 18.04 and 20.04.

It is basically the next chapter of my previous gist, Upgrade nut on Ubuntu 18.04.

I'll only document USB connected UPS and not the other supported connection modes.

Install required dependencies

@bonsi
bonsi / laravel-dusk-docker.md
Last active January 21, 2022 05:34
Get Laravel Dusk running within (lara)dock

NOTES

Working solution for laradock

  • spin up the selenium image (selenium/standalone-chrome) as included with laradock
  • in .env.dusk.local set APP_URL=http://nginx to point to the docker nginx image
  • in tests\DuskTestCase.php replace the line 'http://localhost:9515', DesiredCapabilities::chrome() with 'http://selenium:4444/wd/hub', DesiredCapabilities::chrome()
  • run php artisan dusk
  • ...
  • PROFIT
@bonsi
bonsi / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Created March 12, 2021 14:27 — forked from chriswayg/Ubuntu_Debian_Cloud_images_in_Proxmox.md
Ubuntu and Debian Cloud images in Proxmox
@bonsi
bonsi / MSP_ATTITUDE.ino
Created January 24, 2020 08:26 — forked from Xorgon/MSP_ATTITUDE.ino
An Arduino sketch for getting attitude data from a flight controller using MSP.
#include <SoftwareSerial.h>
#define MSP_ATTITUDE 108
SoftwareSerial mspSerial(11, 12); // RX TX
void setup() {
mspSerial.begin(9600);
Serial.begin(9600);
}
@bonsi
bonsi / install_font_adobe_source_code_pro.sh
Created January 12, 2020 19:39 — forked from enzinier/install_font_adobe_source_code_pro.sh
Install font Adobe Source Code Pro on Ubuntu 16.04 LTS
#!/bin/sh
# Userland mode (~$USER/), (~/).
# ~/.fonts is now deprecated and that
#FONT_HOME=~/.fonts
# ~/.local/share/fonts should be used instead
FONT_HOME=~/.local/share/fonts
echo "installing fonts at $PWD to $FONT_HOME"
mkdir -p "$FONT_HOME/adobe-fonts/source-code-pro"
@bonsi
bonsi / private-fork.md
Created March 23, 2019 07:00 — forked from DavideMontersino/private-fork.md
How to fork to a private gitlab instance

Theory:

your git repository can have more than one remote server; In this case we want to have two:

  1. one for our private repository on gitlab (will be the default one, called origin)
  2. one to be connected to the source repo on github, to be able to pull new changes (will be called upstream)

How to make a private fork from github to gitlab

@bonsi
bonsi / Makefile
Created November 26, 2016 11:28
Makefile - more enjoyable (shorter) docker management commands
# work in progress. inspired by serverforhackers example.
.PHONY: up down log tinker artisan test
# Set dir of Makefile to a variable to use later
MAKEPATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PWD := $(dir $(MAKEPATH))
up:
docker-compose -f laradock/docker-compose.yml up -d
@bonsi
bonsi / fail2ban.md
Created December 3, 2015 20:14 — forked from joecampo/fail2ban.md
fail2ban – stop HTTP(S) route abuse/brute forcing

If you're not familiar: What is fail2ban? fail2ban is an awesome linux service/monitor that scans log files (e.g. auth.log for SSH) for potentially malicious behavior. Once fail2ban is tripped it will ban users for a specified duration by adding rules to Iptables. If you're unfamiliar with fail2ban Chris Fidao has a wonderful (& free!) series about security including setting up fail2ban here.

Recently Laravel released a new feature in 5.1 to throttle authentication attempts by simply adding a trait to your authentication controller. The Laravel throttle trait uses the inputted username, and IP address to throttle attempts. I love seeing this added to a framework out of the box, but what about some of our other apps not built on Laravel? Like a WordPress login? Or even an open API etc.? Ultimately,

@bonsi
bonsi / ssh_config
Created June 18, 2017 12:00
Secure SSH Config
# Recommendations from https://stribika.github.io/2015/01/04/secure-secure-shell.html
# Github needs diffie-hellman-group-exchange-sha1 some of the time but not always.
#Host github.com
# KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
Host *
KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
Host *
c68adc5dc8d9b3a7cc880ddea27b5a23