Talend Studio on Linux: making it look nicer
by Fred on Dec.06, 2011, under Data integration
Doesn’t look like on Mac on Win32, does it?
You can find several howto around, the GTK+ reference here, a GTK+ theme how to.
Create a .gtkrc-eclipse in your home directory, with the following inside:
style "eclipse" {
font_name="Droid Sans 9"
GtkButton::default_border={0,0,0,0}
GtkButton::default_outside_border={0,0,0,0}
GtkButtonBox::child_min_width=0
GtkButtonBox::child_min_heigth=0
GtkButtonBox::child_internal_pad_x=0
GtkButtonBox::child_internal_pad_y=0
GtkMenu::vertical-padding=1
GtkMenuBar::internal_padding=0
GtkMenuItem::horizontal_padding=4
GtkToolbar::internal-padding=0
GtkToolbar::space-size=0
GtkOptionMenu::indicator_size=0
GtkOptionMenu::indicator_spacing=0
GtkPaned::handle_size=4
GtkRange::trough_border=0
GtkRange::stepper_spacing=0
GtkScale::value_spacing=0
GtkScrolledWindow::scrollbar_spacing=0
GtkExpander::expander_size=10
GtkExpander::expander_spacing=0
GtkTreeView::vertical-separator=0
GtkTreeView::horizontal-separator=0
GtkTreeView::expander-size=8
GtkTreeView::fixed-height-mode=TRUE
GtkWidget::focus_padding=0
}
class "GtkWidget" style "eclipse"
Then, export the GTK2_RC_FILES variable. Example:
export GTK2_RC_FILES=/home/fblaise/.gtkrc-eclipse
And launch talend or any eclipse-based program. It should look much better.
You will notice that the palette font size doesn’t change, and remains big… I don’t know why it is not changing with the rest. If you have a clue, please post a comment! Thanks.
Fed up of re-opening your ssh sessions after suspend?
by Fred on Nov.29, 2011, under Code and scripts
Every morning, when I come to work, there are a set of machines I need to get connected to. Of course, since I s2d or s2r my laptop overnight, the previous day ssh sessions are lost. Even worse, they take time to actually kick me out to my local prompt.
If you’re using gnome-terminal, you can write a small shell script that will open up these sessions for you. All my servers use private/public keys as login method, so with the help of the ssh-agent, it is a straight through login for all servers.
#!/bin/bash
GT=`which gnome-terminal`
$GT --window --maximize --profile=prod --title="serverprod" -e "ssh server1" \
--tab --profile=prod --title="serverprod2" -e "ssh server1" \
--tab --profile=dev --title="serverdev1" -e "ssh server2" \
--tab --profile=dev --title="serverdev2" -e "ssh server2" \
--tab --title="servertest1" -e "ssh server3" \
--tab --title="servertest2" -e "ssh server3"
KDE broken after latest updates
by Fred on Nov.14, 2011, under Uncategorized
I don’t know what broke my openSUSE 11.4 KDE.
After the latest updates, including a kernel update, KDE would not display my windows anymore, fglrx driver seemed lost despite compiling successfully. Wanted to revert back to older kernel to see, but as usual and for years now, updates actually delete the previous kernel — this is really annoying.
So on IceWM. If anyone has an idea why latest updates/FGLRX/KDE is broken, please shoot me an email.
Linux fstab: mount a path containing spaces
by Fred on Oct.13, 2011, under Uncategorized
Just ran across that, so here it is.
Let’s say you want to CIFS mount a windows share — say “//server01/it stuff$”, but your Windows admin put spaces in the path.
Replace the spaces with \040.
So, in your /etc/fstab, the line would give:
//server01/it\040stuff$ /home/fblaise/mnt/MyITDrive cifs username=fblaise,password=yoursinhere,uid=1000,gid=100,_netdev 0 0
It will then work, and your linux apps which cannot see beyond your local filesystems will have a new life
Blog has a new home
by Fred on Sep.05, 2011, under Uncategorized
My blog has found a new home in the server of my friend Davide, maintainer of bacula-web. Thumbs up for Davide and its work on bacula-web, currently working on a promising alpha version.
Using name_changes in File::Tail
by Fred on Mar.16, 2011, under Perl
For those wondering how to use the name_changes parameter of the File::Tail module, here is how I did.
First, define a variable holding your sub. Here, I just get the file that was modified last, matching some pattern.
my $meslog = sub {
my $logfile = `ls -ltr $dir2mon |grep messrv_2 |tail -1 |awk {'print \$9'}`;
return $dir2mon . "/" . $logfile;
};
Then, in the initialization of the File::Tail object, specify it as such (with other parameters if you wish).
my $file2mon = File::Tail->new(
name=>&$meslog,
resetafter=>20,
name_changes=>\&$meslog ) || warn $!;
Perl is then giving you a code reference that you can use.
That way, you should not get any “Not a CODE reference” error anymore, or other “Can’t use string (“/some/file/some/where”…) as a subroutine ref while “strict refs” in use”.
Dynamically resize datafiles in Oracle
by Fred on Feb.25, 2011, under Oracle
Ever wanted to resize to the smallest all of your datafiles at once?
set serveroutput on;
declare
cursor c2 is select file_name,
CEIL( (NVL(HWM,1)*8192)/1024/1024 ) SMALLEST
FROM DBA_DATA_FILES DBADF, ( SELECT FILE_ID, MAX(BLOCK_ID+BLOCKS-1) HWM FROM DBA_EXTENTS
GROUP BY FILE_ID ) DBAFS
WHERE DBADF.FILE_ID = DBAFS.FILE_ID(+);
my_df varchar2(200);
tmp_cmd varchar2(200);
smallest_size varchar2(8);
begin
open c2;
loop
fetch c2 into my_df, smallest_size;
exit when c2%notfound;
dbms_output.put_line('Resizing datafile ' || my_df || ' with ' || smallest_size || 'M');
tmp_cmd := 'alter database datafile ''' || my_df || ''' resize ' || smallest_size || 'M';
execute immediate (tmp_cmd);
end loop;
close c2;
end;
/
Replace the 8192 with whatever your db_block_size is.
Thanks to Diane Martin for her extremely useful article at http://www.articles.freemegazone.com/shrinking-oracle-datafiles.php.
Alfresco 3.4d ldap sync
by Fred on Feb.21, 2011, under Alfresco
While upgrading from 3.3g to 3.4d, my ldap sync wouldn’t work anymore.
I had to add in my ldap-ad-authentication.properties the following line:
ldap.synchronization.java.naming.security.authentication=simple
While there is a similar line for authentication, it doesn’t do it for sync’ing up.
ldap.authentication.java.naming.security.authentication=simple
Samsung HM1000 BT headset and android
by Fred on Jan.08, 2011, under Android
Just bought the Samsung HM1000 bluetooth headset to work with my Android 2.2.1 phone (Nexus One).
Works flowless, if you were wondering. Good bang for the buck (~20eur).
Talend: bug in yyyy date mask
by Fred on Jan.04, 2011, under Data integration
While using Talend Open Studio v4.1.1, I realized there was a bug with the date mask for year over 4 digits : ‘yyyy’ (Specifically using Talend.parseDate(String s)). It gives back only the last 2 digits of the year. However, year mask ‘yy’ gives you the year on 4 digits.
Hopefully will avoid someone to wonder what’s going on until at least the next release. Will hunt for an existing bug, otherwise will open a new one.
Edit: I guess not a bug, but some obscure things related to the Excel cell I am parsing the date from..