If a job is running a system groovy script, it cannot be simply "aborted"
You need to go to $jenkins_url/script and run the contents of the attched script, replacing the original job_line content with the path (from URL) of your job
| """ | |
| A Python decorator is a special function that can be added above a | |
| callable definition (function, class, anything that implements the | |
| `__call__()` method) | |
| When a decorated function is called, it is in fact the decorator | |
| itself that is called, and the wrapped callable is then normally | |
| called by the implementing handler of the decorator. | |
| A Python decorator is comprised of 3 parts: | 
The Love2D wiki is a great starting resource. Mostly I do small-time game development for fun, on long flights or train journeys, or out in remote places. Frankly, it's the only time when I am guaranteed time to not be disturbed for sufficiently long periods.
And so, I need the main wiki in local, offline, usable format.
This script is a considereate slurper which shouldn't DoS the server in the slightest.
As a network behaviour demonstration, I did a repeated clone-out of a Git repository, writing its timestamp data with date '+%F %T' in columns one and two (start and end times) of a CSV
This Python script processes that CSV to produce a plot of the durations:
datetimematplotlib.pyplot| """ Rename files | |
| rename-tracks.py TRACKFILE [apply] | |
| TRACKFILE is a basic text file, each line containing a track name. | |
| This script naively looks for the track name in each file name. | |
| If found, the old file name and new file name are printed. | |
| If a title matches multiple files, an error is raised. | 
| import sys | |
| from collections import namedtuple | |
| # A friendlier named object for working with each output line | |
| Analysis = namedtuple("Analysis", [ | |
| "NLOC", # Count of number of active LOC (excl whitespace) | |
| "CCN", # Cyclomatic Complexity Number | |
| "token", # token count: how many syntactic tokens ("if", "[", "5", etc) are used in the functions | |
| "PARAM", # number of parameters to the function | 
I was curious to know what level of precision I could get when using time.sleep(x),
like, if it made any sense to try and sleep for say 0.0132 seconds.
It turns out, it does. On a Windows machine with a 1.6GHz processor, I get a sample rate such:
$ python3 time_sampling.py 6
Average step over 1000000 (100.0%) iterations: 2.77e-07
Quick one-off script to convert a yaml file to native python.
python3 convert-yaml-to-python.py YAMLFILE > my_data.pyA little naive, but a quick tool otherwise.
| import yaml | |
| import os | |
| class RecursiveYamlLoad(Exception): | |
| pass | |
| def mingw_path(path): | |
| #TODO not yet finished | |
| """ Running Python in MinGW (incl Git Bash) causes abspath() to mangle the path |