Skip to content

Instantly share code, notes, and snippets.

View circa10a's full-sized avatar

Caleb Lemoine circa10a

View GitHub Profile
@circa10a
circa10a / awk.txt
Last active December 18, 2017 18:57
Awk usage
awk '/role/{gsub("<br>",""); print$3}'
grep sed, print column
@circa10a
circa10a / backup_sh_files.sh
Created December 17, 2017 23:00
find command to backup all files of a given file type
#!/bin/bash
find . -name '*.sh' -maxdepth 1 -type f -exec cp {} ./backups/ \;
@circa10a
circa10a / find_suid.sh
Created December 17, 2017 03:09
find binaries with SUID perms set for potential privilege escalation
find / -user root -perm -4000 -print 2>/dev/null
@circa10a
circa10a / create_fs.sh
Last active October 25, 2018 22:24
Create XFS (pv, vg, lv, mount)
#!/usr/bin/env bash
#choose device
pvcreate /dev/sdb
#choose vg name or number (vg01)
vgcreate vg01 /dev/sdb
#volume group show
vgs
@circa10a
circa10a / test.service
Last active March 10, 2022 15:48
A Simple Systemd Service
#/etc/systemd/system/test.service
[Unit]
Description=Test Systemd Service
[Service]
ExecStartPre=/usr/bin/echo -e "\033[0;33m Pre start \033[0m"
ExecStart=/usr/bin/sleep 10
ExecStartPost=/usr/bin/echo -e "\033[0;33m Post start \033[0m"