Thursday, November 22, 2018

SQL Developer in Windows and the wrong type of JDK

I don't want yet another JDK installed, also I don't want to use Oracle JDK any more.

I'm slave to a Windows laptop at work, and SQL Developer is a shitshow.

If you enter the wrong JDK, for example OpenJDK's J9 engine, then the piece of crap doesn't work.

There's a SQLDeveloper.conf inside the SQL Developer installation, with a SetJavaHome variable, but no, it's not that one. That'd be TOO easy. Instead, you got to locate which file it had last modified in your user folder, and that'll be in product.conf inside AppData\Roaming\sqldeveloper\{version}.

There, you can point ot to your Favorite JDK...

SetJavaHome C:\Java\OpenJDK8U-jdk_x64_windows_hotspot_8u181b13\jdk8u181-b13

Friday, October 13, 2017

TortoiseGit loses its overlay icons...

Windows suck.

Run Regedit.

Open
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers

Locate Tortoise entries.

Make sure they are at the top of the sort list, if necessary add things like "   1" to the name. F5 to refresh.

Kill all running Explorer processes, rerun a new Explorer process from Task Manager, if necessary. If you are too scared, simply relogin.

What happens is, OneDrive POS interferes with the Tortoise shell icon overlay extension. Mikisoft has become cleverer and does the same kind of trick in the ordering with spaces in the One Drive names. Simply sorting Tortoise names earlier than One Drive icons solves the issue.

Friday, June 03, 2016

Centos 7 Firewall

Sigh... Don't do this at home...

  130  systemctl disable firewalld
  131  systemctl stop firewalld


Tuesday, April 19, 2016

SystemD must die die die - firewallD

Sigh... More here.

firewall-cmd --zone=public --add-icmp-block=echo-reply --permanent
firewall-cmd --reload

Twatters...

Wednesday, December 16, 2015

VirtualBox 5 and still not working

VirtuaBox is gone to version 5 and it's VMDK support is still crap.

It's my mistake, when I was creating the last VM I should have paid attention, I was sleepcreatingVMs and accidentally created the VM with a VMDK disk. WRONNNGGG!!! I needed an other 100G on the VM, and then I started banging my head on my desk again.

Luckily it's just tedious stuff. Our good friend qemu-utils package comes to our rescue again, so it's just a waste of space and time. We got to convert it to a better supported format, and then do the work:

time qemu-img convert -f vmdk -O vdi /fullpathtodisk.vmdk  /fullpathtodisk.vdi
VBoxManage modifymedium disk /fullpathtodisk.vdi --resize 200000 

Note that you got to count the zeros correctly. I typed 20000 and it gave me the unhelpful message:  

0%... 
Progress state: VBOX_E_NOT_SUPPORTED 
VBoxManage: error: Resize medium operation for this format is not implemented yet! 

Well, yes, resizing to smaller sizes is not implemented, but at least be more helpful to a sleep-reprived sysadmin. I was telling it to resize it to 20GB, not 200GB! I scratched my head, googled the error, had some coffee, thought about it for a while, came back, tried the vmdk again, wasted more time, only after that I counted the zeros and cursed at myself loudly.

It would be nice if VirtualBox, after all these years, would support mnemonics like MB, GB... 

Syntax error: --resize: RTGetOpt: Command line option has argument with bad format. 

Darnit!!!

Thursday, July 30, 2015

Embrace the dark side:SELinux

It's annoying.
It works.

If you've got a home directory somewhere else than /home, you might have some funny business. It usually shows up as "/usr/bin/xauth: timeout in locking authority file .Xauthority". Some other security related things stop working too.

This is how all that goes away.

Edit /etc/selinux/semanage.conf
usepassword=True

yum install policycoreutils-python

Clone the context from the standard home directory layout into the new home directory, my users are under /test, i.e., /test/user
semanage fcontext -a -e /home /test
restorecon -R /test


Job done, everything works as intended.

Monday, July 06, 2015

VirtualBox & VERR_NOT_SUPPORTER with VMDK

So, you've got your 2GB-split VMDK and you want to import to your local Virtualbox and it's not working at all:

hakan@hakan-laptop:16:29:36:~/snafu$ VBoxManage showhdinfo demo.vmdk

VBoxManage: error: Could not get the storage format of the medium '/home/hakan/snafu/demo.vmdk' (VERR_NOT_SUPPORTED)
VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component Medium, interface IMedium, callee nsISupports

