You want to remote control a program but unfortunately this program has only a „klick&gaudy“(*) interface.
(*) Okok – only has a graphical user interface (short GUI).
You may use xdotool in order to script user actions. To install this tool, use:
sudo apt-get install xdotool
Now you can get the position of the mouse pointer with:
or set it via:
xdotool mousemove 400 300 (This means set the mouse to position x=400, y=300; Point of origin is the top left corner of the screen.)
In order to click use:
xdotool click 1
And in order to type a text (e.g. into a control field of the GUI)
xdotool type 'Hello World'
(P.S.: xdotool has much more options … Once this tool got installed type
man xdotool in order to see them all.)
You want to play some sounds in a webbrowser.
// get the AudioContext
window.AudioContext = window.AudioContext || window.webkitAudioContext;
// Initialize audio context
var context = new AudioContext();
// Create an oscillator ... via this oscillator we can then play different sounds
var oscillator = context.createOscillator();
oscillator.frequency.value = 440; // this is an "A"
oscillator.type = "square";
// attach the oscillator to the sound output
oscillator.start(0); // start the oscillator (0=now) ...
oscillator.stop(1); // stop playing this sound after 1 second
You want to display a Graph.
Create a simple text file describing your graph and save it with a
.dot file extension:
node1 -- node2;
node2 -- node3;
node3 -- node4;
node4 -- node1;
Afterwards you can use a program of the graphviz package (
sudo apt-get install graphviz) in order to visualize the graph. This package contains different layouting programs like
fdp (all from the GraphViz project) etc. Simply call one of these programs in order to visualize the graph:
neato -Tsvg yourFile.dot -o outputFile.svg
Output from this command:
Recently I’ve encountered a strange issue with the Broken Link Checker plugin for WordPress:
While all HTTP URLs work just fine, every single HTTPS URL yields an
Unknown error without any log message or explanation. Mehr lesen
While experimenting with Atom I produced a minimal example for making my old Arduino Uno blink its LED periodically.
Although there are plenty of examples out there (some of them even work!) I didn’t want to introduce any dependency to the Arduino libraries. Besides making it harder to build (even if arscons is quite nice) it increases the object size and Arduino only supports a limited range of processors. I need the flexibility to use the code on controlles like the ATTiny45
You want to write a thunderbird plugin function that runs/calls an external program and returns stdio.
When using Ruby 2.0/2.1 with the vpim gem (tested with version 0.695), you get an error message similar to this:
/usr/local/rvm/gems/ruby-2.1.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': /usr/local/rvm/gems/ruby-2.1.0/gems/vpim-0.695/lib/vpim/vcard.rb:678: invalid multibyte escape: /^\xFE\xFF/ (SyntaxError)
In a recent project, I needed to compare STRING records to other PPI databases. However, this is not always as easy as it sounds, because STRING uses KEGG protein identifiers. Fortunately, at the STRING download page, a list of alias mappings is freely downloadable.
There’s still one major problem left, though: I couldn’t find any documentation about the format. It seems to be somewhat easy once you’ve figured out the basics, but I created a reusable Python function that filters a given organism and outputs a STRING ID, UniProt ID CSV:
Recently I needed to filter a STRING protein-view database dump (e.g. protein.links.full.v9.05.txt.gz) by taxonomy ID. The original dataset was way too large (it had more than 670 million records).
In order to filter with constant memory (After all, the full STRING dump is 47GB large), I created this script that allows to filter for binary PPIs both matching the given organism (NCBI taxonomy ID), but also allows to filter for binary PPIs with at least one interacting protein of the given organism. Usually this doesn’t really make a difference for STRING.
There’re many problems nowadays, which could easier be solved through the internet. In this post I descripe how to address these problems by bash alone.
The standard way to connect to a server in the internet, is to embed the connection stream
exec 3<>/dev/tcp/$server/$ircPort || echo "Some text or doing, if connecting failed"