5
Aug 14 '18 edited Aug 14 '18
while($true) {
$i++
Invoke-command -computername 'Human Drone' - Scriptblock{
Start-Job -name 'Boring Office Job' -Scriptblock{
get-task | where-object ($_.name -like 'act-busy') | set-task
D:\PayTaxes.ps1
}
Start-Job -name 'Relax for a few hours before falling asleep' -Scriptblock{
Smoke-Weed
Watch-Porn
Contemplate-life
}
Start-Job -name 'Sleep' -scriptblock{
Start-sleep -seconds 18000
}
}
Get-Job | Wait-Job
Get-Job | Receive-Job
Invoke-death
D:\PayTaxes.ps1
}
2
8
u/KyleKowalski Aug 13 '18
I've found that while learning new concepts and exploring new problems I tend to sleep/dream about code more. After the concept is understood or the problem is (somewhat) sorted out they tend to go away... for me, anyway. Then, of course, you have the 3am bug fix wake-ups :)
7
u/Le_Vagabond Aug 13 '18 edited Aug 13 '18
currently writing scriptS to deal with XFA PDFs in a ChromeOS environment, so you're not alone.
the good thing is... I now have something that works despite being ugly and having exotic requirements.
3
u/korewarp Aug 13 '18
exotic requirements?
5
u/Le_Vagabond Aug 13 '18 edited Aug 13 '18
part of the script lives on a windows workstation that has to stay unlocked, because Acrobat Reader will not print through a task scheduled command line in a non-interactive or locked session (or at least I haven't found a way to do that).
I have a workstation-turned-server running some file sync services (across Drive, Samba and FTP), a windows VM for a bank tool with USB token, and some backups... so I just made it headless by removing screen, keyboard and mouse, and stuck it on a shelf where it stays unlocked.
it's a solution, but an ugly one. I could have used another VM but I don't have anything available for that atm...
2
u/korewarp Aug 13 '18
And i thougt OUR internal tools were funky. :V
4
u/Le_Vagabond Aug 13 '18
I do what I can with what little budget I have in the constraints I'm given ¯_(ツ)_/¯
2
u/jantari Aug 13 '18
I was gonna suggest a VM with sleep and lock disabled, and firwall completely blocking everything except SMBv3 and PSRemoting from your one specific machine running the script until I saw your lsat comment.
How come you don't have "anything available for a VM" though? Are you really running your hosts at 100% capacity?
2
u/Le_Vagabond Aug 13 '18
we don't have hosts, we're paying for VMs in a nearby datacenter and on GCP, with a resounding "no" every time I ask for more Dickens style. I have two old Dell blades with 8 Xeon cores each in the network room that my boss won't let me repurpose because she doesn't want to deal with hardware anymore :(
and my little thinkcentre server is already straining with one VirtualBox VM.
2
u/Gr8NonSequitur Aug 13 '18
and firewall completely blocking everything except SMBv3
Good Call. Super Mario Bros 3 really was the best, and sometimes when you end up working super late you need a break.
2
u/da_chicken Aug 13 '18
because Acrobat Reader will not print through a task scheduled command line in a non-interactive or locked session (or at least I haven't found a way to do that).
As far as I'm aware, this is because it's a license violation. You used to need Acrobat Distiller Server to print remotely. You'd have to ask Adobe what their solution for this situation is now (Adobe LiveCycle appears to be it), but the license for Adobe Reader almost certainly still says that you can't use the PDF printer over a network.
Not that I care what you do, but thought you should know.
3
u/Le_Vagabond Aug 13 '18
Good news, everything that happens to Reader and what I'm asking it to do is 100% local.
And were it not for their proprietary xfa bullshit I wouldn't even have to bother with this. Their crap cannot even be viewed on chromeos!
4
4
4
3
2
17
u/GreatMoloko Aug 13 '18
I only write scripts during the week, but I may or may not occasionally find myself laying in bed Saturday morning and have commands pop into my head.