The version of Virtualbox on Ubuntu 15.04 is not capable of handling this format at the moment. Install Qemu-tools and do the conversion there and stop wasting time:

time qemu-img convert -f vmdk -O vdi demo.vmdk demo.vdi 

Now that's better:

hakan@hakan-laptop:16:37:34:~/snafu$ VBoxManage  showhdinfo demo.vdi
UUID:           24142e20-6273-499a-8bbf-2ae8e27c1cef
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /home/hakan/snafu/demo.vdi
Storage format: VDI
Format variant: dynamic default
Capacity:       20480 MBytes
Size on disk:   19816 MBytes
 


Tuesday, June 09, 2015

LoadRunner, SSH and Remote Agents

I'm running LoadRunner 11.52, RTE with SSH and some remote agent servers to run the load.

And it won't work. The scripts work fine with Vugen but won't work with the Controller.

The reason is this:

[HKEY_CURRENT_USER\Software\Ericom Software\SSH\SshHostKeys]
"rsa2@22:blablabla"="0x25,randomstringforsshkey"

This little piece of crap needs to be in the registry before Ericom - which LoadRunner uses for your SSH connection can connect. It doesn't use Plink, it doesn't use any clever stuff. And if you're using a remote agent with a local system account, whatever I tried - IT DOES NOT WORK!

There are people who claim if you convert this into a HKEY_LOCAL_MACHINE registry entry, it should work, it did not in my case.

In the end I threw up the towel, asked the LR agent to be run as a named user, ran the script ONCE with that user using Vugen - this loaded the key into the registry - and then everything worked from the Controller.

The key is loaded to the registry when you connect to it first time - it pops up a window and asks if you are happy with the fingerprint and want to save it - which you answer by clicking to the "YESSSS" button", unless you're an idiot.

Guess what. LoadRunner is not clever enough to auto-accept this key if you are running this inside the controller. It still prompts for it. You just never see the prompt. It's hanging there, in the ether, waiting for a ghost to find it and try to touch with its cotton rags and see if it can activate the YESSSSSSSS button, forever....

Of course, this is very annoying. For every different server and every different controller you want to use, you have to go through this.

You can have short-cuts. You can do it in one server, then save the registry keys and import into the servers but still, you got to use a named user, just don't bother with the local system account, it's just not worth the stress it's going to cause you.

Probably will apply to 12 as well. 







Wednesday, May 20, 2015

Why you shouldn't hate and disable NetworkManager anymore

James Hogarth has posted a nice mail to the CentOS mailing list on why we shouldn't hate NetworkManager anymore and linked to a very good article on the nmcli. One should bookmark this for future reference.

I used to loathe things that make life easy by trying to "wrap things up" since they make edge cases significantly harder to resolve (and what I mean by edge cases is, servers) but I give up. Life is too short arguing about such things on and on. Eventually things get resolved and people move on I guess and I got to accept NetworkManager instead of fighting against it doing stupid things against my will. Hopefully enough things have been fixed so that it's now sane enough.

I am still against distributions doing "their own things" on such fundamental levels, I accept that I do not matter in the big scheme of things.

IMHO, such basic operations like networking should be standardized across platforms so that we can achieve such operations w/o worrying about such stupid things. I should expect to have certain things always in my service...

Oh well..

Monday, July 07, 2014

LoadRunner 11.52 and weird compilation issues

I've had a perfectly working LoadRunner Java over HTTP script for ages. This stopped working once it was tried on 11.50 and 11.52.

It "compiles" inside the VUGen but fails to run inside VUGen or Controller and produces the following error:

