Skip to content

Instantly share code, notes, and snippets.

@z448
z448 / remap_CAPS_LOCK_to_CTRL.sh
Created January 19, 2017 16:35
remap CAPS_LOCK to CTRL in debian from command line or put in .bashrc
perl -E 'if(`which setxkbmap`){ `setxkbmap -option \"caps:ctrl_modifier\"`}'
@z448
z448 / Clipboard.pm
Last active February 18, 2017 12:58
Clipboard.pm
package Clipboard;
use Exporter 'import';
our @EXPORT_OK = qw( clip );
our $VERSION = '0.03';
use warnings;
use strict;
sub os {
@z448
z448 / trrr
Created December 10, 2016 15:14
search torrents from CLI
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Data::Dumper;
use HTTP::Tiny;
use JSON::PP;
use Term::ANSIColor;
@z448
z448 / trrr
Created December 8, 2016 22:11
search torrent from CLI, filter results based on seeders
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Data::Dumper;
use HTTP::Tiny;
use JSON::PP;
use Term::ANSIColor;
@z448
z448 / actlsr
Created December 7, 2016 21:56
programmatically create activator listener for command on iOS
#!/usr/local/bin/perl
use 5.010;
use warnings;
use strict;
# create activator listener for command
# usage: actlsr 'ls -la'
# respring device and assign to some gesture
@z448
z448 / pasteboard-ios.pl
Last active December 5, 2016 02:00
read contents of iOS pasteboard
#!/usr/local/bin/perl
use 5.010;
use strict;
use warnings;
use Mac::PropertyList;
my $data;
{
@z448
z448 / get_ios_safari_tabs.pl
Created December 4, 2016 01:06
list opened tabs on iOS Safari and generate simple html file /tmp/tabs.html (fatpacked with Mac::PropertyList)
#!/usr/local/bin/perl
# This chunk of stuff was generated by App::FatPacker. To find the original
# file's code, look for the end of this BEGIN block or the string 'FATPACK'
BEGIN {
my %fatpacked;
$fatpacked{"Perl/Mac/ProperyList/ReadBinary.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'PERL_MAC_PROPERYLIST_READBINARY';
package Mac::PropertyList::ReadBinary;use strict;use warnings;use vars qw($VERSION);use Carp;use Data::Dumper;use Encode qw(decode);use Mac::PropertyList;use Math::BigInt;use MIME::Base64 qw(decode_base64);use POSIX qw(SEEK_END SEEK_SET);use XML::Entities ();$VERSION='1.41';__PACKAGE__->_run(@ARGV)unless caller;sub new {my($class,$source)=@_;my$self=bless {source=>$source },$class;$self->_read;$self}sub _source {$_[0]->{source}}sub _fh {$_[0]->{fh}}sub _trailer {$_[0]->{trailer}}sub _offsets {$_[0]->{offsets}}sub _object_ref_size {$_[0]->_trailer->{ref_size}}sub plist {$_[0]->{parsed}}sub _object_size {$_[0]->_trailer->{object_count}* $_[0]->_trailer->{offset_size}}sub _read {my($sel
@z448
z448 / die-silent.pl
Last active November 22, 2016 23:14
makes perl script die silently instead of printing "Died at file.pl line.."
die bless [], 'Dies';
package Dies;
use overload '""' => 'dies';
sub dies { return '' }
@z448
z448 / safaribook-videos.sh
Created November 20, 2016 19:18
list paths to all video files in iOS SafariQueue app
#!/bin/bash
for i in `find ~/*/Data/A* -name ".com*"`;do if [[ `cat $i|grep iQ` ]]; then find `dirname $i` -name '*.mp4'; fi; done
@z448
z448 / moviebox-connect
Last active December 5, 2016 19:03
iOS client to watch MovieBox content on Linux/Mac without any additional service/receiver
#!/usr/local/bin/perl
use 5.010;
use warnings;
use strict;
use Getopt::Std;
use Filesys::Notify::Simple;
use File::Path;
use JSON::PP;