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 / busKill.rules
Created October 6, 2021 13:51
Cinnamon lock screen when Yubikey is removed
View busKill.rules
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
View sshfilter.sh
#!/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
View attributes.rb
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
View adobe-block
||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
View openpgp.md
@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
View playlist-creator.sh
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')