Skip to content

Instantly share code, notes, and snippets.

View arbal's full-sized avatar
👌
new Adaptor(this); // new Adaptor(_humans[].Behavior);

Arbal arbal

👌
new Adaptor(this); // new Adaptor(_humans[].Behavior);
  • Los Angeles, CA
  • 20:52 (UTC -07:00)
View GitHub Profile
@arbal
arbal / setup.sh
Created August 16, 2020 17:22 — forked from MakiseKurisu/setup.sh
Proxmox VE 6 GPU Passthrough
#!/bin/bash
# Reference guides:
# https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF
# https://pve.proxmox.com/wiki/Pci_passthrough
# https://pve.proxmox.com/wiki/Nested_Virtualization
# Remember to turn on SVM in BIOS and disable CSM
# Update packages
@arbal
arbal / make-chr.sh
Created August 20, 2020 19:21 — forked from stroebs/make-chr.sh
Install Mikrotik CHR on a Digital Ocean droplet (Ubuntu 16.04.6 tested working 31/08/2019)
#!/bin/bash
#
# Digital Ocean Ubuntu 16.04.6 Droplet
# Running:
# wget https://gist.githubusercontent.com/stroebs/54fc09734a3911e91eeeb43434f117df/raw/1ede2fb162d404171122db0c84a9eeea468a92cd/make-chr.sh
# chmod +x make-chr.sh
# ./make-chr.sh
#
wget http://download2.mikrotik.com/routeros/6.37/chr-6.37.img.zip -O chr.img.zip && \
gunzip -c chr.img.zip > chr.img && \
@arbal
arbal / fix_catalina_cert.sh
Created August 25, 2020 19:20 — forked from userlerueda/fix_catalina_cert.sh
Script to get certificate from web server and add to apple certificate store
#!/usr/bin/env bash
## To use this script, copy it to your ~/bin directory and then run it by executing:
## fix_catalina_cert.sh 10.201.146.172 443
## You will be asked to authenticate when storing in keychain
echo | openssl s_client -showcerts -servername ${1} -connect ${1}:${2} 2>/dev/null | openssl x509 -inform pem -out /tmp/untrusted.cer
security add-trusted-cert -k ~/Library/Keychains/login.keychain-db /tmp/untrusted.cer
@arbal
arbal / whitelist_ssl_certificates_chrome.sh
Created August 25, 2020 19:21 — forked from wolph/whitelist_ssl_certificates_chrome.sh
Easily whitelisting SSL certificates in Chrome under OS X
#!/usr/bin/env bash -e
HOST=$(echo "$1" | sed -E -e 's/https?:\/\///' -e 's/\/.*//')
if [[ "$HOST" =~ .*\..* ]]; then
echo "Adding certificate for $HOST"
echo -n | openssl s_client -connect $HOST:443 -servername $HOST \
| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' \
| tee "/tmp/$HOST.cert"
sudo security add-trusted-cert -d -r trustRoot \
@arbal
arbal / explain.md
Created August 28, 2020 22:40 — forked from aw/explain.md
[SOLVED] Proxmox VE and cloud-init snippets etc

Proxmox VE 6.x release includes a feature to add custom cloud-init configs. Unfortunately there is poor documentation, so I had to figure this out by adding pieces of information together.

The custom cloud-init files (user-data, meta-data, network-config)

The cloud-init files need to be stored in a snippet. This is not very well documented:

  1. Go to Storage View -> Storage -> Add -> Directory
  2. Give it an ID such as snippets, and specify any path on your host such as /snippets
  3. Under Content choose Snippets and de-select Disk image (optional)
  4. Upload (scp/rsync/whatever) your user-data, meta-data, network-config files to your proxmox server in /snippets/snippets/ (the directory should be there if you followed steps 1-3)
@arbal
arbal / README.md
Created August 31, 2020 02:44 — forked from eunomie/README.md
How to send containers log to ELK using gelf log driver

Send docker logs to ELK through gelf log driver

There's so many way to send logs to an elk... logspout, filebeat, journalbeat, etc.

But docker has a gelf log driver and logstash a gelf input. So here we are.

Here is a docker-compose to test a full elk with a container sending logs via gelf.

@arbal
arbal / README.md
Created August 31, 2020 02:44 — forked from eunomie/README.md
How to send containers log to ELK using gelf log driver

Send docker logs to ELK through gelf log driver

There's so many way to send logs to an elk... logspout, filebeat, journalbeat, etc.

But docker has a gelf log driver and logstash a gelf input. So here we are.

Here is a docker-compose to test a full elk with a container sending logs via gelf.

@arbal
arbal / rmate.sh
Created September 3, 2020 22:17 — forked from 0k4/rmate.sh
Install rmate
#Installeren van rmate
curl -o /usr/local/bin/rmate https://raw.githubusercontent.com/aurora/rmate/master/rmate
#Runnable maken
sudo chmod +x /usr/local/bin/rmate
@arbal
arbal / rmate.sh
Last active September 3, 2020 22:35 — forked from 0k4/rmate.sh
Install rmate
# Check effective user, and if not root/0, ask for password up front to avoid interactive prompt along the way.
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root to download rmate to /usr/local/bin/ and make it executable."
sudo -v
fi
# Silently download rmate (implemented as shell script)
sudo curl -sSo /usr/local/bin/rmate https://raw.githubusercontent.com/aurora/rmate/master/rmate
# Make executable
@arbal
arbal / context-color.sh
Last active September 15, 2020 17:03
context-color.sh
wget -q -O ~/.local/bin/context-color https://raw.githubusercontent.com/ramnes/context-color/master/context-color && chmod a+x ~/.local/bin/context-color
# Test
echo
echo "> context-color -d"
context-color -d
echo
echo "> context-color -pd"
context-color -pd