Fixing Gnome Boot problem

I recently had an issue with Gnome on Arch Linux during the system boot. After turning my computer on, I saw gray screen with message like: Oh no! Something has gone wrong. A problem has occurred and the system can't recover... and I couldn’t log in or do anything and started searching solutions for this problem via my phone. First, I switched to terminal mode with Alt+F2 (you can switch back to GUI with Alt+F1), logged in and updated system via pacman: sudo pacman -Syu. I tried to install or reinstall different packages mostly related to graphic card drivers, X11 or Gnome, but it didn’t help. Luckily, I found this thread on the Arch Forums, where there was a post suggesting disabling Wayland on GDM by opening /etc/gdm/custom.conf file and uncommenting line with ...

October 22, 2019 · 2 min · 217 words · Piotr Wittchen

Cleaning root partition on Linux

Size of the root partition / on my system is 25 GB. I recently had a situation where I received notification from the system that there’s too little free space on that partition, which was around 1 GB. My first attempt was to clean pacman cache with sudo pacman -Sc. It helped for a moment, but I kept receiving this notification. I searched for the solutions regarding extending the root partition and noticed that it wouldn’t be that easy and probably require making backup and reinstalling the system. Although installing Arch is not scary for me anymore, I didn’t want to do that again, because it takes some time and after that I will have to configure all my stuff, install apps, etc. which is a lot of work. Due to this fact I started search for the solutions about cleaning root partition. I found nice program called ncdu, which is abbreviation for NCurses Disk Usage according to the man page. You can install it with pacman: sudo pacman -S ncdu. This program shows usage of the directories and shows directories, which take the biggest amount of space on the disk. Once you have that program, you can go to the root partition and run it: ...

October 17, 2019 · 3 min · 550 words · Piotr Wittchen

Formatting USB disk on Linux

Sometimes we may want to format external USB drive. I recently encountered a situation, where I had bootable USB drive with operating system ready to install, but I wanted to remove all this stuff and use disk for storing data. I couldn’t format this disk with GUI tools for some reason and I kept getting errors or information that it’s not possible. In case you don’t know, on Linux everything is always possible, so I quit that GUI tool, opened terminal and start playing with good old and simple programs. ...

September 1, 2019 · 3 min · 594 words · Piotr Wittchen

Modifying mehtod's input parameters

During maintenance of the legacy projects, I sometimes see constructions like: void appendFooter(Report report); or void populate(Data data); I even saw something like this: void populate(Source source, Target target); What is wrong with these statements? They’re using so called output argument. In the examples above, we’re passing a report or data variable, which usually are going to be global variables available in the scope of the whole class. These methods takes them as an argument and modify them. This idea comes from pre-OOP times and could be applied in programs written in C. Nevertheless, in Java, this technique should be avoided and is considered as a bad practice. ...

August 5, 2019 · 2 min · 354 words · Piotr Wittchen

Get rid of the list null-checks

During development of the legacy Java applications, we still have to deal with null. It’s possible to avoid it completly when we’re designing application from the scratch, applying proper code constructions, static code analysis and we’re consistent during code reviews. Nevertheless in majority of the cases we will encounter null in daily projects. We may even expect them in the method inputs and we have to be prepared for it. With the functional programming in Java we can deal with them in quite elegant way, but I often see people are not using features available nowadays. ...

July 28, 2019 · 2 min · 355 words · Piotr Wittchen