27 września 2015

How to demotivate and disempower your team

When you employed a hardworking, skilled and inspired software developers, you have to know that there are many ways to turn them into demoralised, disempowered coding zombies that want just to leave your company. It is pretty easy to achieve that goal, if you only keep the one thing in your mind - you need to decrease the quality of their life inside work. Now I will show the way how to go about it.

1. Make decisions without involving them
Have you ever heard sentence like "Nothing about us without us"? Do not even try to follow this rule. Informing people about changes that affects them is just a waste of time, so engaging them into decision making process has no sense. They will try to change your mind or even force their own ideas and solutions. Make this case unreachable by excluding developers from the process.

2. Repeat them that you want to ship a shit
Some developers like coding that much that it turns into something similar to religion. They want to be more productive, write better code, etc... But who cares? You need to sell your product to the customers, not to have a well designed and written software. Tell them to shut up and work faster.

3. Remove valuable people from teams
All resources are replaceable. Remember about that when you find a guy with mouth. Fire people at the higher positions. They are generating high costs and all spreadsheet-driven management specialists should know about it. You can replace them with multiple inexperienced people that will be cheaper.

4. Treat teams like groups of resources
"Resources" - pretty important word. Use it as much as possible when talking to the developers. Forget about the fact that they are human beings. Teams are not any kind of social creations, they are just a divisions that allows you to identify groups of resources.

5. Don not explain or ask, just tell
Tell the developers how to do their jobs, don not give them any choice in how to complete their tasks. Make sure they don't do anything without your permission. Remember about time frames for their jobs.

6. Money is not everything
Fat salaries can improve life outside work, but in most cases they do not change the life inside work. People will be lazy, greedy but not committed or enthusiastic.

That all you need to do, to keep your employees demotivated enough to leave your company.

20 sierpnia 2015

Fedora upgrade, Yum deprecation and no MD5 verification for SSL - 22 state of insanity

Fedora 22 become officially stable and 23rd version is publicly available as an Alpha Release. I decided to update OS on my home workstation. Good old "Heisenbug" retired, and his place was taken by Fedora 22. Upgrade process was pretty simple (but time-consuming). In first step I had to upgrade my OS from version 20th to 21st. Direct update from F20 to F22 was not possible due to introduction of Fedora products. I just wanted to get comfortable environment for software development so {{workstation}} option was the option I needed.
sudo yum update fedup fedora-release
sudo fedup --network 21 --product=workstation
Downloading packages, reboot, upgrade and everything worked fine. I went to second step.
sudo fedup --network 22
Downloading packages one more time, reboot and upgrade. Just to clean up that RPMs mess and that's all
sudo rpm --rebuilddb
sudo yum distro-sync --setopt=deltarpm=0
...and I got this
Yum command has been deprecated, use dnf instead. See 'man dnf' and 'man yum2dnf' for more information. To transfer transaction metadata from yum to DNF, run 'dnf migrate' Redirecting to '/usr/bin/dnf distro-sync --setopt=deltarpm=0

Me: Uncle Google! Help me! This bastard is talking dirty!
UG: Comming with help! Look here and here
Me: WTF?

Ok, I'm explaining - Fedora (from version 22) is using DNF to manage RPM packages and we should not use Yum any more. It's not a big deal, at least for me, but if you're pissed off because of this change, you can simply create an alias for DNF like this:
alias yum=`dnf`
and that's all. DNF has the same set of command line parameters so you can safely use your DNF-under-the-hood tool. Ok, let's get back to cleaning up packages puddle.
sudo dnf distro-sync --setopt=deltarpm=0
sudo dnf install rpmconf
sudo rpmconf -a 
Upgrade finished. Everything worked fine, at least for the time when I tried to connect to the network at work through VPN. NetworkManager after about half a minute displayed gentle message with short opinion about my VPN keys and suggestion where can I put them. I checked the logs
$ journalctl -f -u NetworkManager

Mon Jul 14 16:24:18 2015 us=55541 OpenVPN 2.2.2 x86_64-unknown-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] built on Jul 14 2015
------- SNIP -------
Mon Jul 14 16:24:23 2015 us=212915 TLS: tls_multi_process: i=0 state=S_SENT_KEY, mysid=959d12ad 3fd6358b, stored-sid=21b1e50a 63e80c5c, stored-ip=
Mon Jul 14 16:24:23 2015 us=212920 TLS: tls_process: chg=0 ks=S_SENT_KEY lame=S_UNXXF to_link->len=0 wakeup=604800
Mon Jul 14 16:24:23 2015 us=212925 ACK reliable_can_send active=0 current=0 : [3]
Mon Jul 14 16:24:23 2015 us=212931 BIO write tls_write_ciphertext 100 bytes
Mon Jul 14 16:24:23 2015 us=212935 Incoming Ciphertext -> TLS
Mon Jul 14 16:24:23 2015 us=213196 VERIFY OK: depth=1, /C=XX/ST=MYTOWN/L=MYTOWN/O=OpenVPN-Myprovider/CN=OpenVPN-Myprovider-CA/emailAddress=admin@myprovider.xx
Mon Jul 14 16:24:23 2015 us=213223 VERIFY ERROR: depth=0, error=certificate signature failure: /C=XX/ST=MYTOWN/O=OpenVPN-Myprovider/CN=server/emailAddress=admin@myprovider.xx
Mon Jul 14 16:24:23 2015 us=213238 SSL alert (write): fatal: decrypt error
Mon Jul 14 16:24:23 2015 us=213271 TLS_ERROR: BIO read tls_read_plaintext error: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Mon Jul 14 16:24:23 2015 us=213277 TLS Error: TLS object -> incoming plaintext read error
Mon Jul 14 16:24:23 2015 us=213282 TLS Error: TLS handshake failed
After not-so-short digging through the Internet I found an information that verification using MD5 was disabled because it's not secure enough anymore. Information is important, but I need an answer how to fix that. After further searching/reading/cursing I have found the solution for the problem. I needed a silver bowl, ritual knife and blood of... uhmmm, not this... I needed to open one file (/usr/lib/systemd/system/NetworkManager.service) and add a line that enables MD5 verification.
sudo vim /usr/lib/systemd/system/NetworkManager.service
Service section should contain line like this
Save file with [Esc] and :x and restart NetworkManager service
systemctl daemon-reload
systemctl restart NetworkManager.service
After that changes VPN is working like a charm (apart from the fact that is uses lame MD5 for verificatrion). Uptade: It seems that I made a mistake by making a statement that DNF has the same coomand line interface as Yum. There are several differences those package managers. List of changes can be found at DNF documentation web page.

