automated scripts

Creating gifs from Google Earth historical imagery on GNU/Linux with Bash

First, I downloaded Google Earth for Linux and installed it on my Chromebook (which is running a chroot with crouton). I then proceeded to find deforested zones in Brazil, which was not difficult. I used the history tool to go back in time.

Google Earth contains decent images from Landsat/Copernicus that goes back to 1984. This allows one to see troubling forest destruction in South America, the damages of tar sands extraction in Alberta, and many other things I did not have the time to look at yet.

I figured out it would be too long to do all the clicking and screenshots-taking by hand, so I wrote a dirty bash script to do that for me. This script uses xdotool to place the mouse and perform clicks. I hardcoded the “next year” button’s position into the script, so if you try it, you may have to change the position to match the button’s position on your screen (#cleancode). The script uses import, an ImageMagick utility which is able to take cropped screenshots from a window and save them.

Once all the pictures are taken, I call convert to create a gif. I tweaked the settings to make the gif small enough for publishing on the internet without slowing everyone’s tumblr. Normally, I try to keep my GLSL gifs’ size under 100K, but since the environment is important, I allowed myself to keep some image quality here and go a bit above 200K.

# Note: I have to go to year 1984 before the script starts
# Sleep to let user move to other terminal tab
# and monitor memory with top ;)
sleep 3
echo "starting"

# For every year:
for i in `seq 1984 2016`; do
    # Print current year
    echo $i
    # Take screenshot
    import -window "Google Earth" -crop 500x400+500+120 $i.png
    # Go to next year
    xdotool mousemove 512 155 click 1
    # Leave some time for the image to load
    sleep 4

echo "Creating anim.gif"

convert *.png +repage -fuzz 20% -layers Optimize -colors 6 +dither anim.gif

Now that I have this script, I can animate whatever land that humans have destroyed since 1984, how fun! I had to reboot my Chromebook a couple of times during the development process because Google Earth was a bit exhausting for the small computer.

Fallout 4 - Why Only 4 Hats Take Ballistic Weave

I hypothesized that the 4 hats that take a weave were an accident on Bethesda’s part, and decided to make a mod to remove the option because I’m weird like that.  This is what I found in the creation kit:

 All four hats that take a weave are part of a group of clothes that begin with “ClothesResident”.

I think someone at Bethesda just added the weave to everything with the ClothesResident name, possibly as part of an automated script to save time.

THAT’S why a Battered Fedora is fine, but a Worn Fedora is not. None of them were supposed to have them, but the Battered Fedora is technically “ClothesResident3Hat”, so it gets a weave option.

This mad conspiracy theory is supported by none of the hats in ANY subsequent DLC being able to take a weave. I think the only reason they never fixed this is because they knew people would be furious to lose their Ballistic Weave hats.

os module:

Introduction :

os module in python will allow you to do all types of operating system based functionalities like creating a folder, deleting and stuffs like that. we can also access terminal level commands with os module.

why we need to do operating system based functionality in our python code?

Consider this scenario where we are going to write an automation script which will take backup and store it in a directory (which should be in the name of current date).normally we use “mkdir” in linux to create a folder via terminal now by using os module’s function we can make our python code to do that.

“Iridescent Lines”
I managed to catch some cloud iridescence at the beginning of this timelapse, which made some interesting colours in the clouds.
This is 659 photos merged into one image using the lighten layer-blending mode in photoshop, automated with this script,
I also faded in the first and last 19 photos using 5% increments of the layer opacity.

mesmerizedish  asked:

What really happens during MMO server maintenance?

Mainly we just reset all of the server processes. Server processes are the things that handle tasks and behavior like chat, login, world areas, combat, spawning, guild banks, mail, and the like. Resetting the processes clears out any fragmentation that may have occurred in the server’s memory, and it clears out any zombie processes that died during the week and needed to be restarted. Our automated scripts then process most of the week’s data (e.g. parsing and generating reports from the telemetry captured). Logs of what happened that week are flushed to disk. Data and databases are backed up. Then we restart the game processes, re-initializing timers for quests, rare spawns, weekly events, raid bosses, and so on.

During some (but not all) maintenance sessions, we will apply non-emergency patches to the server in order to update it with new code. Usually this entails bug fixes, optimizations, and support for new or upcoming features. It isn’t uncommon for us to update the live servers with bits and pieces of expansion code and systems before launch and simply lock it off until the client update goes live. Sometimes we also use maintenance to swap out or upgrade hardware. Sometimes we use the time to run scripts to do a variety of tasks, like clean up old accounts or handle server merges. Sometimes we will migrate data from one machine to another, or we’ll replace/upgrade old hardware with new machines. Given how much data MMOGs generate, we tend to run through a lot of hard drives.

Maintenance is really pretty boring. Most of it is automated and handled by tasks scheduled on the servers themselves. There’s also usually 1-2 live ops and/or server team engineers rotating to oversee it each week to make sure nothing really catastrophic happens while it goes on. Overall, though, that’s about it.

Got a burning question you want answered?

anonymous asked:

can u show us a page of your code. like u dont have to translate it i just wanna see what it looks like

THIS FEELS LIKE A TRAP but okay, here are some files i might keep open if i were paranoid about someone looking over my shoulder and i wanted to alt+tab into something that would confuse and disorient them into fleeing

A Scary HTML File aka my 106 homework to make an ecard generator

A Scary MySQL File aka my 211 homework to manipulate databases in the most bullshit roundabout ways possible

A Scary Excel File suitable for intimidating anyone who is easily intimidated by corporate taxation

and to combine the two, A Scary Excel Program aka i wrote a script to automate calculating the taxable gain realized on a not-like-kind exchange because i was too lazy to memorize the rules

the visual basic editor hides the Not Intimidating button i made to run another script for calculating the amount of a sole shareholder dividend and the capital gains tax


“Evergreen Giant”
Although it has nothing on the size of the redwoods on the west coast (which are also considered evergreen trees) this tree is quite big for the area, especially considering that it’s in the open, without protection from the strong winds we get from living close to Lake Ontario.
I’m not sure what kind of tree it is. Likely some kind of pine or fir, but that’s about as far as my tree knowledge goes.
I made this image by stacking 379 photos using the lighten layer-blending mode in photoshop, automated with this script, I also faded in the first and last 19 photos (38 in total) using 5% increments of the layer opacity to taper the beginning and ends of the star trails.

“Pick Up Sticks”
Does anyone remember that game? The criss-crossing of the clouds made me think of it. It happened because there were multiple layers of clouds, and the clouds at higher altitudes were moving in a different direction that the ones beneath them. I love it when that happens, because the timelapse video looks weird and wonderful, and the time stacks often do too.
This is 368 photos merged into one image using the lighten layer blending mode in photoshop, automated with this script, I also stacked the first 151 photos using the “long streaks” preset, so the first chunk of the timelapse would slowly fade in and not was out the best part, closer to the end of the timelapse.

“Twenty Turbines Timestack”
Using the lighten layer-blending mode just made the the blades of the windmills disappear, so this is 346 photos merged into one using the darken layer-blending mode in photoshop, automated with the script from

“Late Night Lights”
Star trails, car trails and train trails oh my!
I made this image by stacking 278 photos, the first and last 19 photos were faded in/out with 5% increments of the layer opacity. As usual, the process was automated with this script,

“Warm Colours on a Cold Canvas”
Another sunset timestack shot from my backyard.
I’ve been getting less and less excited about shooting this scene, because I’ve done it so many times now, but it is beautiful, and now that the house is for sale, I know one day I’ll miss it.
I’ve been thinking about putting a timelapse video together of all the timelapses I’ve shot from my backyard fr a while now, but I think I’ll wait until I move because I’m sure I’ll be doing more timelapses here, since it’s so beautiful and convenient.
I made this image by stacking 260 photos, using the lighten layer-blending mode in photoshop, automated with this script, I also faded in the first 19 photo of the timelapse using 5% increments of the layer opacity.

“Fire Power”
Since I like the digitally mirrored version a lot more than the original time stack, I decided not to upload the time stack itself. (Just take half of this image and you got all the interesting bits of the time stack anyway, as it was simply cropped and mirrored once)
The time stack was made from 569 photos, all merged into one image using the lighten layer-blending mode in photoshop, automated with this script, advanced

150 photos merged into one image using the lighten layer-blending mode in photoshop, along with this script to automate the process.

I’ve done a timelapse here before, and although I prefer the clouds moving this way, I like the other time stack a little better. Possibly because it was later in the year and the grass was green. The grass is looking a little worse for wear in this shot, but that is to be expected after a Canadian winter. Here’s the other time stack…

“Colourful Cloud Collision”
While I was shooting a timelapse of the sunset over the Saint Lawrence River in Notre-Dame-Du-Portage, a few different people told me that it was the second best place in the world for sunsets, next to Hawaii. The sunset didn’t disappoint.
This is 131 photos merged into one image using the lighten layer-blending mode in photoshop, automated with this script

An actual script, on the other hand, is hundreds of ideas bashed around, screwed up, thrown into the bin, fished out of the bin an hour later and folded up into thick wads and put under the leg of a table to stop it wobbling. And then the same again for the next line, and the next, and so on, until you have a whole page or the table finally keels over.
—  Douglas Adams

“Upside Down Tequila Sunrise”
Another lovely sunset shot from my backyard. This is 286 photos merged into one image using the lighten layer-blending mode in photoshop, automated with this script
I also faded in the first 19 photos using 5% increments of the layer opacity.