Samstag, 22. Juni 2013

How to enable menu icons in apps running on KDE

When running software on KDE you may noticed that menu entries that should have icons have not. This can be changed via System Settings->Application Appearance->GTK Configuration. Config dialog is shown in below image. Enable check boxes: Show Icons in GTK Buttons and Show Icons in GTK Menus.

Result in application menus looks like shown in the following image. Example was taken from Eclipse IDE.

Note: I'm running Linux Mint 14. So window manager is KDE running on an Ubuntu/Debian core.
If you are running Ubuntu you may find help here:

Montag, 15. Oktober 2012

Solr Commands

This is just a notepad for Solr curl commands. Solr is a search engine. Wiki can be found here.

Add a binary document
curl "http://localhost:8983/solr/update/extract?" -F "mydocument=@your_document.pdf"

Add a CSV file
Keep in mind, that you need to specify fields in you CSV file in schema.xml.
Delete entire index
# query to delete index
curl http://localhost:8983/solr/update --data '*:*' -H 'Content-type:text/xml; charset=utf-8'
# commit changes
curl http://localhost:8983/solr/update --data '' -H 'Content-type:text/xml; charset=utf-8'

Sonntag, 7. Oktober 2012

How to list old files on Windows

Today just a quick one. Following command outputs all files that are older than 57 days. Quite handy for many stuff :)

forfiles /p k:\ /d -57 /c "cmd /c echo @FILE:@FDATE"

Sonntag, 18. März 2012

Monty Pyhton's Meaning of Life

Here is something to refelct on a rainy sunday afternoon :)

There's everything in this movie, everything that fits.
From the Meaning of Life in the universe, To girls with great big tits.

We've got movie stars and foreign cars, Explosions and the lot
Filmed as only we know how, On the budget that we've got.

We spent a fortune on locations And quite a bit on drink
And there's ever the odd philosophical joke, Just to make you buggers think.

Yet some parts are as serious And as deep as you could wish
But largely it's all tits and ass And quite a bit of fish.

Other bits are fairly childish And some are frankly rude
But at least we've got a lot of nice girls All banging around in the nude.

So take your seats, enjoy yourselves And let's just hope it's funny
Because it's not only done to make you laugh But to make us lots of money.

So sit back and have a good time With your boyfriend or your wife
Relax and just enjoy yourself For this is the Meaning of Life

Sonntag, 18. Dezember 2011

Autowire Jira

When developing plugins for Jira (4.x) you may encountered auto wiring problems in modules with non trivial constructors. For example if you want to enhance time sheet plugin (link) with some custom functions and you want to inject UserManager from shared access layer (link). So you need to let Jira inject UserManager. It will not work via setters/getters if you have a complex constructor (i.e. one with parameters).
So you need to add to injected interface to your constructor - but you have to take care that this doesn't break anything else in your plugin. So overloading existing constructor is the only way to bypass this problem.
As Jira is based on Spring, if someone knows how to solve this problem more elegantly please let me know!

Mittwoch, 30. November 2011

Install Vmware Tools

Installing VMware Tools on CentOS

I don't remember ho often I installed CentOS on VMware and yet I always need to google how this tool installation works. So first of all you need to mount cdrom with vmware tools (image is inserted by player automatically). This can be done by:
mount /dev/cdrom /media/cdrom
Make sure cdrom folder exists. You can chose of course any existing folder. After that just copy VMware package to e.g. /tmp and extract it with:
tar -xzvf WMwareTools-...tar.gz
After that you can enter newly created folder with extracted tools and run

Mittwoch, 9. November 2011

Cygwin and telnet

If you are looking for small network tools like telnet, you may found it difficult to find via package search in cygwin's setup tool. That's because it is part of package inetutils. Thought that might save some folks out there google time :)

Mittwoch, 3. August 2011

Starbuck's Unix Tricks

This is just a collection of small tricks I found useful when working on a Unix shell

Rename multiple files
Following bash snippet solves a very common task. You have a list of files or folders and want to add a prefix or suffix. Please note that this little for loop do not differentiate folders and files. Found it nevertheless quite useful:

for f in `ls`;do mv "$f" "$(echo $f"_mysuffix")"; done

Recursive grep on Solaris
On Solaris you usually don't have a recursive grep so you need to work with find and grep.
find . -name *.conf | xargs grep -i 'PATTERN'

Creating folder structures
Following snippet shows how to create based on a list of base folder how to create a common deep folder structure. Things to notice here is -p switch for mkdir and how to iterate over comma separated lists.

#cd /yourbasefolder
for i in $FOLDERS
   mkdir -p $i/your/folder/structure

Count frequencies
Below snippets extracts from an access logfile (apache, application server, etc) column with requester's IP address and compute frequencies. It is piping logfile content to awk to extract on column (separator configured with FS). Next pipe sorts IP addresses, couting step is then done with uniq another nice UNIX tool. Last not least couting is sorted to have a nice chartlist.

cat logs/access.log | awk '{FS = "\t"}; {print $5}' | sort | uniq -c | sort