Easy migrate your current Windows OS to SSD

If you plan to migrate your current OS to SSD you will need a tool which will help you move the system to the new the disk. In most cases SSD will be smaller then your current disk, so the tool should be able to shrink partitions during the operation.
There is a lot of tools available, but most of them are not free. I have used EaseUS Todo Backup Free which includes this functionality. In my case the disk had 5 partitions, but the OS partition was the third one, but even that was not problem for the EaseUS Todo Backup. It automatically shrunk the third partition, great job!
After you install the software, just click Clone button on the top and start migration in a few seconds.
EaseUS Todo Backup

Optimize images in CRON job

Google PageSpeed Insights may complain about images being not compressed enough. There are techniques which ensure lossless compression. When using JPG images you may compress them using jpegoptim, which may be run from the command line.

jpegoptim -s /var/www/html/images/*.jpg

The command will go through all jpg images in that folder and will perform lossless compression. The -s parameter will also ensure that all markers (eg. comments and EXIF data) will be removed.

Add music from your SD Card to Windows Media Player library

This solution is good for situations where you don’t have enough space on your hard disc, so you move it to your SD Card and have it plugged to the PC permanently.
You may have noticed that you are unable to select folders inside the SD Card. What you have to do is make the music folder on the SD Card shared (at least with yourself) and then add it to the Windows Media Player from the network share.

Block commit to SVN when Redmine issue is not specified

Redmine allows to reference commits to issues by using keyword refs followed by # and number of the issue. If you want to block user commit to SVN without specifying Redmine issue you can use similar pre-commit hook on SVN. The hook is for Windows version.


REM *************************************************************
REM * this sets the arguments supplied by Subversion *
REM *************************************************************

REM *************************************************************
REM * define directory paths *
REM * you *must* add any paths for command line tools you plan *
REM * since SVN does not include the Windows %PATH% environment *
REM * variable for security reasons. *
REM * *
REM * DIR - the current hooks directory *
REM * PATH - a user set path of where executables are located *
REM * *
REM *************************************************************

REM *************************************************************
REM * make sure to add the path to the SendEmail executable *
REM *************************************************************

REM *************************************************************
REM * get comment search for "refs #" *
REM *************************************************************
svnlook log -t "%TXN%" "%REPOS%" | findstr /c:"refs #" > NUL
IF %errorlevel% NEQ 0 GOTO Error

GOTO Success

ECHO. 1>&2
ECHO Your commit has been blocked because you didn't 1>&2
ECHO specify Redmine issue with refs keyword. 1>&2
ECHO Please write a log message (eg. refs #123) and 1>&2
ECHO then try committing again. -- Thank you Roman 1>&2


Hide images from the Plone’s Tabular View

It is easily possible to hide images from the navigation port-let using control panel, but I did not find similar option for the Tabular View when a folder contents is displayed.
So here is the solution I have applied.

  1. Login to Zope Management interface
  2. Go to /…/portal_skins/plone_content and create a custom version of folder_tabular_view
  3. In the customized version of the folder_tabular_view locate “class python:test(oddrow, ‘even’, ‘odd’)” and change it to “class python:test(oddrow, ‘even tr-‘ + item_type_class, ‘odd tr-‘ + item_type_class)
  4. After these changes TR tag of the folder contents table will have an additional CSS class which we can use to hide unwanted content types
  5. Save the changes and edit customized CSS file called ploneCustom.css
  6. Add “.tr-contenttype-image { display: none; }” to hide rows with image content types