Various snippets of UNIX code that might just be a waste if I keep them to myself. This blog is very much a work in progress and is mainly for myself. Yes, I should probably host code on one of those fancy code hosting web sites and I probably will eventually.
Thursday, August 27, 2015
PowerShell: check to see if Office365 email addresses exist
not a Unix thing, but I use this to see what Office365 email addresses that are valid as they traverse Unix email systems.
Monday, July 6, 2015
X11 Desktop: xdotool: stop Virtual Box VM from activating its screen saver
In the environment where I work, we can not easily change the Windows 8.1 screen saver time-outs due to group policies being in place, however, since the VM is just a window in my Linux desktop, surely I can just simulate the mouse moving to trick the screen saver into not activating.
The idea here is that the Windows VM window is open in my second screen, so moving the mouse into that screen and then moving it back again should stop the screen saver from ever activating. The TARGET X/Y co-ordinates below are the co-ordinates close to the centre of my Windows VM window.
The program that does the actual moving of the mouse pointer is called "xdotool".
Sunday, March 22, 2015
Blender/Python: Plot stars from the HYG data (version 2015-03-05)
slightly updated version from what was previously posted....
the colours for the spectral types are over-saturated but what I do to correct this is put the stars into their own layer in Blender and from there I use the compositing node that reduces the saturation of the colours down to the point where the colours look realistic.
In the compositing screen below I have FOUR layers, FUZZIER and FUZZY are used for blurring the atmosphere, auroras or whatever needs to be blurred. Generally I have two fuzzy layers because I often find that I need to have two independent levels of configurable fuzziness so I just make the two layers for using blurring and glare nodes of some kind so that I don't have to add them later. the PLANET layer is the main layer where the planets and moons and such are placed and the STARS layer is for the background stars
I reduce the saturation of the background stars so as to reduce the "colourness" of the background stars as this script makes the colours rather vibrant. ie. M class stars are bright red (R,G,B = 1,0,0) which isn't a very realistic colour for M class stars. I also add a bit of glare to the background stars such that there aren't solid points of light.
The script below only supports plotting stars on the inside of a sphere, I haven't quite got the relative brightness of stars correct when plotting a star field in which you could move the camera around and see the perspective and relative stellar positions change. eg. If you moved the camera to Alpha Centauri, you would see that the star Sirius is now a part of the Orion constellation and our Sun would become a star in Cassiopeia.
Friday, February 6, 2015
Perl/Math::Bezier ... plotting a bezier curve given some control points
doesn't actually draw anything - just gets the data points necessary to plot one. I did this because I needed a series of 22 numbers starting with 0.0125 that gradually ramped up to 7.4 with step getting larger for each iteration.
Wednesday, February 4, 2015
Saturday, January 31, 2015
Blender/Python: Plot stars from the HYG data
Plots stars on the inside of a sphere using three different types of solids.
Most stars are tetrahedrons, brighter stars are octahedrons and the brightest stars are plotted as dodecahedrons.
ps. feel free to use this however you want but please don't republish the code as I don't want multiple copies all over the internet as I am likely to update this script every now and then... oh and if you make a million dollars out of it somehow, be sure to donate some of that money to the needy. If I ever find a file hosting service that I like, I'll post the completed .blend file there to save the trouble of running it seeing how the whole catalog can take six or more hours to run...
Thursday, January 29, 2015
Blender/Python: creating a tetrahedron
creating a tetrahedron in Python for blender
(Code extracted from larger code available all over the interwebs ie. it is hard to give an actual source)
Subscribe to:
Posts (Atom)