Skip to content

Instantly share code, notes, and snippets.

View ntrogers's full-sized avatar

ntrogers ntrogers

View GitHub Profile
@ntrogers
ntrogers / sh_recursive_search.sh
Last active September 11, 2017 21:34
[sh - Recursive Search] Recursively move through files #macOS #nix #Bash
for user in "/Users/*"; do
rm -rf "/Users/${user}/Library/Internet Plug-Ins/RingCentralMeetings.plugin"
done
@ntrogers
ntrogers / anydump.sh
Last active October 4, 2019 22:28
[tcpdump - Monitor DHCP Traffic] Monitor DHCP traffic via tcpdump #tcpdump
#!/bin/sh
#===================================================================================
#
# FILE: dump.sh
# USAGE: dump.sh [-i interface] [tcpdump-parameters]
# DESCRIPTION: tcpdump on any interface and add the prefix [Interace:xy] in front of the dump data.
# OPTIONS: same as tcpdump
# REQUIREMENTS: tcpdump, sed, ifconfig, kill, awk, grep, posix regex matching
# BUGS: ---
# FIXED: - In 1.0 The parameter -w would not work without -i parameter as multiple tcpdumps are started.
@ntrogers
ntrogers / get_MAC_of_IP.sh
Last active February 8, 2022 18:03
[sh - Networking Commands] #macOS
# Get MAC address of an IP
nmap -sP -n 192.168.10.1
@ntrogers
ntrogers / Windows_ping_IP_range.cmd
Last active September 11, 2017 21:56
[Ping an IP range] #macOS #nix #Bash #nmap
FOR /L %i in (1,1,255) do @ping -n 1 192.168.1.%i | find "Reply"
@ntrogers
ntrogers / tcpdump_find_IP_of_MAC.sh
Last active September 11, 2017 22:02
[tcpdump commands]
tcpdump ether host aa:bb:cc:11:22:33
@ntrogers
ntrogers / _prune_all_clients.sh
Last active September 28, 2017 00:03
[Bacula] #Bacula #nix
clients=`mysql -e'select Name from Client ORDER BY Name ASC;' bacula | tail -n+2`
for client in `echo $clients`
do
  echo "prune files client=${client} yes" | bconsole
done
@ntrogers
ntrogers / xenserver_commands.sh
Last active November 12, 2018 21:15
[Xenserver commandes] #Xen
# List all VMs with their UUIDs
xe vm-list | awk '{if ( $0 ~ /uuid/) {uuid=$5} if ($0 ~ /name-label/) {$1=$2=$3="";vmname=$0; printf "%s - %s\n", vmname, uuid}}'
# List VMs and VDIs
xe vdi-list
@ntrogers
ntrogers / cmd_ping_IP_range.cmd
Last active October 15, 2017 19:00
[Windows - Command Line Scripts] #Windows #cmd #batch
# Ping an IP range in Windows
FOR /L %i in (1,1,255) do @ping -n 1 192.168.1.%i | find "Reply"
@ntrogers
ntrogers / ARD.sh
Last active September 16, 2024 21:52
[macOS - Useful Commands] #macOS
# kickstart ARD
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -allowAccessFor -allUsers -privs -all
@ntrogers
ntrogers / packages_shell_parameters.sh
Last active September 21, 2017 21:05
[Packages Notes]
$0 = "Script path"
$1 = "Package path"
$2 = "Default location"
$3 = "Target volume"
# Useful info:
# https://derflounder.wordpress.com/2013/11/03/re-packaging-installer-packages-with-packages/