Tuesday, July 15, 2014
NX screen sizing issue
Thursday, April 10, 2014
Freeing space from deleted files
I just deleted a 33 GiB error log that had filled up my NFS shared disk. This didn't immediately free up any space on the device. This is because the file was being held open by another process and so the space can't be freed until those processes terminate and close their connections to the file.
To check for this condition you can use lsof and then grep for deleted files. I found what was keeping my file open and killed that process (it was a "grep -c" I'd forgotten I'd set off ages ago).
The process keeping the file open is listed in the first column.
For example, in the output below the grep process is holding my stackTraces.out file open:
"grep 1234 paul 3r REG 202,166 35110973440 3285868 /nfs_share/proj/stackTraces.out (deleted)"
Monday, December 16, 2013
KNIME: duplicate column issue
"Execute failed: Duplicate column name "<colname>" at positions 1 and 2" - (the column names and reported positions depend on the format of the input data).
I tried to fix up the columns thinking this was a whitespace issue or some such but had no joy. For me the solution was to read the molecules without extracting the data and then use the "SDF Extractor" node to grab the data. This worked with no issues.Tuesday, November 19, 2013
ShrewSoft VPN Manager window does not show under 64Bit Windows 7
I'm using version 2.2.2 of the ShrewSoft VPN client on my 64bit Win7 laptop. For some reason, the 'Manage' window doesn't show in this version - which bit me when my VPN details changed. The .pcf configuration files aren't re-read if you edit them and so you have to have access to the 'manage' dialog in order to update your connection - you can't even add a connection without accessing this dialog.
So, the solution for me was actually quite simple -
- try to bring up the 'Manager' dialog (right click the ShreSoft icon in the bottom right of the taskbar and click on 'Manage')
- bring up the task manager (
Ctrl-Shift-Escis a handy short-cut for that) - the VPN manager should be present in the "Applications" window - right click this and select 'maximize'
Thursday, October 24, 2013
Compare a local and a remote file using 'diff' and process substitution.
rsync -ilvrn <localdir> <remotedir> ) and then use the above diff command to compare them.
Friday, June 21, 2013
Better tab use with bash
One of the most viewed posts on this blog is the unix-join-with-tabs one where I describe the "Ctrl-v
cut -f':' --output-delimiter=<tab> where the output delimiter needs to be a tab.
However, there's a much nicer/easier way of specifying a tab character in bash:
$'\t'. Take a look a the QUOTING section of the bash manpage for all the details.
Here's a simple example of it in action:
Tuesday, June 4, 2013
Using 'find' to list files with multiple suffixes
find' command can make this all a lot less painful.
Here's the command for matching a single suffix:
But editing this command-line to match the next suffix of interest becomes tedious very quickly. Thankfully, you can chain together file tests like so (note the grouping):
Then acting on these files is easy - just update the -exec action to what you want (e.g. "
-exec bzip2 {} \;" - you probably want to use xargs or "-exec bzip2 {} +" for this to reduce the number of command invocations)
An interesting note here is that the following command isn't executed as you might expect. The '
ls' command is only executed on the *.tsv files due to the way the expression is evaluated: from left to right with the implicit '-and' between the second '-name' and '-exec' exec having higher precedence than the '-or' between the two '-name' tests..