Skip to content

Instantly share code, notes, and snippets.

View NewRedsquare's full-sized avatar
😴
Working from home

NewRedsquare

😴
Working from home
View GitHub Profile
@NewRedsquare
NewRedsquare / acme.sh_non-root.yml
Last active April 28, 2024 22:26
Quick and dirty ansible playbook to deploy rootless acme.sh based on https://gist.github.com/Greelan/28a46a33140b65c9a045573ca460f044
---
- name: Set up ACME wildcard certificate using acme.sh
hosts: cloud
become: yes
vars:
mydomain: ""
dedyn_token: ""
email: ""
tasks:
@NewRedsquare
NewRedsquare / busKill.rules
Created October 6, 2021 13:51
Cinnamon lock screen when Yubikey is removed
ACTION=="remove", ENV{ID_MODEL}=="YubiKey_OTP+FIDO+CCID", RUN+="/bin/su $USER -c 'DISPLAY=:0 /usr/bin/cinnamon-screensaver-command -a'"
@NewRedsquare
NewRedsquare / sshfilter.sh
Created March 24, 2021 20:01 — forked from jokey2k/sshfilter.sh
Tuned version of sshfilter.sh to allow for ipv6 filtering
#!/bin/bash
# based on script from http://www.axllent.org/docs/view/ssh-geoip
# License: WTFPL
# UPPERCASE space-separated country codes to ACCEPT
ALLOW_COUNTRIES="DE EU GB"
LOGDENY_FACILITY="authpriv.notice"
if [ $# -ne 1 ]; then
echo "Usage: `basename $0` <ip>" 1>&2
@NewRedsquare
NewRedsquare / attributes.rb
Created January 9, 2021 19:00 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
||scproxy-prod.adobecc.com^$important
||*.adobesc.com^$important
||cc-collab.adobe.io^$important
||cc-api-cp.adobe.io^$important
||comments.adobe.io^$important
||sharedcloud-production*.s3.amazonaws.com^$important
||acpprodva7apollo.blob.core.windows.net/acp-prod-va7-data*^$important
||cc-api-storage.adobe.io^$important
||assets.adobe.com^$important
||assets2.adobe.com^$important
@NewRedsquare
NewRedsquare / playlist-creator.sh
Last active January 17, 2020 21:58
it's a Proof-of-Concept to automatically create a XSPF playlist from .flac files, it's kinda messy i know ;D
rm -f list.xspf
cd $1 # use the destination path as first parameter and use the web folder destination as second parameter ( /var/Music & Music for example)
cp /usr/local/bin/playlist-template-header ./list.xspf
for f in *.flac; do
metaflac --export-tags-to=tags.tmp --export-picture-to=covers/"$f".png "$f"
cp /usr/local/bin/playlist-template ./list.tmp
title=$(grep -P 'TITLE=' tags.tmp | sed 's/\<TITLE\>//g' | sed 's/=//g')
album=$(grep -P 'ALBUM=' tags.tmp | sed 's/\<ALBUM\>//g' | sed 's/=//g')
albumartist=$(grep -P 'ALBUMARTIST=' tags.tmp | sed 's/\<ALBUMARTIST\>//g' | sed 's/=//g')
tracknumber=$(grep -P 'TRACKNUMBER=' tags.tmp | sed 's/\<TRACKNUMBER\>//g' | sed 's/=//g')