I am working with a database schema where xml content is being stored in a BLOB and I’m working on querying that XML.
When you cast the BLOB to VARCHAR, you’ll run into the limit of 2000 characters with the following error:
ORA-06502 PL/SQL : numeric or value error : raw variable length too long
So this trick came in handy:
SELECT XMLTYPE( BLOB_FIELD, 871 ) AS AWESOMEXML FROM YOUR_TABLE;
Please be very aware of the character set that you are using, you can enter a world of hurt when you’re using the wrong one. The number 871 is the character set UTF8, which we are using.
For other character sets, check http://www.mydul.net/charsets.html
I wanted to SSH into my home server from my workplace but I couldn’t reach it directly because of the way the network was set up.
As it turns out it is quite easy to do by using the corkscrew program.
Edit ~/.ssh/config and add the following lines:
Host home joris.his.homeserver.com
Hostname joris.his.homeserver.com
User joris
ProxyCommand corkscrew proxyserveraddress proxyserverport %h %p
The most important part is the ProxyCommand, this lets your ssh client know that it should use corkscrew as a proxy to your host. %h means the host of your remote server, %p means the port of your remote server.
I ran into this issue today on my command line SVN client.
Every time I ran the SVN command against my repository, it asks for my password. It does remember the username but doesn’t store the password.
There are a couple of settings to check in two different files:
.subversion/config
.subversion/servers
.subversion/config
The config file contains a setting which sets the password store you will be using. We need to disable all password stores and use an empty list, which is done by uncommenting (or adding) the next line
password-stores =
.subversion/servers
The servers file contains settings which allow you to save your passwords in general and to save the passwords in plaintext (please be careful when choosing this option!)
This file is divided in sections which are set with the [] brackets. In the [global] group you should uncomment (or add) the following lines:
I wanted to run UltraVNC on my laptop to share the screen towards my desktop computer. I have no administrator rights on this pc but I can run the standalone UltraVNC server fine. To run it without admin rights, download the zip file from the latest version from here, choose the “bin zip” downloads for your OS at the bottom of the page.
When you run winvnc.exe, the following message presented itself in a pop-up:
No password has been set & this machine has been preconfigured to prevent users from setting their own.
You must contact a System Administrator to configure WinVNC properly.
This means you need to set the password first, but you need to run WinVNC to be able to set the password (kind of a Catch 22 there)
Add the contents below in a new file called ultravnc.ini in the same folder as winvnc.exe and your password is set to “nopassword” (without the quotes). You can now startup WinVNC by doubleclicking winvnc.exe.
With this blog post, it’s possible to format any xml you’ve selected. It will take about 5 minutes to get this working, a couple of manual steps are necessary.
These are the tools being used:
This is one quite cool trick where you can see which edit’s were done to a file by which user:
Issue the following command on a file which is checked in to SVN:
svn blame filename
Which will output the following syntax:
revision <tab> username <tab> line in filecontents
Awesome! Now I can quickly see that my colleague was the cause of my failing namespace!
As a sidenote: I really like the function’s name, because most of the time, you’re looking to blame someone 😉
I encountered the following exception when trying to start our AdminServer today:
<May 30, 2013 1:04:27 PM CEST> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: java.lang.NumberFormatException: null
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:454)
at java.lang.Integer.parseInt(Integer.java:527)
at weblogic.ldap.EmbeddedLDAP.validateVDEDirectories(EmbeddedLDAP.java:1104)
at weblogic.ldap.EmbeddedLDAP.start(EmbeddedLDAP.java:242)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
Truncated. see log file for complete stacktrace
>
<May 30, 2013 1:04:27 PM CEST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FAILED>
<May 30, 2013 1:04:27 PM CEST> <Error> <WebLogicServer> <BEA-000383> <A critical service failed. The server will shut itself down>
<May 30, 2013 1:04:27 PM CEST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN>
This does not really explain what went wrong, but the solution is to remove the replicas.prop file and restart the AdminServer again.
The replicas.prop file is located at : $DOMAIN/servers/AdminServer/data/ldap/conf/replicas.prop
Rename (move) replicas.prop to replicas.prop.bak and retry the startWeblogic. In my case this solved the not starting server.
With the piece of code below it’s quite easy to first make sure your table exists before dropping it, so you’re not running into SQL Error: ORA-00942: table or view does not exist
Script explanation: It will check if the table is present before trying to drop it.
-- Drop table
DECLARE
l_count NUMBER;
BEGIN
SELECT COUNT(1)
INTO l_count
FROM ALL_TABLES
WHERE table_name = 'TABLE_NAME'
AND owner = 'USERNAME';
IF l_count > 0 THEN
EXECUTE IMMEDIATE 'Drop table USERNAME.TABLE_NAME CASCADE CONSTRAINTS';
END IF;
END;
/
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
This allows you to search through your history using the up and down arrows … i.e. type “cd /” and press the up arrow and you’ll search through everything in your history that starts with “cd /”.
It’s quite handy to indent XML when you need to read it with the human eye, but on a terminal it’s often not as easily readible.
Fortunatly there’s a command which’ll indent it so you can actually read it;
xmllint –format file.xml This will show you how ugly it could be:
And behold the indented beauty of this little gem: