Skip to content

Instantly share code, notes, and snippets.

View blurayne's full-sized avatar

Markus Geiger blurayne

View GitHub Profile
@ageis
ageis / systemd_service_hardening.md
Last active May 14, 2025 22:12
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@cskeeters
cskeeters / broadcast_calc.sh
Created December 8, 2016 19:17
Bash script for calculating network and broadcast addresses from ip and netmask or CIDR Notation
#!/bin/bash
# Calculates network and broadcast based on supplied ip address and netmask
# Usage: broadcast_calc.sh 192.168.0.1 255.255.255.0
# Usage: broadcast_calc.sh 192.168.0.1/24
tonum() {
if [[ $1 =~ ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+) ]]; then
@alirezaomidi
alirezaomidi / openconnect.sh
Last active November 28, 2023 12:04
Script to connect and disconnect to/from openconnect without pain
#!/bin/bash
# This script connects the computer to a vpn server using openconnect without pain
prog_name=$(basename $0)
# CHANGE YOUR_VPN_SERVER_DOMAIN to the VPN server you know like example.com
domain=YOUR_VPN_SERVER_DOMAIN
function help {
#
# refind.conf
# Configuration file for the rEFInd boot menu
#
# Timeout in seconds for the main menu screen. Setting the timeout to 0
# disables automatic booting (i.e., no timeout). Setting it to -1 causes
# an immediate boot to the default OS *UNLESS* a keypress is in the buffer
# when rEFInd launches, in which case that keypress is interpreted as a
# shortcut key. If no matching shortcut is found, rEFInd displays its
@jbouse
jbouse / mkhomedir
Last active August 1, 2021 06:21
SSSD AD integration notes
Name: Create home directory during login
Default: yes
Priority: 0
Session-Interactive-Only: yes
Session-Type: Additional
Session-Final:
required pam_mkhomedir.so skel=/etc/skel umask=0022
@dschep
dschep / run.sh
Last active June 28, 2017 07:04
Helium(Carbon) backup script for use ON android device. (NO PC REQUIRED!!)
CLASSPATH=$(pkg=$(pm path com.koushikdutta.backup);echo ${pkg#*:}) app_process /system/bin com.koushikdutta.shellproxy.ShellRunner2
@psi-4ward
psi-4ward / customize-grml.md
Last active December 2, 2023 06:41
Customize Grml LiveCD (remaster)

Customize Grml LiveCD (remaster)

This little bash script helps you to build your own customized grml.iso

Features

  • Include your .ssh/*.pub files into authorized_keys
  • Inject Grml Cheats
  • Auto download all necessary files (the ISO and grml2usb)
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active May 15, 2025 18:44
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@pklaus
pklaus / ddnsserver.py
Last active March 24, 2025 19:48 — forked from andreif/Simple DNS server (UDP and TCP) in Python using dnslib.py
Simple DNS server (UDP and TCP) in Python using dnslib.py
#!/usr/bin/env python
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import argparse
import datetime
import sys
import time
import threading
@nolstedt
nolstedt / gist:9dd7835b874e6d6bc64d
Created June 26, 2014 08:37
rsync copy/move with progress, cp mv progress
alias rsynccopy='rsync --partial --progress --append --rsh=ssh -r -h '
alias rsyncmove='rsync --partial --progress --append --rsh=ssh -r -h --remove-sent-files'