Error: at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at DummyClassLoader.loadClass(DummyClassLoader.java:15)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at ScriptFactory.getScriptObject(ScriptFactory.java:51)
Error: Can't create script object.
Error: Exception was raised when calling abort-cleanup function in extension java_int.dll: System Exceptions: EXCEPTION_ACCESS_VIOLATION
Warning: Extension trans.dll reports error -1 on call to function ExtAbortCleanup
Notify: Found jdk version: 1.6.0.
Notify: classpath=C:\LoadRunnerScripts\FUBAR\;c:\hp\loadrunner\classes\srv;c:\hp\loadrunner\classes;C:\LoadRunnerScripts\WebClasses\fubar\Arialuni.jar;C:\LoadRunnerScripts\WebClasses\fubar\commons-collections-2.1.jar;C:\LoadRunnerScripts\WebClasses\myclient.jar;C:\LoadRunnerScripts\WebClasses\fubar\commons-logging-1.0.2.jar;C:\LoadRunnerScripts\WebClasses\fubar\djt.jar;C:\LoadRunnerScripts\WebClasses\fubar\itext-1.3.1.jar;C:\LoadRunnerScripts\WebClasses\fubar\iTextAsian.jar;C:\LoadRunnerScripts\WebClasses\fubar\jasperreports-3.0.0.jar;C:\LoadRunnerScripts\WebClasses\fubar\jcommon-1.0.0.jar;C:\LoadRunnerScripts\WebClasses\fubar\jfreechart.jar;C:\LoadRunnerScripts\WebClasses\fubar\JScript.jar;C:\LoadRunnerScripts\WebClasses\fubar\poi-3.0.1-FINAL-20070705.jar;;;;c:\hp\loadrunner\lib\xstream-1.3.jar;c:\hp\loadrunner\lib\xpp3-1.1.4c.jar
Notify: Path=C:\Java\jdk1.6.0_75\jre\bin\client;C:\HP\LOADRU~1\bin;C:\HP\LoadRunner\Bin;C:\HP\LoadRunner\Bin\tulip\bin;C:\Java\jdk1.6.0_75\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\HP\LoadRunner\strawberry-perl\perl\bin
Notify: VM Params: .
Error: at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at DummyClassLoader.loadClass(DummyClassLoader.java:15)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at ScriptFactory.getScriptObject(ScriptFactory.java:51)


Error: Can't create script object.
Error: Exception was raised when calling abort-cleanup function in extension java_int.dll: System Exceptions: EXCEPTION_ACCESS_VIOLATION
Warning: Extension trans.dll reports error -1 on call to function ExtAbortCleanup




After raising a call with HP, their suggestion was to move all of the <Vector> and List declarations to global sections, not inside methods.

