This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env Python3 | |
# | |
# by Nathan Grigg http://nathangrigg.com | |
# | |
# Rob Granger | |
# change line #1 to use /usr/bin/env Python3 | |
# change Popen to use UTF8 to fix the binary pipe errors. | |
# p = Popen(['/usr/bin/osascript'],stdin=PIPE,stdout=PIPE,encoding='utf-8') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
#use warnings;; | |
use Data::Dump qw(dump); | |
# assuming you have the backup disk connected & root privileges: | |
# get the latest backup to exclude from deletion | |
my $latest = `sudo tmutil latestbackup`; | |
# the 4th line after the last space from `tmutil destinationinfo` output | |
# contains the mount disk name | |
my $destination_info = `sudo tmutil destinationinfo`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
( | |
exec 2>&1 ; | |
time ( | |
set +e | |
echo "Start Time: `date`" | |
/usr/bin/tmutil destinationinfo | |
echo "====================================================" | |
/usr/bin/tmutil destinationinfo | grep "^ID" | cut -d ":" -f2 | while read destination | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# perl script to validate entries in the known_hosts file | |
# by pinging or nslookup. | |
# tried several versions of perl modules for the ping and validate but they were | |
# very unreliable or requred root. | |
# the process uf using the shell seems to work reliably | |
# The output is written to ~/.ssh/new_known_hosts. | |
use strict; | |
use warnings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
sub find_file_in_path { | |
my ($filename) = @_; | |
my $count=0; | |
# Split the PATH environment variable into individual directories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import tempfile | |
import subprocess | |
def edit_path_variable(): | |
# Get the current PATH variable | |
current_path = os.environ.get('PATH', '') | |
paths_list = current_path.split(':') | |
# Display the current paths to the user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Env; | |
use File::Temp qw(tempfile); | |
use File::Basename; | |
sub edit_path_variable { | |
# Get the current PATH variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
my $special_string = "0 bytes/sec"; | |
sub process_text_pipe { | |
my @output; | |
while (<>) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import platform | |
def beephappy(): | |
if platform.system() == "Windows": | |
import winsound | |
winsound.Beep(1998, 500) | |
elif platform.system() == "Darwin": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Notes: | |
# if run from command line the mounts file will be the scriptname + .txt IE: smbMounter.py.txt | |
# if run from Platypus, the script name is always "script.txt" I need to find a way to | |
# make these to the same. | |
# Added mac sounds to the automount function | |
# Added a display box to cache messages created during the auto_mount and display them after | |
# the main grid is displayed. | |
# refactored some code in the mount and automount functions | |
# consolidated the mounting to mount_network_share |