Skip to content

Instantly share code, notes, and snippets.

View 0xSheepdog's full-sized avatar
💭
fixing your broken shit

Jeff Pettorino 0xSheepdog

💭
fixing your broken shit
  • guardians of the galaxy
  • Mountain Standard Tribe
View GitHub Profile
@AfroThundr3007730
AfroThundr3007730 / add-dod-certs.sh
Last active April 16, 2025 02:30
Import DoD root certificates into linux CA store
#!/bin/bash
# Imports DoD root certificates into Linux CA store
# Version 0.4.1 updated 20241216 by AfroThundr
# SPDX-License-Identifier: GPL-3.0-or-later
# For issues or updated versions of this script, browse to the following URL:
# https://gist.github.com/AfroThundr3007730/ba99753dda66fc4abaf30fb5c0e5d012
# Dependencies: curl gawk openssl unzip wget
@0xSheepdog
0xSheepdog / cidr-cheat-sheet
Created January 17, 2019 22:24
CIDR SUBNET MASK CHEATSHEET & ICMP TYPE CODES
CIDR SUBNET MASK CHEATSHEET & ICMP TYPE CODES
https://oav.net/mirrors/cidr.html
_____________________________________________________________________________
Netmask Netmask (binary) CIDR Notes
_____________________________________________________________________________
255.255.255.255 11111111.11111111.11111111.11111111 /32 Host (single addr)
255.255.255.254 11111111.11111111.11111111.11111110 /31 Unuseable
255.255.255.252 11111111.11111111.11111111.11111100 /30 2 useable
255.255.255.248 11111111.11111111.11111111.11111000 /29 6 useable
@holmberd
holmberd / linux-kill-pts.md
Last active April 11, 2025 23:29
Kill tty/pts sessions in Linux

Kill user tty/pts sessions in Linux

Commands

  • w: show who is logged on and what they are doing
  • who: show who is logged on
  • tty: show current users pseudo terminal
  • ps -ft pts/1: get process id for the pseudo terminal
  • pkill: signal process based on name and other attributes
@magnetikonline
magnetikonline / README.md
Last active March 14, 2025 10:02
Add user ssh-agent as daemon to Ubuntu 18.04LTS server.

Add user ssh-agent as daemon to Ubuntu 18.04LTS server

Create a new systemd user unit, which starts ssh-agent upon login to server. Will remain resident until the final session for the user has logged out.

Steps

  • Create /etc/systemd/user/ssh-agent.service.

  • Run the following commands (under your user account, not root) to install the systemd unit and start:

@aojea
aojea / linked-clone.sh
Last active October 29, 2024 03:11
Script to create a linked clone with libvirt
#!/bin/bash
set -xe
# This script takes as a parameter the name of the VM
# and creates a linked clone
# Ref: https://unix.stackexchange.com/a/33584
# The scripts assumes that it runs from the same folder
# where the vm image is located and it coincides with the
# image name
@ferry77
ferry77 / config
Last active April 24, 2023 15:21
SSH connect to a server via JumpHost
# +-------+ +----------+ +-----------+
# | Laptop| <---> | Jumphost | <--> | FooServer |
# +-------+ +----------+ +-----------+
Host JumpHost
User ec2-user
HostName xx.xx.xx.01
# Add these 2 lines so we don't have to manually run 'ssh-add [key]'
UseKeychain yes
AddKeysToAgent yes
@alces
alces / ansible_local_playbooks.md
Last active February 18, 2025 04:19
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@tuxfight3r
tuxfight3r / ssh-keygen
Last active February 27, 2025 17:34
ssh key / fingerprint tricks
#Read multiple keys from an authorized_keys file and print the finger print
[root@server01 .ssh]# while read line; do ssh-keygen -l -f /dev/stdin <<< $line; done < authorized_keys
2048 87:7a:4d:70:d2:10:a4:4b:b7:e1:2b:7c:77:92:25:04 /dev/stdin (RSA)
2048 7d:f0:89:94:00:09:bc:70:46:59:8d:9a:70:3b:ac:70 /dev/stdin (RSA)
2048 61:63:ee:0d:f6:d2:d8:d6:ae:37:0c:35:ae:da:51:6a /dev/stdin (RSA)
#read a key from authorized key file
[root@server01 .ssh]# ssh-keygen -l -f authorized_keys
2048 87:7a:4d:70:d2:10:a4:4b:b7:e1:2b:7c:77:92:25:04 authorized_keys (RSA)
@afair
afair / tmux.cheat
Last active June 3, 2024 23:26
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New new -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &