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
Stuff around all IT I work with. Basic idea is to collect things I want to remember. Hope it helps someone out there as well ;)
Sonntag, 18. März 2012
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!
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!
Labels:
Java
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:
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/cdromMake 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.gzAfter that you can enter newly created folder with extracted tools and run vmware-install.pl
Labels:
unix
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 :)
Labels:
cygwin
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:
Recursive grep on Solaris
On Solaris you usually don't have a recursive grep so you need to work with find and grep.
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.
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.
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.
#!/bin/bash IFS="," FOLDERS="a,b,c" #cd /yourbasefolder for i in $FOLDERS do mkdir -p $i/your/folder/structure done
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
Freitag, 3. Juni 2011
SQL Server Tools
This post contains some Powershell scripts to quick check some things on a running SQL Server instance. Imagine you got a SQL server delivered by a data centre team and now you are responsible for installing a software that shall use this server.
Before looking in all the various bugs in your delivered software, it is a good idea to check if SQL server was installed and prepared properly. Usually you have some credentials and a server address. So a little tool that checks if instance can be reached with this data would be nice.
Script you can find at [1] does exactly that. Just replace vars with your server's data (hostname, port, credentials). It also retrieves exact version with which you can check if correct patch level was installed (see Microsoft's info at [3]).
Another fancy thing would be to check which databases or roles are available with your user. This can be done using a nice object called Microsoft.SqlServer.Management.SMO.Server . Just google for this object to learn more. A script that retrieves databases, roles and some other interesting infos can be found at [4]. A much more extense example can be found at [5])
References
[1] UserConnectionTest.ps1
https://connectionteste.svn.sourceforge.net/svnroot/connectionteste/SQLTools/UserConnectionTest.ps1
[2] SQL Server Connection String Parameter
http://www.connectionstrings.com/Articles/Show/all-sql-server-connection-string-keywords
[3] SQL Version
http://support.microsoft.com/kb/321185
[4] GetSQLUserRoles.ps1
https://connectionteste.svn.sourceforge.net/svnroot/connectionteste/SQLTools/GetSQLUserRoles.ps1
[5] Lots of SQL Server instance details
http://mspowershell.blogspot.com/2009/12/most-dbas-have-had-to-examine-unknown.html
Before looking in all the various bugs in your delivered software, it is a good idea to check if SQL server was installed and prepared properly. Usually you have some credentials and a server address. So a little tool that checks if instance can be reached with this data would be nice.
Script you can find at [1] does exactly that. Just replace vars with your server's data (hostname, port, credentials). It also retrieves exact version with which you can check if correct patch level was installed (see Microsoft's info at [3]).
Another fancy thing would be to check which databases or roles are available with your user. This can be done using a nice object called Microsoft.SqlServer.Management.SMO.Server . Just google for this object to learn more. A script that retrieves databases, roles and some other interesting infos can be found at [4]. A much more extense example can be found at [5])
References
[1] UserConnectionTest.ps1
https://connectionteste.svn.sourceforge.net/svnroot/connectionteste/SQLTools/UserConnectionTest.ps1
[2] SQL Server Connection String Parameter
http://www.connectionstrings.com/Articles/Show/all-sql-server-connection-string-keywords
[3] SQL Version
http://support.microsoft.com/kb/321185
[4] GetSQLUserRoles.ps1
https://connectionteste.svn.sourceforge.net/svnroot/connectionteste/SQLTools/GetSQLUserRoles.ps1
[5] Lots of SQL Server instance details
http://mspowershell.blogspot.com/2009/12/most-dbas-have-had-to-examine-unknown.html
Labels:
powershell
Dig and Cygwin
Just a quick tip today. If you need dig, a handy DNS query tool, on your cygwin bash you have to install bind package. Searching for Dig in cygwin's setup tool does not help, so after I figured out it is part of BIND I thought I help save some time ;)
Bind is a full blown DNS server but it's not that big to install and dig is definitly worth it ;)
Bind is a full blown DNS server but it's not that big to install and dig is definitly worth it ;)
Montag, 14. März 2011
My PowerShell Profile
Starbuck's Powershell profile
This article contains my growing PowerShell profile file. For those of you that are familiar with Unix shells this is a file similiar to .bashrc/.cshrc/... Per default executing this file this forbidden by policy, so you not to activate that. See this article for an interesting introduction to aliases and activation of profile files.
For the impatient reader execute the following command on a PS started as administrator:
And here is my (growing) Profile:
This article contains my growing PowerShell profile file. For those of you that are familiar with Unix shells this is a file similiar to .bashrc/.cshrc/... Per default executing this file this forbidden by policy, so you not to activate that. See this article for an interesting introduction to aliases and activation of profile files.
For the impatient reader execute the following command on a PS started as administrator:
Set-ExecutionPolicy Unrestricted
And here is my (growing) Profile:
# implements a simple curl, lots of stuff still to do :) function curl($url) { if($url){ if(!$url.StartsWith("http://")) { $url = "http://" + $url; } return (new-object System.Net.WebClient).DownloadString($url); } else { return "Please provide a URL"; } } # this is my tail -f function tf ($file) { if($file) { get-content -wait $file; } else { write-host "Please provide a file to listen!"; } }
Labels:
powershell
Abonnieren
Posts (Atom)