Turn around, every now and then I get a little bit reckless and I dream of something wild Turnaround, every now and then I get a little bit helpless and I'm lying like a child in your arms Turnaround, every now and then I get a little bit angry and I know I've got to get out and cry Turnaround, every now and then I get a little bit terrified but then I see the look in your eyes Turnaround bright eyes, every now and then I fall apart Turnaround bright eyes, every now and then I fall apart
Friday, August 4, 2017
Bonnie Tyler - Total Eclipse of the Heart - lyrics to the second verse
Thursday, May 5, 2016
get vCenter Server or Replication appliance update URL from command line using xmllint
The script requires the update URL, which is easy to get manually from the appliance web interface, but I want to automate the update.
I found that the default update URL is stored in
/opt/vmware/var/lib/vami/update/provider/provider-deploy.xmland the user-entered update URL is stored in
/opt/vmware/var/lib/vami/update/provider/provider-runtime.xml
The appliances come with some command-line tools to parse XML; I'm using xmllint:
echo 'cat //property[@name="repositoryAddress"]/@value' | \ xmllint --shell /opt/vmware/var/lib/vami/update/provider/provider-deploy.xml | \ grep httpsThe output:
value="https://vapp-updates.vmware.com/vai-catalog/valm/vmw/05d561bc-f3c8-4115-bd9d-22baf13f7178/5.8.1.12927.latest"
Thursday, August 27, 2015
Fark Lite tampermonkey script updates
/* Fark Lite Copyright (c) 2005, Rick FletcherReleased under the GPL license http://www.gnu.org/copyleft/gpl.html -------------------------------------------------------------------- This is a Greasemonkey user script. To install, you need Greasemonkey: http://greasemonkey.mozdev.org/ Then restart Firefox and revisit this script. Under Tools, there will be a new menu item to "Install User Script". Accept the default configuration and install. To uninstall, go to Tools/Manage User Scripts, select "Fark Lite", and click Uninstall. -------------------------------------------------------------------- Changelog 0.3 2015-08-27 RCJ update for Fark changes 0.2.2 2005/10/08 bug: no longer hiding the "view voting results" link on the comments page 0.2.1 2005/10/03 bug: updated to work with updated fark.com source 0.2 2005/10/02 new: refactored to use XPath 0.1 2005/07/20 initial release */ // ==UserScript== // @name Fark Lite // @version 0.3 // @namespace http://flet.ch/things/greasemonkey/ // @description Strips fark.com down to just the links. Hides links from categories you don't want to see. // @include http://*.fark.com/* // @include http://fark.com/* // ==/UserScript== (function () { var farklite = { config: { hide_search: true, // remove the google search form at the top of the page hide_side_columns: true, // remove the columns on either side of the page fix_link_target: true, // make links open in the current window strip_passthru_script: true, // make links direct (instead of passing through the go.fark.com script) unwanted_categories: // links that are in these categories will be removed [ "weeners", "satire", "video edit" ], }, //fark_passthru_script_regex: /^http:\/\/\w+\.fark\.com.*l=([^&]+)/i, fark_passthru_script_regex: /^http:\/\/\w+\.fark\.com\/goto\/[0-9]+\/(.*)/i, // link_container_xpath: "//table[@class='nilink']/descendant::tr/td[position() = 1]/a", link_container_xpath: "//a[@class='outbound_link']", addCSS: function( css ) { var head = window.document.getElementsByTagName( "head" )[0]; var style = window.document.createElement( "style" ); style.setAttribute( "type", "text/css" ); style.innerHTML = css; head.appendChild( style ); }, fixLinks: function() { var links = document.evaluate( this.link_container_xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null ); for( var link = null, i = 0; ( link = links.snapshotItem( i ) ); i++ ) { this.config.fix_link_target && link.setAttribute( "target", "" ); this.config.strip_passthru_script && link.setAttribute( "href", unescape( link.getAttribute( "href" ).replace( this.fark_passthru_script_regex, "http://$1" ) ) ); this.config.strip_passthru_script && link.setAttribute( "onmouseover", "" ); this.config.strip_passthru_script && link.setAttribute( "onmouseout", "" ); } }, removeUnwanted: function() { for( var i = 0; i < this.config.unwanted_categories.length; i++ ) { this.config.unwanted_categories[i] = this.config.unwanted_categories[i].toLowerCase().replace( /[^a-z]/, "" ); } var link_category_xpath = "//tr[@class='headlineRow']/descendant::img[translate(@alt,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')='" + this.config.unwanted_categories.join( "' or translate(@alt,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='" ) + "']/parent::*"; var links = document.evaluate( link_category_xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null ); for( var link = null, i = 0; ( link = links.snapshotItem( i ) ); i++ ) { link.parentNode.parentNode.removeChild( link.parentNode ); } }, } farklite.addCSS( "td.howto, form div.howto:first-child, .banhead div, div.footnote { display: none; }" ); farklite.config.hide_search && farklite.addCSS( ".banhead form { display: none; }" ); farklite.config.hide_side_columns && farklite.addCSS( ".newtoolbar, .entirelefttoolbar, .entirerighttoolbar { display: none; }" ); farklite.removeUnwanted(); farklite.fixLinks(); farklite.fixLinks2(); })();
Wednesday, July 15, 2015
Juniper Network Connect and Crashplan use the same network ports
After upgrading CrashPlan on my computer, I found that the service would not start. The tray icon reported "unable to connect to the backup engine".
CrashPlan has a good article on the problem and how to fix it.
A solution not listed -- uninstall Juniper Network Connect! (I didn't need it any more)
Tuesday, July 14, 2015
Open a console to a virtual guest on ESXi or vSphere cluster
Unfortunately, when you setup SSH tunnels for the Windows vSphere client (or even for the vSphere web client), you cannot open console windows to the guests using the normal methods -- they will always fail to connect.
To workaround this, use VMware's "Remote Console" program to connect through the tunnel to the host. Note that the tunnel must go to the host on which the guest is running.
Steps:
- Install VMware Remote Console (in Vmware downloads, vsphere 5.5, "Drivers & Tools" tab)
- find out the VMID of the desired guest using the ESXi cmd line:
vim-cmd vmsvc/getallvms
- open url (assuming host tunnel is 127.0.0.4):
vmrc://root@127.0.0.4/?moid=vmid
where vmid is the id you found; e.g. if the ID is 29:vmrc://root@127.0.0.4/?moid=29
In case it is not obvious, you open the URL from the command prompt:
cd C:\Program Files (x86)\VMware\VMware Remote Console vmrc.exe vmrc://root@127.0.0.4/?moid=29
Saturday, April 25, 2015
Use imagemagick to apply a GIMP gradient colormap (.ggr file)
However, jHelioviewer has a maximum of 1000 frames -- which is about 3 or 4 hours of SDO images (if you use every image taken). Another problem is that is nearly impossible in jHelioviewer to crop the frame in an exact way.
I already knew how to create a movie from a sequence of images using ffmpeg. However, the AIA images you download from SDO JSOC are grayscale; i.e. they don't have the standard SDO color maps.
JHelioviewer applies the SDO color maps using these GIMP gradient files, but I didn't know how to use imagemagick to apply GIMP gradient color maps.
ImageMagick can apply color maps, but they must be in the form of a color lookup table (CLUT) image. But how does one convert a ggr file (a text file!) to a CLUT image? I found a lot of examples on the web on how to convert a CLUT to a GGR, but not the other way around.
According to this jHelioviewer wiki page, you can export the color tables from jHelioviewer using exportColorTables.java somehow, but I didn't feel like figuring out how to compile it -- and also I didn't want to install the JDK.
So I posted a question on the imagemagick forums. You can go read the forum if you like, but I've summarized it here:
- Create a standard hald clut image using the imagemagick program "convert" from the command line:
- convert hald:8 hald.png
- Install GIMP
- Install ggr files in your GIMP configuration directory (on Windows 7 this is %USERPROFILE%\.gimp-2.8\gradients)
- Start GIMP and open hald.png
- Select All
- In the Layers Dialog, select the Gradient Tool, then select the desired gradient
- Apply the gradient by selecting Colors -> Map -> Gradient Map
- Export the file by selecting File -> Export As ... (save it as a PNG or BMP)
- sdo-aia-094-colormap.png
- sdo-aia-131-colormap.png
- sdo-aia-171-colormap.png
- sdo-aia-193-colormap.png
- sdo-aia-211-colormap.png
- sdo-aia-304-colormap.png
- sdo-aia-335-colormap.png
- sdo-aia-1600-colormap.png
- sdo-aia-1700-colormap.png
- sdo-aia-4500-colormap.png
Now, to apply any of the above color maps to a grayscale image, you do, e.g.:
convert gray-image.jp2 sdo-aia-171-colormap.png -hald-clut color-output.jpg
Thursday, April 2, 2015
Symantec 12.1.5 on Linux LiveUpdate failures -- BouncyCastleProvider
We recently started using Symantec 12.1.5 on our Linux systems at work. I installed the client on a test system and immediately had issues with LiveUpdate:
/opt/Symantec/symantec_antivirus/sav liveupdate -u
Picked up JAVA_TOOL_OPTIONS:
Command failed: Problem with LiveUpdate.
Check that java directory is in PATH
Unable to perform update
In liveupdt.log:
Apr 1, 2015 11:32:26 AM There was a failure in reading the settings from the .conf file.
Apr 1, 2015 11:32:26 AM org.bouncycastle.jce.provider.BouncyCastleProvider
Apr 1, 2015 11:32:26 AM JLU received a DeleteSetting command.
Running Liveupdate in debug mode:
java -cp /opt/Symantec/LiveUpdate/jlu.jar com.symantec.liveupdate.LiveUpdate -d
Using character set UTF-8
Command-line Product Selections to update:
(ProdName, Version, Lang, ItemSeqName, SeqNum)
Debug - output[nIdx] = uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_java_t:s0-s0:c0.c1023
Adding JLU to the current command line
JLU Linux, 3.10, English, LiveUpdateSeq, 26
Trying to load jar file from /opt/Symantec/LiveUpdate/bcprov-jdk15on-148.jar
Trying to load jar file from current directory or mentioned in classpath
JLUException [
Nested Exception is:
[ java.lang.ClassNotFoundException ] org.bouncycastle.jce.provider.BouncyCastleProvider
java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
at java.net.URLClassLoader.findClass(Unknown Source)
[...]
I will leave out the frustrating troubleshooting my coworker and I did and give you the reason: Our security configuration specifies that we set the "noexec" mount option on /tmp.
Unfortunately, the Symantec install script requires exec on /tmp to install correctly. Specifically, it creates some temporary scripts in /tmp and runs them to install the BC (bouncycastle) provider. Here's an excerpt from the sepjlu-install.log:
Java LiveUpdate version 3.10 Build 26.
Extracted out unixinstall.sh to /tmp/1427202521861/unixinstall.sh.
Extracted out unixuninstall.sh to /tmp/1427202521861/unixuninstall.sh.
Extracted out liveupdate.conf to /tmp/1427202521861/liveupdate.conf.
Extracted out bcprov-jdk15on-148.jar to /tmp/1427202521861/bcprov-jdk15on-148.jar.
Copied /opt/Symantec/LiveUpdate/jlu.jar to /tmp/1427202521861/jlu-3.10.0.26.jar.
Error running /tmp/1427202521861/unixinstall.sh with reason: java.io.IOException: Cannot run program "/tmp/1427202521861/unixinstall.sh": error=13, Permission denied.
The script is supposed to copy bcprov-jdk15on-148.jar into $SYMROOT/LiveUpdate/, but obviously because "noexec" was set on /tmp, it couldn't run.
So in full, the solution is:
mount -o remount,exec /tmp
$INSTALLER_DIR/install.sh -i
mount -o remount,noexec /tmp