Adding Lots of Storage Pools to Libvirt

I do not enjoy having subdirectories involved for storing files in libvert. The virt-manager interface is just way too brutal about how you manually add storage pools. After much ranting, I wrote a bash script to add these directories for my VM disk images.

  1 #!/bin/bash
  2 
  3 set -e
  4 #set -x
  5 existing_pools=()
  6 export existing_pools
  7 
  8 function add_this_dir() {
  9     local -n xisting_pools="$1"
 10     if [ ! -d "$2" ]; then
 11       echo "add_this_dir: $2 is not a directory"
 12       return
 13     fi
 14     local shortname=`basename $2`
 15     if [[ " ${xisting_pools[@]} " =~ " $2 " ]]; then
 16       echo "$2 already exists"
 17       sudo virsh pool-start "$shortname"  &>/dev/null ||:
 18       sudo virsh pool-autostart "$shortname"  &>/dev/null ||:
 19       return
 20     fi
 21     if [[ " ${xisting_pools[@]} " =~ " $shortname " ]]; then
 22       echo "$shortname already exists"
 23       sudo virsh pool-start "$shortname" &>/dev/null ||:
 24       sudo virsh pool-autostart "$shortname" &>/dev/null  ||:
 25       return
 26     fi
 27     sudo virsh pool-define-as --name $shortname --type dir --target "$2" --source-path "$2"
 28     sleep 1
 29     sudo virsh pool-start "$shortname" &>/dev/null ||:
 30     sudo virsh pool-autostart "$shortname"  &>/dev/null ||:
 31     sleep 1
 32 }
 33 
 34 while read L; do
 35   if [[ x$L = x ]]; then continue; fi
 36   hunks=($L) 
 37   existing_pools+=("${hunks[0]}")
 38 done < <(sudo virsh pool-list --all | grep -v -e Autostart -e '----' )
 39 
 40 echo "You have these existing pools defined: "
 41 echo "%%${existing_pools[@]}%%"
 42 
 43 while read D; do
 44   add_this_dir existing_pools "/tank/VMs/$D"
 45 done < <(ls /tank/VMs) 
 46 while read D; do
 47   add_this_dir existing_pools "/tank/softlib/iso/$D"
 48 done < <(ls /tank/softlib/iso)

 

Dumbassery at Transunion

Stupid QA process at TransUnion creates a blank page at the most emotional time of an interaction: the confirmation page for your credit freeze.

[span id="trace" style="display:none"]
java.lang.NullPointerException
at com.truelink.app.consumerCredit.site.fa.tags.dfpAd.DFPAdTag.doStartTag(DFPAdTag.java:24)
at _jsp._copy._sf._securityFreeze._applyFreezeConfirm_0en__jsp._jspService(copy/sf/securityFreeze/applyFreezeConfirm_en.jsp:130)
at _jsp._copy._sf._securityFreeze._applyFreezeConfirm_0en__jsp._jspService(copy/sf/securityFreeze/applyFreezeConfirm_en.jsp:94)

Groovy on JDK9 #unhappy

Getting compiled with jdk9.

Tried using javapackager. No difference in error.

Java invocation:

.\jre\bin\java.exe -Xmx512m ^
 -DsuppressSwingDropSupport=true -Djava.net.preferIPv4Stack=true ^
 -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true ^
 -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintClassHistogram ^
 "-XX:ErrorFile=%USERPROFILE%\java_err.txt" "-XX:HeapDumpPath=%USERPROFILE%" ^
 --add-modules java.base,java.xml,java.xml.bind,java.desktop,java.compiler -cp lfclient.jar;commons-lang3-3.2.jar;glazedlists_java15-1.9.0.jar;jfreechart-fse-1.0-SNAPSHOT.jar;jmathplot.jar;jmathio.jar;miglayout-4.0-swing.jar;groovy.jar;groovy-swing.jar;.\ ^
 candela.lanforge.lfclient

Am wondering if there is like something similar to the ‘tools.jar’ that I should be preparing. All of the errors below appear to be from things missing in the java environment.

Loading plugins...
java.lang.ExceptionInInitializerError
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
        at candela.lanforge.GroovyScriptFrame.register(GroovyScriptFrame.java:347)
        at candela.lanforge.GroovyScriptFrame.registerBuiltinPlugins(GroovyScriptFrame.java:225)
        at candela.lanforge.LANforgeMgr$1.run(LANforgeMgr.java:1675)
Caused by: groovy.lang.MissingMethodException: No signature of method: static java.util.regex.Pattern.compile() is applicable for argument types: (java.lang.String) values: [--lfver (\d+\.\d+\.
\d+)]
        at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1503)
        at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1489)
        at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:53)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at candela.lanforge.GroovyCheckUpdates.(script14907583229861182367337.groovy:40)
        ... 7 more
1490758323: Free-mem: 146093224 totalMemory: 268435456 maxMemory: 1073741824 mem-space-left: 951399592
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
        at candela.lanforge.GroovyScriptFrame.register(GroovyScriptFrame.java:347)
        at candela.lanforge.GroovyScriptFrame.registerBuiltinPlugins(GroovyScriptFrame.java:225)
        at candela.lanforge.LANforgeMgr$1.run(LANforgeMgr.java:1675)
Caused by: groovy.lang.MissingMethodException: No signature of method: java.lang.String.equalsIgnoreCase() is applicable for argument types: (java.lang.String) values: [gainspeed]
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58)
        at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:49)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at candela.lanforge.GroovyPortMonitor.(script14907583237002070177117.groovy:35)
        ... 7 more

Adopting Complexity 

Becoming a grey beard geek has involved adopting complexity. Some would assume unnecessary complexity… But other recognize ideal underneath the tangle: a challenge to master. 

Setting yourself a regular challenge keeps your hopes set higher than the horizon. Geek on! 

Not My Favorite Xmas Card

special_place_in_hell

I’ve been listening to a lot of WTR and other podcasts that interview people who dwell on the topics of inclusion and empathy in the technical work space. I listen to them because I want other people around me to succeed. I want my sons and daughters to feel welcomed to the sciences or computer programming. I must say that this kind of “humor” comes off as elitist derision. Its very irritating since I’ve got more than 10 years more professional experience than him. Do I need to join his “zfs club”?  My response is clearly a light-hearted defense tactic…I was not interested in getting into an twitter ego battle on Christmas. I strongly feel this is an example of miscommunication that would not be taken well by others. Sorry, Allan, I did not: I actually dwelled on it for a few days.

Bummed about pixels

CSS media querscreen-font-pixies are kinda bummed but I think I see the point. The point being: a pixel is now considered whatever the hell a pixel is, and points, picas and inches are only accurate in print media, not screen media. This is because the computer manufacturers out there are not interested in providing a worthwhile mapping from points to pixes because dots per inch and pixels per dot are actually not related. You can have three dots per pixel now, or three pixels per dot. Whatever the fuggin’ hell that means. So they want all our font sizes specified in pixels.

So don’t let me forget these media queries for common devices. And apparently we can test browsers for CSS capabilities just by loading a web page. And here is a possibly useful template for default smartphone and tablet screen size media queries.