Skip to content

Instantly share code, notes, and snippets.

View Che4ter's full-sized avatar
🚲
Cyber Cyber

Che4ter Che4ter

🚲
Cyber Cyber
View GitHub Profile
name: Custom.SBB.Label.NewClients
description: |
This artifact watches for new client enrolments and automatically
label the client with the hostname.
#server #event #labels
type: SERVER_EVENT
parameters:
sources:
# Keep it clean
> mkdir certificates && cd certificates
# Borrow the default openssl.cnf (location may differ, see note)
> cp /etc/pki/tls/openssl.cnf ./
# Create a private key.
# It's important to have the v3_ca extension and to supply the openssl.cnf file
> openssl req -x509 -days 730 -nodes -newkey rsa:2048 -outform der -keyout server.key -out ca.der -extensions v3_ca -config openssl.cnf
@Che4ter
Che4ter / wireshark filters
Last active April 10, 2018 10:43
wireshark filters
Mac Address/Hostname
nbsn
udp.ort eq 67 or 68
IP
ip.addr
HTTP
http.request
@Che4ter
Che4ter / yubikey neo ccid eject mode setup
Created February 23, 2018 10:23
Set up yubikey neo to ccid eject mode
$ ykneomgr -M 1
# Re-plug the device
$ opensc-tool -s '00 a4 04 00 08 a0 00 00 05 27 20 01 01' \
-s '00 01 11 00 04 81 0f 02 00'
#81 = mode 1 = CCID only (other modes not working togheter with ejcet on my neo)
#02 = timeout
#script to restore
until ykneomgr -M0 2&> /dev/null ; do sleep 0.1 ; done
sudo dnf install davfs2
sudo nano /etc/fstab
insert:
https://elearning.hslu.ch/ilias/webdav.php/hslu/ref_XXXXX/ /PATH/ davfs user,noauto,uid=USERNAME,file_mode=600,dir_mode=700 0 1
ILIAS->Modul->Als Webordner öfnen
->ref_id aus url
mkdir ~/PATHTOFOLDER
@Che4ter
Che4ter / mozoptimize
Created March 17, 2017 08:39
Bulk mozjpeg optimizer on the current directory, works with spaces in filename
#!/bin/bash
# Compresses all .jpg/.jpeg and saves them to opt/
# works with spaces in filenames
# make sure you adjust the path to mozjpeg bin
# uses the mozilla mozjpeg encoder from https://github.com/mozilla/mozjpeg
# based on https://gist.github.com/sauramirez/e0ef5059ab637ed3e2cea090b504f385
# Che4ter - 2017
#Change to mozjpeg path
MOZJPEG='/opt/mozjpeg/bin/'