Like this:
@@ -436,14 +437,27 @@ public class Actions {
         *
         * @return
         * @throws Throwable
-        */
+       */             
+      
+       Vector<Vector<String>> pterryPack = null;
+        Vector<Vector<String>> ankhmorphocContents;
+        //Vector<String> vetrinari_results;
+        Vector<String> fubarDetails;
+        Vector<String> snafuDetails;
+        Vector<String> fibbsDetails;
+        Vector<String> gremlinsDetails;
+        Vector<String> rincewindConfig;
+        Vector<Vector<String>> ConanDetails;
+        Vector<Vector<String>> unseenuniversityDetails;
+        Vector<Vector<String>> discworldData;

OK, in many ways my Vector etc. declarations are a bit funny wrt to the modern Java coding standards but it is the way the legacy code I work with is written so I shouldn't get the flack. The funny thing is it works with Java 1.6 and LoadRunner 11.0 but not 11.52, it -looks- like a classpath issue based on various discussions on the net but it isn't. It looks like the parser LoadRunner uses to create the runtime classes for data injection can't handle such Vector and List declarations (legitimately) peppered around the code and must observe them up front and prepare itself.

Beware.

Tuesday, July 01, 2014

screen stuff

Man screen makes you learn stuff.

hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "

Ubuntu 14.04 and Oracle 12c

I followed this as much as possible although the way he documents it is a bit cumbersome, although it's OK if you want to find out exactly why he's done things.

Additional packages:
apt-get install lib32z1-dev libc6-dev-i386 elfutils libaio1 libaio-dev libstdc++6-4.4-dev numactl pdksh sysstat unixODBC-dev unixODBC build-essential libaio1 gawk ksh libmotif3 alien libtool

Instead of pages long doc, here's a quick diff between the files modified:

diff ins_net_server.mk  $ORACLE_HOME/network/lib/ins_net_server.mk
29c29
<       $(TNSLSNR_LINKLINE)
---
>       $(TNSLSNR_LINKLINE) -lnnz12 -lons


diff ins_rdbms.mk $ORACLE_HOME/rdbms/lib/ins_rdbms.mk
865c865
<       $(ORAPWD_LINKLINE)
---
>       $(ORAPWD_LINKLINE) -lnnz12
883c883
<       $(PLSHPROF_LINKLINE)
---
>       $(PLSHPROF_LINKLINE) -lons
901c901
<       $(RMAN_LINKLINE)
---
>       $(RMAN_LINKLINE) -lons
914c914
<       $(EXTPROC_LINKLINE)
---
>       $(EXTPROC_LINKLINE) -lagtsh
941c941
<       $(HSOTS_LINKLINE)
---
>       $(HSOTS_LINKLINE) -lagtsh
1067c1067
<       $(TG4PWD_LINKLINE)
---
>       $(TG4PWD_LINKLINE) -lnnz12



diff env_rdbms.mk $ORACLE_HOME/rdbms/lib/env_rdbms.mk
2922c2922
< ORACLE_LINKLINE=$(ORACLE_LINKER) $(PL_FLAGS) $(ORAMAI) $(SSORED) $(TTCSOI) \
---
> ORACLE_LINKLINE=$(ORACLE_LINKER) -Wl,--no-as-needed $(PL_FLAGS) $(ORAMAI) $(SSORED) $(TTCSOI) \
2943c2943
< DBV_LINKLINE=$(LINK) $(OPT) $(DBVMAI) $(SSDBED) $(LLIBDBTOOLS) \
---
> DBV_LINKLINE=$(LINK) $(OPT)  -Wl,--no-as-needed $(DBVMAI) $(SSDBED) $(LLIBDBTOOLS) \
2987c2987
<       $(LLIBSLAX) $(LLIBPLSQL) $(LIBPLCN) $(LINKTTLIBS)
---
>       $(LLIBSLAX) $(LLIBPLSQL) $(LIBPLCN) $(LINKTTLIBS) -lons
2994c2994
< EXTPROC_LINKLINE=$(LINK) $(OPT) $(EXTPMAI) $(PROD_EXTPROC_OPT) \
---
> EXTPROC_LINKLINE=$(LINK) $(OPT) -Wl,--no-as-needed $(EXTPMAI) $(PROD_EXTPROC_OPT) \
3001c3001
< HSDEPXA_LINKLINE=$(LINK) $(OPT) $(HSDEPMAI) $(HSALIB_SUBSET1) \
---
> HSDEPXA_LINKLINE=$(LINK) $(OPT)  -Wl,--no-as-needed $(HSDEPMAI) $(HSALIB_SUBSET1) \
3004c3004
< HSOTS_LINKLINE=$(LINK) $(OPT) $(HSOTSMAI) $(HSALIB_SUBSET1) \
---
> HSOTS_LINKLINE=$(LINK) $(OPT) -Wl,--no-as-needed  $(HSOTSMAI) $(HSALIB_SUBSET1) \
3071c3071
< KFED_LINKLINE=$(LINK) $(S0MAIN) $(SSKFEDED) $(SKFEDPT)  \
---
> KFED_LINKLINE=$(LINK) -Wl,--no-as-needed $(S0MAIN) $(SSKFEDED) $(SKFEDPT)  \
3075c3075
< KFOD_LINKLINE=$(LINK) $(S0MAIN) $(SSKFODED) $(SKFODPT) $(KFODOBJ) \
---
> KFOD_LINKLINE=$(LINK) $(S0MAIN) -Wl,--no-as-needed $(SSKFODED) $(SKFODPT) $(KFODOBJ) \
3084c3084
< AMDU_LINKLINE=$(LINK) $(S0MAIN) $(SSKFMUED) $(SKFMUPT) \
---
> AMDU_LINKLINE=$(LINK) $(S0MAIN) -Wl,--no-as-needed $(SSKFMUED) $(SKFMUPT) \


And here's the symlinked files for my case, I didn't have to do all of the symlinks he had done. Weird.
root@fubar:/usr/lib64# ls -la
total 8
drwxr-xr-x  2 root root 4096 Jul  1 16:02 .
drwxr-xr-x 13 root root 4096 Jul  1 15:41 ..
lrwxrwxrwx  1 root root   42 Jun 30 16:46 libc_nonshared.a -> /usr/lib/x86_64-linux-gnu/libc_nonshared.a
lrwxrwxrwx  1 root root   48 Jun 30 16:43 libpthread_nonshared.a -> /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a


oracle@hakan-work:~$ ls -la /bin/awk
lrwxrwxrwx 1 root root 12 Jul  1 10:45 /bin/awk -> /usr/bin/awk


Thursday, June 19, 2014

Good riddance

Ubuntu One is no more. Long live the new king, OwnCloud version 6. Don't use v5. It shreads files for fun.

Tuesday, February 18, 2014

Help! Git eats all of my memory!

My little server runs a whole a lot of things on 2GB RAM. Then I run git clone with some files as big as 1GB in the repository and the poor server keels over, sticks its legs out and starts pining for the fjords.

The following reduces the amount of memory & resources Git uses. I am obviously sure it will make it crappier, slower and make it run as slow as molasses but at least it won't kill the box. That's a win in my book. Consult the manual for further reading.

git config --global pack.windowMemory "100M"
git config --global pack.packSizeLimit "100M"
git config --global pack.threads "1"

Wednesday, November 06, 2013

mjpg-streamer on Rasberry Pi

Commands copied all across the webs so real credit to the Universe, mainly http://blog.miguelgrinberg.com/post/how-to-build-and-run-mjpg-streamer-on-the-raspberry-pi but not limited to.

Checkout the latest code:
svn checkout svn://svn.code.sf.net/p/mjpg-streamer/code/ mjpg-streamer-code

Intstall dependencies and work around bugs:
apt-get install libjpeg8-dev imagemagick libv4l-dev
ln -s /usr/include/linux/videodev2.h /usr/include/linux/videodev.h

I don't have a special Pi camera but a bunch of cheap Linux-supported USB webcams so I really want the input_uvc.so:
make mjpg_streamer input_file.so output_http.so input_uvc.so

Copy binaries around:
cp mjpg_streamer /usr/local/bin
cp input_uvc.so output_http.so input_file.so /usr/local/lib/
cp -R www /usr/local/www
cd /usr/local/www

Limit the index to a more limited choice, do whatever you want here really.
mv index.html index.html.fubar
mv stream.html index.html

Run the mjpg_streamer from a script, input is the /dev/videoX  and a port offset so that I can run multiple cameras:
#!/bin/bash
LD_LIBRARY_PATH=/usr/local/lib mjpg_streamer -i "input_uvc.so -f 12 -d $1 -r 1280x720" -o "output_http.so -p $2 -w /usr/local/www"

i.e., streamcam /dev/video0 8080 or streamcam /dev/video1 8081 from an rc script.

Finally set up a NAT on your router to point it to this or use Apache reverse proxies from an existing web server whatever floats your boat.

Here's the easiest way to do it on Apache, assuming the Pi is on 192.168.1.99 and you've got Apache server with ProxyPass etc. modules loaded. Go and look somewhere else on how to setup an Apache server. You might even prefer to install the Apache Server on your Pi, it might be easier to manage the Apache server instead of the locally managed one.

<VirtualHost *:80>
  ServerName webcam.fubar.com
   DocumentRoot /home/fubar/public_html/webcam
   ProxyPass / http://192.168.1.99:8080/
   ProxyPassReverse / http://192.168.1.99:8080/
   <Directory />
   </Directory>
</VirtualHost>

<VirtualHost *:443>
  ServerName webcam.fubar.com
   DocumentRoot /home/fubar/public_html/webcam
   SSLEngine On
   SSLProxyEngine On
   SSLCertificateFile ssl/server.crt
   SSLCertificateKeyFile ssl/server.key.insecure
   ProxyPass / http://192.168.1.99:8080/
   ProxyPassReverse / http://192.168.1.99:8080/
   <Directory />
   </Directory>
</VirtualHost>

Thursday, October 24, 2013

Ubuntu, Avahi and .local as a domain name

$BIGCORP uses .local as internal domain name.

The tosser who wrote Avahi and the wanker who made it default in Ubuntu uses ".local" as Avahi's internal domain name therefore nothing works. You can nslookup it but cannot use it in commands, scripts, URLs. Shitheads.

Edit /etc/avahi/avahi-daemon.conf and change
domain-name=.local
to
domain-name=.snafu

Save, exit, restart  Avahi daemon, curse the fuckers.

As you can see, I am seriously pissed off with these clueless jellybrains.

Wednesday, September 11, 2013

Disable that annoying DualStick pointer!

It is fugly but it works:
hakan@fubar:12:15:26:~$ cat bin/disablepointer
#!/bin/bash
DEVICE=`xinput --list |grep -i stick| awk '{print $5}'|sed s/id=//g`
PROPERTY=`xinput --list-props $DEVICE | grep Enabled|awk '{print $3}'| sed s/[^0-9]//g`
echo Disabling $DEVICE $PROPERTY 0
xinput --set-prop $DEVICE $PROPERTY 0

Simpler but less fun:
xinput -set-prop "DualPoint Stick" "Device Enabled" 0

Monday, May 27, 2013

Shitheads!

That's you, iOS and iTunes writers & designers!!!

Friday, January 11, 2013

Dear Ubuntu One

You gotta be kidding me. Stop deleting my files!
Sincerely annoyed,
H