Skip to content

Instantly share code, notes, and snippets.

@gmillerd
gmillerd / dumpqbt.pl
Created July 29, 2023 14:29
dumpsqbt in perl
#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
use JSON;
use Data::Dumper;
my $QBT='https://hostname/api/v2/sync/maindata';
@gmillerd
gmillerd / plex_syncme.pl
Created July 26, 2018 08:46
a simple perl script to download all the video files, as stored natively, in a remote playlist named SYNCME on friend's PLEX server
#!/usr/bin/perl
# todo, visit your plex server, get all friends rather than static url/tok
# todo, maybe fixup the name of the file a bit ... it comes like their layout stores it however
use strict;
use warnings;
use Data::Dumper;
use LWP::UserAgent;
use XML::Simple; # apt install libxml-simple-perl
# misc variables used in clustering node names
# ip address as a long
default['iplong'] = "#{node['ipaddress'].split('.').inject(0) {|t,v| (t << 8 ) + v.to_i} }"
# 255.255.255.255 - ipaddr as long
default['255min'] = "#{4294967295 - (node['ipaddress'].split('.').inject(0) {|t,v| (t << 8 ) + v.to_i}) }"
# ip last octet
default['oct4'] = "#{node['ipaddress'].split('.')[-1] }"
# 255 - ip last octet
default['255oct4'] = "#{255 - (node['ipaddress'].split('.')[-1].to_i) }"
@gmillerd
gmillerd / isi_logsetsynth.pl
Last active February 13, 2017 21:47
example of how to gather data from isilon logsets for serial2logset type lookups.
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use XML::Simple;
#
# perl thiscript.pl > tmp.lst
# sort tmp.list master.lst -o master.lst
@gmillerd
gmillerd / fancyfind.sh
Last active February 13, 2017 19:38
fancy find for efficiently traversing very populated directories for recent data.
#!/bin/bash
find /logs/ -maxdepth 1 -mindepth 1 -type d -print0 | \
xargs -0 -r -P4 -n1 -I% find % -maxdepth 1 -mindepth 1 -type d -print0 | \
xargs -0 -r -P4 -n1 -I% find % -maxdepth 1 -mindepth 1 -type f -name "celog_event.xml" -print0
#
@gmillerd
gmillerd / mangos_soap.pl
Last active January 31, 2017 19:42
simple mangos soap client, using perl and soap::lite
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite; # visit http://search.cpan.org/dist/SOAP-Lite/ or apt-get install libsoap-lite-perl
my ($user, $pass) = ('gm', 'secret');
my $host = 'http://127.0.0.1:7878/';
my $cmd = $ARGV[0];

Keybase proof

I hereby claim:

  • I am gmillerd on github.
  • I am gmillerd (https://keybase.io/gmillerd) on keybase.
  • I have a public key whose fingerprint is 0516 5C8E D222 56B2 DD7E F3BE A58F A671 7D9A 907E

To claim this, I am signing this object:

@gmillerd
gmillerd / remoteisi.sh
Created November 17, 2016 19:52
remote isi commands for isilon, for people to lazy to be bothered like me.
#!/bin/bash
# put inside your PATH (eg, ~/bin/) and symlink ~/bin/isi, ~/bin/isi_classic, ~/bin/isi_for_array to it
#set -x
if [[ -z "$ISICLUSTER" ]]; then
export ISICLUSTER=10.1.1.80
fi
#
dpkg --remove-architecture i386
#
aptitude
debfoster
#
screen rsync curl
#
emacs-nox
#
@gmillerd
gmillerd / htmltbl2medwiki.pl
Created May 4, 2016 01:04
a quick script to convert html table snippet to medawiki table format
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use Getopt::Long;
use HTML::TableExtract;
my $file = '';
my @headers = ();