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
#!perl -n | |
@z=/[^\n]/sg if/A/; | |
while(1) { | |
$i=index$_,'X'; | |
($p,$t)=$i%2?($i-1,$i+1):($i-2,$i+2); | |
($z[$p],$z[$t])=($z[$t],$z[$p]); | |
s/X/ / | |
} | |
}{print@z | |
__DATA__ |
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
#! perl -ws | |
use strict; | |
our $test ||= ''; | |
print $test; |
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
echo list volume | diskpart |
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
#! perl -w | |
use strict; | |
opendir( DIR, '.' ); | |
my @files = readdir(DIR); | |
closedir DIR; | |
for my $file (@files) { | |
next unless $file =~ m/.*upd$/i; | |
print "$file..."; |
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
# convert julian date number into Gregorian year, month, day parts | |
# not precise too far in the past... 1580-something? | |
sub jdn2greg { | |
my ($jdate) = @_; | |
# make sure formatted like JDN (DDDDDDD[.D*]) | |
return if $jdate !~ m/^\d{7}\.?(\d*)$/; | |
# TODO add support for time here based on fractional day RH side of decimal place | |
# define conversion constants | |
my $y = 4716; |
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
# calculate JDN from YMD | |
sub julianify { | |
my ( $year, $month, $day ) = @_; | |
my $a = int( ( 14 - $month ) / 12 ); | |
my $y = $year + 4800 - $a; | |
my $m = $month + 12 * $a - 3; | |
return | |
$day | |
+ int( ( 153 * $m + 2 ) / 5 ) |
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
SCHTASKS /change /? |
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
function nest_new() { | |
var new_label = GmailApp.getUserLabelByName('New'); | |
var regex_nested = new RegExp(/^[\w\s]+\//); | |
var new_threads = new_label.getThreads(); | |
for (var i = 0; i < new_threads.length; i++) { | |
Logger.log(1); | |
var thread_labels = new_threads[i].getLabels(); | |
var inbox_flag = 0; | |
for (var k = 0; k < thread_labels.length; k++) { | |
if (thread_labels[j].getName() == 'Inbox') { |
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
taskkill /fi "USERNAME eq [domain]/username" /im image_name /f |
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
#! bash | |
rsync -vvan --exclude-from=excludes.txt --ignore-existing source/path target/path | |
# extra verbose and dryrun, -vvn | |
# archive mode, -a | |
# create excludes.txt with skip patterns (and/or inversely, --include-from) | |
# don't overwrite files, --ignore-existing |