Skip to content

Instantly share code, notes, and snippets.

View seraphyn's full-sized avatar
🏠
Working from home and loving' it

Christian M. Grube seraphyn

🏠
Working from home and loving' it
View GitHub Profile
@seraphyn
seraphyn / UserScript-RedditNoPromoted.js
Created October 4, 2023 15:54 — forked from rohenaz/UserScript-RedditNoPromoted.js
UserScript - Remove Reddit Promoted Post
// ==UserScript==
// @name Reddit Hide Promoted Links (New Design)
// @namespace http://github.com/rohenaz
// @version 0.1
// @description remove promoted posts and advertisements
// @author Satchmo
// @match https://www.reddit.com/*
// @grant none
// ==/UserScript==
@seraphyn
seraphyn / README.md
Created May 22, 2023 14:09 — forked from darrenpmeyer/README.md
Automatically start a single instance of ssh-agent for all terminal sessions to share (bash)

Installation

  1. mkdir -p ~/.config && touch ~/.config/ssh-agent.pid
  2. Paste the contents of ssh-agent-manage.sh into your .bashrc or .bash_profile or similar
  3. killall -9 ssh-agent
  4. Start a new terminal session (note: old sessions will not see ssh-agent, only new ones)

Details

This snippet, when included in .bashrc, will ensure that your session has a working ssh-agent with all your ssh keys loaded into it. It does this without creating separate ssh-agent processes by:

@seraphyn
seraphyn / .htaccess
Created February 8, 2023 07:20 — forked from seoagentur-hamburg/.htaccess
UPDATE 2022/10: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.6 - 10/2022
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@seraphyn
seraphyn / wikijs-keycloak-config-guide.md
Created May 30, 2022 11:48 — forked from Sherex/wikijs-keycloak-config-guide.md
A guide for configuring Keycloak as a authentication provider in WikiJS | https://wiki.js.org | Feature request for adding this to the docs: https://requarks.canny.io/wiki/p/keycloak-auth-docs-proposal-for-a-guide-written
@seraphyn
seraphyn / listusercronjobs.sh
Created September 24, 2021 09:54
Cron aller Benutzer anzeigen
#!/bin/bash
# System-wide crontab file and cron job directory. Change these for your system.
CRONTAB='/etc/crontab'
CRONDIR='/etc/cron.d'
# Single tab character. Annoyingly necessary.
tab=$(echo -en "\t")
# Given a stream of crontab lines, exclude non-cron job lines, replace
@seraphyn
seraphyn / debian_upgradable_ansible
Created September 23, 2021 15:24
Zeige upgradefähige Pakete auf deb-basierte Servern und gebe sie aus
- hosts: servers
tasks:
- name:
apt:
update_cache: yes
- name:
command: apt list --upgradable
register: updates
- debug: var=updates.stdout_lines
@seraphyn
seraphyn / psn-account-id.py
Created April 13, 2021 07:14
Dieses Script ermöglicht es uns die PSN Account ID für die Anmeldung an unsere Konsole in Erfahrung zu bringen. Bei der PSN Account ID handelt es sich nicht um unseren PSN Spielernamen bzw. die Kontendaten für das Playstationnetwork.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import requests
from urllib.parse import urlparse, parse_qs, quote, urljoin
import pprint
import base64
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Use mycli (http://mycli.net/) through ssh
Usage:
$ mycli-ssh yourhost [extra args passed to mycli]
"""
@seraphyn
seraphyn / createuserdb
Created February 27, 2019 07:54
Script for simple creation of an user including database
#!/bin/bash
PASS=`pwgen -s 40 1`
USER=`pwgen -B 10 1`
mysql -uroot <<MYSQL_SCRIPT
CREATE DATABASE $USER;
CREATE USER '$USER'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $USER.* TO '$USER'@'localhost';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
@seraphyn
seraphyn / update_bl.sh
Created October 16, 2018 06:37
filterlists for unbound in opnsene. Services: Unbound DNS: General > Custom options > include:/var/unbound/ad-blacklist.conf
#!/bin/sh
echo "Removing old files..."
[ -f /tmp/hosts.working ] && rm -f /tmp/hosts.working
whitelist='/(api.solvemedia.com)/'
blacklist='https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts http://sysctl.org/cameleon/hosts https://adaway.org/hosts.txt http://hosts-file.net/ad_servers.txt http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&amp;mimetype=plaintext '
for url in $blacklist; do
curl --silent $url >> "/tmp/hosts.working"