Show files changed lately in GIT


Read Me

Overwrite vendor classes

In composer.json, under [„autoload”][„psr-4”], add an entry with namespace as the key and path as the value:

  Copy files you want to override under that path (keeping sub-namespace directory structure) and edit them there. They will be picked in preference to the library package’s original „classpath”. It would seem that namespace->path mappings added to composer.json in this manner are considered before those added […]

Read Me

Replace string in many files

In Bash, just use the following loop:

Read Me

composer killed while updating

The „Killed” message usually means your process consumed too much memory, so you may simply need to add more memory to your system if possible. Actually, you should increase the amount of memory PHP is using by editing /etc/php.ini and adjusting

Change 1024MB to match your requirements.

Read Me

Convert array to object in PHP


Read Me

Convert complex PHP object to string

Easiest and probably the fastest way is to execute:


Read Me

How To Dynamically Invoke A Class Method with a Prefix In PHP


which is equivalent to:


Read Me

sending PUT requests via CURL

Just add PUT option:


Read Me

Ubuntu – Remove packages from /var/cache

Read Me

How to backup an entire partition

The most straight forward way to make a raw image of your partitions is to use dd to dump the entire partition to a single file (remember the OS access the partitions /dev/sda1 through a file interface). Make sure you are on a larger partition or on a secondary drive and perform the following command dd if=/dev/hda1 of=./part1.image to backup(repeat for different partitions) dd if=./part1.image of=/dev/hda1 to restore You […]

Read Me

Logout gracefully from KDE

For KDE 3.x, I use the command: $ dcop –all-sessions –user username ksmserver default logout 0 0 0 For KDE 4.x, make sure the environment variable DBUS_SESSION_BUS_ADDRESS is set for the appropriate session. You can usually find this in /usr/home/username/.dbus/session-bus/. Then use the command: $ qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout 0 0 0

Read Me

How to add apache Basic Auth password

All passwords in the file must be encoded. To do so issue:

  you will be promped for password

Read Me

Restart ubuntu sound system


Read Me

Monitor and optimize Firefox memory usage

Type in:


Read Me

SVN change repo username

The easiest way to do this is to simply use the –username option on your next checkout or commit. For example: svn commit –username newUser or svn co –username newUser It will then be cached and will be used as the default username for future commands.

Read Me

How to monitor disk activity

How to monitor disk activity under Linux?

if you don’t have it yet:

  Or use

  from sysstat package/

Read Me

Run programs in background in Windows

An equivalent to Linux command:

In Windows:


Read Me

How to remove BOM from CSV file with PHP


Read Me

Handy commands to show differences between branches in GIT

Handy commands to show differences between branches in GIT:


Read Me

Ubuntu failes to sync time

In case local time is not being synchronized with a NTP server and:

returns something like:

The ‚conditionFile is executable’ line means there’s a unfulfilled dependency and /usr/sbin/VboxService file is blocking timesync. We can check what package the file belongs to by running:

As you can see, this file is needed so I will just remove the executable flag and try to restart […]

Read Me

How to disable all form elements without JS

Easy, just place all the elements you want to be disabled inside a <fieldset> like this:  

And that’s it!

Read Me

NTFS USB disk not recognized by Windows

I has a similar case descripben in this article: Disk data has been restored and a new ntfs  partition has been created using fdisk. But windows was unable to mount this drive even though it was readable by the system. This helped me solve this case: 1. cmd 2. Type diskpart. 3. Type

to see a list of disks. 4. Type

