torek, 21. marec 2017

XFCE4 reset panels

xfce4-panel --quit ; pkill xfconfd ; rm -rf ~/.config/xfce4/panel ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml ; xfce4-panel;

ponedeljek, 13. februar 2017

DB2 Terminate LOAD

What tables are in Load Pending State:
SELECT TABSCHEMA, TABNAME, LOAD_STATUS FROM SYSIBMADM.ADMINTABINFO WHERE LOAD_STATUS = 'PENDING'
How to get TABSCHEMA.TABNAME table out of Load Pending State:
db2 "LOAD FROM /dev/null OF DEL TERMINATE INTO TABSCHEMA.TABNAME NONRECOVERABLE"
db2 "SET INTEGRITY FOR TABSCHEMA.TABNAME IMMEDIATE CHECKED"

četrtek, 09. februar 2017

DB2 LOAD from CURSOR

You can do a LOAD from CURSOR in command line. Example is taken from Fast and easy data movement using DB2's LOAD FROM CURSOR feature:

db2 "DECLARE C1 CURSOR FOR SELECT * FROM FECHNER.SALES"
db2 "LOAD FROM C1 OF CURSOR MESSAGES C:\load_sales_tmp.msg INSERT INTO FECHNER.SALES_TMP NONRECOVERABLE"

ponedeljek, 06. februar 2017

How to tell Maven to disregard SSL errors (and trusting all certs)?

Answer at StackOverflow and copied here if it gets removed:
You can disable SSL certificate checking by adding one or more of these command line parameters:

-Dmaven.wagon.http.ssl.insecure=true - enable use of relaxed SSL check for user generated certificates.
-Dmaven.wagon.http.ssl.allowall=true - enable match of the server's X.509 certificate with hostname. If disabled, a browser like check will be used.
-Dmaven.wagon.http.ssl.ignore.validity.dates=true - ignore issues with certificate dates.

Official documentation: http://maven.apache.org/wagon/wagon-providers/wagon-http/

Here's the oneliner for an easy copy-and-paste:
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

sreda, 31. avgust 2016

SaveAsCapable

In NetBeans Platform you can implement your own SaveAs action like this:
- put this into MyTopComponent.java:
public class MyTopComponent .... {
    private final InstanceContent myContent = new InstanceContent();
    private final Lookup myLookup = new AbstractLookup(myContent);
    private FileObject fo;

    MyTopComponent() {
        ...
        editorContent.add(new SQLEditorSaveAs());
        associateLookup(editorLookup);
    }

    public void setFo(FileObject fo) {
        this.fo = fo;
        // load the file and display it in TextArea
        // this is optional, but putting file's DataObject into this TopComponent's lookup 
        // will make FileChooser for the SaveAS action start in the folder where fo is located
        DataObject myDataObject = DataObject.find(this.fo);
        myContent.add(myDataObject);
    }

    private class MySaveAs implements SaveAsCapable {
        @Override 
        public void saveAs(FileObject folder, String name) throws IOException {
            // save to file, database, ...
        }
    }
}

sobota, 25. julij 2015

Bring database out of BACKUP PENDING state ASAP

If you manage to put your database into BACKUP PENDING state and want to bring it out of it ASAP you can do a backup to a NULL device:
db2 backup db MYDB to /dev/null
The backup will still read the data that should go into the backup image, but it will discard it by writing it into NULL device. In this way you can cut the unwanted downtime by about 50%-60%.

četrtek, 07. maj 2015

BOINC "Show graphics"

I'm using Xubuntu 14.04.2 and BOINC 7.2.42. I'm running SETI@Home and World Community Grid. When I click "Show graphics" on a SETI@Home task nothing happens.
If you run BOINC Manager from command line you get:
    libssl.so.10: cannot open shared object file: No such file or directory

ldd on SETI@Home executable shows:
    libssl.so.10 => not found
    libcrypto.so.10 => not found

Now you do this:
sudo apt-get install freeglut3 libssl1.0.0
cd /lib/x86_64-linux-gnu
ln -s libssl.so.1.0.0 libssl.so.10
ln -s libcrypto.so.1.0.0 libcrypto.so.10 
I'm using 64-bit Xubuntu and for 32-bit you should look for these libs yourself.