Interesting resources;

21 października 2013

Removing all empty directories from SVN tree

Application development is really complex process. Many thousands lines of code are placed in different files. Every bunch of files is gathered inside of some directory. Sometimes code needs some little modifications or biger refactoring. There are some reasons why some classes are moved to totally different packages. Empty directories should be removed from project tree but sometimes it doesn't happen. When we're using Git it's not the problem. Git SCM doesn't understand what is an empty directory and removes it when all files from it are moved to different location. The case is somewhat different for SVN. All empty directories are stored in repository. They exists and are versioned. Looking for empty directories manually can be really painfull. Fortunatelly there's some simple way to deal with this kind of issue. Just one command executed in BASH terminal can remove all unnecessary directories
find . -name .svn -type d | while read ss; do dir=$(dirname "$ss"); test $(ls -a "$dir" | wc -l) == 3 && echo "svn rm \"$dir\""; done
How it works? The
find . -name .svn -type d
searches for directories named .svn. All results of searching are passed through the pipe to the shell and checks what shows the
ls -a "$dir"
command. If call to ls returns only ".", ".." and ".svn" then directory is deleted.

17 sierpnia 2013

CheckBoxTableCell in JavaFX

After a few hours with documentation and digging through the Internet resources I finally found a solution for creating a table containing column with CheckBox components. It's pretty simple if you know a few things:

  • first of all, there's javafx.scene.control.cell.CheckBoxTableCell component which can render what you want 
  • second, when you're using javafx.scene.control.cell.CheckBoxTableCell don't forget to define cellValueFactory and use myBooleanValueProperty method instead of getMyBooleanValue.
  • and the last, if you want to implement own solution like this

public void updateItem(Boolean item, boolean empty) {
    super.updateItem(item, empty);
    if (!isEmpty()) {
the view will render CheckBoxes for empty rows - you have to implement removing CheckBox.

The simple code which uses CheckBoxTableCell can looks like this

<?import javafx.scene.control.cell.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.GridPane?>
<?import pl.kmi.controls.CheckBoxCellFactory?>
<GridPane fx:controller="pl.kmi.CustomCheckBoxTable"
          xmlns:fx="http://javafx.com/fxml" alignment="center">

    <TableView fx:id="customTable" GridPane.columnIndex="0" GridPane.rowIndex="0">
            <TableColumn fx:id="payedColumn" prefWidth="100">
                    <PropertyValueFactory property="checked"/>
and the Java
public class CheckBoxCellFactory2 implements Callback, TableCell> {
    public TableCell call(TableColumn stTableColumn) {
        CheckBoxTableCell checkBoxCell = new CheckBoxTableCell();
        return checkBoxCell;
public class TableRowModel {

    /* Some other fields... */
    private BooleanProperty checked;

    public CostTableRowModel(BooleanProperty checked) {
        this.payed = checked;

    public BooleanProperty payedProperty() {
        return payed;
    /* Other getters and/or setters */

31 grudnia 2012

Scala interpreter after Fedora 17 update

Monday, 10:45 AM. I'm at work. Building module and running performance tests. Something goes wrong. There's an error in Scala code. Have to check it quickly with interpreter. Updated Fedora 17. Typing "scala" in opened terminal window.
/usr/bin/scala: error: JVM_LIBDIR /usr/lib/jvm-exports/java does not exist or is not a directory
I checked mentioned directory and it doesn't exist. Next step:
whereis scala
scala: /bin/scala /usr/bin/scala /usr/share/scala /usr/share/man/man1/scala.1.gz
Checking Scala interpreter launcher
sudo vim /bin/scala
Gotcha! Line 50.
export JAVA_HOME=/usr/lib/jvm/java/
Changing it to
export JAVA_HOME=/usr/java/default/
Now, just save and it's done.
Welcome to Scala version 2.9.2-unknown-unknown (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37).
Type in expressions to have them evaluated.
Type :help for more information.

Yes, it glows!