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:
The following html code can be used to create an html form that allows uploading multiple files at once:
<form enctype="multipart/form-data" method="POST" action="upload.py">
<table style="width: 100%">
<td>Choose the files to upload:</td>
<td style="text-align: right"><input type="file" multiple="" id="files" name="files"></td>
<td><input id="fileUploadButton" type="submit" value="Upload >>"></td>
You want to create a pdf file (with latex) containing some chinese characters.
You want to write a thunderbird plugin function that runs/calls an external program and returns stdio.
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"
You have a Java FXML file document with a TableView and want to set the columnResizePolicy of this TableView in the fxml document.