(where […]

Read Me

How to turn off annoying Firefox sounds in Ubuntu

Find out what sound is being played. In my case it was:

  playing when trying to send form data again via POST: You can either delete this file or rename it making it unavailable for Firefox, like this:


Read Me

Mysql error ‚Row size too large’

Error: „Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.”   Solution: Change your DB structure so that it fits in the InnoDb limits.   Quick fix: Add the following to the my.cnf file under [mysqld] section.

And then execute: ALTER TABLE mdl_lti ROW_FORMAT=Compressed;   […]

Read Me

Serious flaw in GIT

According to there’s a serious vulnerability in recent versions of GIT and it’s recommended to update it at least to version. Versions affected: : v2.7.6, v2.8.6, v2.9.5, v2.10.4, v2.11.3, v2.12.4 and v2.13.5. Version recommended for installing: v2.14.1 Unfortunately, Ubuntu 16.04 is far behind and offers only GIT 2.7.4… To update, you should use the official PPA:


Read Me

Monitoring disk IO

A great tool for monitoring disk read/writes: iotop

Output shows the exact process using the disk.

Read Me

Overriding nautilus as the default file manager

In Ubuntu nautilus is the default file manager even if you use TDE, KDE or any other desktop environment. From kcontrol:   Even if konqueror is at the top of the list, some applications will still open files and directories through nautilus. This is exceptionally annoying so I’m going to present a quick and effective method how to change that once and for all.  


Read Me

Sublime remote editing

One of the cool features of Sublime is its ability to work remotely on a project. Let’s assume we have our local project directory:

And a remote one:

Let’s open it with ‚File-Open Folder’ -> /project/abc. Next, we’ll need a commercial plugin ‚SFTP’. To install it:

type in „install package” And select „SFTP”. After installing additional sidebar menu should be available: The first […]

Read Me

SSH pubkey autologin

Instead of logging-in with:

edit or create file:

with the following contents:

From now on it’s possible to omit the -i switch.  

Read Me

Dependency injection container

Recently, for a project I’ve been working on, I had to choose a container bundle that will do the dirty job. The solution is not using any ‚framework’ , so to keep things simple, one of the obvious choice was Pimple: Although developed in sensiolabs (the same guys behind Symfony) I had a feeling it’s not really what I need… I started researching and trying it on […]

Read Me

Ubuntu install latest PHP7 version

Ubuntu has many outdated packages. That’s why people heavily use ‚external’ repositories. Latest version of PHP at the time of writing is 7.0 even though 7.1.2 has been released over a month ago. 7.1 has a couple of interesting features: To install this versin you will have to perform 4 steps: 1. Add repository The ppa:ondrej repo is recommended:

2. Install new PHP


Read Me

Login with ssh key

How to login to a remote host without knowing the password, but with private key? Having a private key located at the current directory:


Read Me

[Symfony] how to create own reusable bundle

1. Create new empty symfony project First, create new empty symfony project

This will create basic symfony project structure for you. 2. Create new bundle Auto-generate vanilla bundle with:

continue with the wizard and answer all the questions . This should also register your new bundle in the app. 3. Develop the bundle Add features to the bundle and commit all the changes. […]

Read Me

Detect fans in Skylake Z170 platform

By default, fans are not detected in most Z170 configurations. The solution is rather simple.

And then re-run sensors-detect. Many new nct6775 related sensors (fans, temperatures and voltages should be now available:   To make this module load after reboot, run:


Read Me

[Symfony] Register repository as service


Read Me

[Symfony] Query many-to-many relation

Given an Entity Class:

Let’s say you want to query for all the items watched by a user. In your Item Repository:

Repositories are handy but actually, you could also do it without one. Let’s extend Item Entity:

And add getter:

Thanks to this solution, all you need to do in the controller is:


Read Me

PHPUnit – how to check for exceptions

If you know your method will (or should) throw an exception under certain circumstances, you may want to write a test to assure it happens. One way is to use PHPUnit annotations:

And the other, the plain old assertion-like statement:


Read Me

How to sort Doctrine results with findAll()

Using findAll() it’s impossible to pass another orderby/sort parameter, because findAll definition looks like this:

Instead you can you findBy() which is more complex:

Look at the $orderBy parameter.   So now, when selecting all the records from a repository instead of:

just use:


Read Me

Symfony – how to add custom parameter to a service

Given a service with the following definition:

  if you want to pass through a additional parameter (for example a string), like this:

Change your service definition to:

  and then it will be available in the constructor, just like always.  

Read Me

Symfony3 – redirect to the previous location

I encountered the following problem: Given an action deleteAction in a controller I have to redirect to the previous location. Normally this information would be stored in the request headers as the referrer address. It’s tempting to write this:

but you’ll have to repeat yourself everytime you do a redirect. That’s why I decided to move this code to a service:

The requestStack gets injected by Symfony via […]

Read Me

Sharp sign in LaTex

# sign is reserved in LaTex so you have to always escape it: \# There’re acouple of methods to get C# symbol: Regular text: C\# Math environment: $ C\# $ My personal favourite: C\texttt{\#}   Here’s the result for all the versions:

Read Me

PHP script removing bidding products from CENEO

Simple php-cli script to remove bidding products from CENEO, using CENEO API. Script prepared for a Magento shop. Ceneo.xml is a products map that looks like this:

Here’s the script:


Read Me

Linux – how many RAM memory modules are installed?

Under Linux, how to check how many RAM modules are installed and what is maximum capacity? As a superuser run:

The output should look like this (for every module, available or not):


Read Me

How to completely disable google maps zooming

That’s how.

Read Me

Deploy Symfony3 na

Na razie w trakcie researchu. Lektura: x x x x x x

Read Me Kodowanie znaków MySql w Symfony3

Do poprawnego ustawienia połączenia do bazy MySQL na tym serwerze trzeba zrobić dwie rzeczy: W pliku app/config/config.yml


Po wszystkim trzeba jeszcze wyczyścić cache.

Read Me

Moving files to subdirectory within GIT

Given a GIT repository, how to move files to a new subdirectory? It’s a situation when you have your project inside /project and you want to move all the files to /project/subdir Simply dragging the files to a new subdir will not work because GIT will add the same files twice. All you have to do is:

Please note that mv * will NOT move […]

Read Me Leave comment

How to prohibit text copying in HTML

Or, in general, how to block the user from selecting a text on our site? Here’s the CSS:

Of course, some validation should also be done at the server side.

Read Me Leave comment


After playing a little bit with servers and databases in a project I noticed an error in Symfony logs: Failed opening required /var/cache/prod/doctrine/orm/Proxies/__CG__AppBundleEntityUser.php Solution is simple as long it’s a dev environment – delete all the session files!


Read Me Leave comment

XDebug could not open the remote debug file

In case your webserver logger reports a similiar error massage: XDebug could not open the remote debug file ‚/var/log/xdebug.log` I noticed that Xdebug log has to be writable for all users:


Read Me Leave comment