Skip to content

Instantly share code, notes, and snippets.

View QNimbus's full-sized avatar
🎯
Focusing

Bas QNimbus

🎯
Focusing
  • The Netherlands
View GitHub Profile
@QNimbus
QNimbus / check_drives.sh
Last active February 17, 2020 12:23
Script to check if drives are spun down (idle)
#!/usr/bin/env bash
##
## Title: check_drives.sh
## Description: Script to check if drives are spun down (idle)
## Author: B. van wetten
## Created date: 11-02-2020
## Updated date: 17-02-2020
## Version: 0.1.3
## GitHub Gist: https://gist.github.com/QNimbus/cd4432ed283d1f97d3cf9065923e566b
##
@QNimbus
QNimbus / setfacl.sh
Last active February 17, 2020 16:27
#!/usr/bin/env bash
##
## Title: setfacl.sh
## Description:
## Author: B. van wetten
## Created date: 17-02-2020
## Updated date: 17-02-2020
## Version: 0.1.0
## GitHub Gist: https://gist.github.com/QNimbus/81ee0fba982e68eb5d9df6277df6951e
##
#!/usr/bin/env bash
##
## Title: acl_util.sh
## Description: Shell script to recursively set ACE's on FreeNAS ZFS
## Author: B. van wetten
## Created date: 17-02-2020
## Updated date: 20-02-2020
## Version: 0.4.0
## GitHub Gist: https://gist.github.com/QNimbus/8680cade5ac68e87f6308e4c72463a03
##
@QNimbus
QNimbus / docker-compose-all.sh
Created March 16, 2020 09:51
Shell script to run docker-compose in all subfolders
#!/usr/bin/env bash
##
## Title: docker-compose-all.sh
## Description: Shell script to run docker-compose in all subfolders
## Author: B. van wetten
## Created date: 16-03-2020
## Updated date: 16-03-2020
## Version: 0.1.0
## GitHub Gist: https://gist.github.com/6067fdc65e96b6255e68e87c927c7cc7
##

Source: electron/electron#9920 (comment)

I hope that this comment get noticed, because a lot of people are asking about importing fs or ipcRenderer in your apps. It's a common-need for electron apps but I found not many people have got it right, and are using outdated patterns. tl;dr - there is a security vulnerability if you don't import your node module (ie. fs) or electron module (ie. ipcRenderer) in the correct way. If you are using your app for only yourself you are probably safe, but if you ever want to share or sell your app you should read ahead.

Our goal

Before I go into the solution, it's important to understand why we are doing this in the first place. Electron apps allow us to include node modules in our apps, which gives them amazing power, but security concerns. We want to allow our app to use native-os (ie. node) features, but we don't want them to be abused.

> As brough

#!/usr/bin/env bash
##
## Title: deploy_adguard.sh
## Description: Script to deploy uploaded certificates for use with AdGuard Home DNS Server
## Author: B. van wetten
## Created date: 13-05-2020
## Updated date: 13-05-2020
## Version: 0.1
## GitHub Gist:
##
@QNimbus
QNimbus / settings.json
Last active March 25, 2025 11:55
Windows Terminal Settings #windows
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@QNimbus
QNimbus / create_docker_certs.sh
Last active July 7, 2020 03:32
Short script to generate Docker server and client certificates to enable TLS communication
#!/usr/bin/env bash
##
## Title: create_docker_certs.sh
## Description: Short script to generate Docker server and client certificates to enable TLS communication
## Author: B. van wetten
## Created date: 25-05-2020
## Updated date: 25-05-2020
## Version: 0.0.1
## GitHub Gist: https://gist.github.com/QNimbus/19a53ce305e43b12434ddcac740e7bfe
##
@QNimbus
QNimbus / ensure-ssh-password-not-expired.yml
Last active March 8, 2021 09:14
Ansible playbook to run if provisioning hosts that enforce the user to enter a new password (due to expired password after initial setup/installation e.g. Ubuntu 20.04 LTS Server ARM64 for Raspberry Pi). This play will attempt to login to the hosts and update the password and thereby resetting the password expiry.
---
- hosts: all:!localhost
gather_facts: no
# This play attempts to establish an SSH connection with inventory hosts
# and when it encounters an expired password it will change and reset the password
# so other playbooks and roles can normally execute without failing because of expired password.
# Tested with:
# - Ubuntu
# In addition to the material design icons - Home Assistant has some builtin icons as well
hass:account
hass:alert
hass:alert-circle
hass:altimeter
hass:apple-safari
hass:apps
hass:arrow-bottom-left
hass:arrow-down