pretty print a C# source code

March 29, 2018 Leave a comment

I wanted to print the page at, but the produced PDF was black and white, i.e. the syntax highlighting was lost. How to print a source code with colors?

I tried several browsers, several editors, but nothing worked. Then I found a LaTeX solution. The necessary files and the produced PDF output are here:

I put here the LaTeX source:

%% Define your header here.
%% See
\fancyhead[CO,CE]{C\# Summary}

\usepackage[usenames,dvipsnames]{color}  %% Allow color names

%% The listings package will format your source code
  breaklines=true, %% Wrap long lines



The LaTeX tip is from here.

Categories: csharp, latex Tags:

[steam] get a game for a cheaper price

March 25, 2018 4 comments

You want to buy a game on Steam for a cheaper price. There are sales on Steam but you don’t want to check it every day.

There is a very simple way to get notified when the desired game becomes cheaper. Log in to Steam and add the game to your wishlist. I thought that the wishlist was just a simple list and never clicked on it but it’s more than that! When a game on your wishlist becomes cheaper, you get an e-mail notification. It’s that simple.

I wanted to build a web app. for this purpose :) Then I talked about it with a friend and he told me that the Steam wishlist can do that…

Categories: games Tags: ,

Xbox 360 controller not detected

March 16, 2018 Leave a comment

I have a wired Xbox 360 controller that stopped working. Windows 7 doesn’t recognise it and it appears as an “unknown device”.

I tried everything: uninstall and reinstall the driver; reinstall the USB drivers that I got on a DVD for the motherboard; plug it in another USB slot. Nothing. After 1.5 hours, I found the solution: the cord has an inline release and it was not entirely connected… Damn. But the good news is that it works again :)

Lesson learned: if you have a problem with the controller, first check the inline release.


Steam API

March 12, 2018 Leave a comment

Let’s take this game: Fallout: New Vegas. How to get data about it using the Steam API?


Unfortunately it doesn’t contain the overall review of the game (“very positive”, “overwhelmingly positive”, etc.).


Categories: games Tags: ,

[mongodb] invalid GPG signatures

February 8, 2018 Leave a comment

I have an Ubuntu 14.04 LTS box with MongoDB. When I tried to update the packages, I got a similar error:

W: GPG error: trusty/mongodb-org/3.2 Release: The following signatures were invalid: BADSIG D68FA50FEA312927 MongoDB 3.2 Release Signing Key 
WARNING: The following packages cannot be authenticated!
mongodb-org-shell mongodb-org-server mongodb-org-mongos mongodb-org-tools mongodb-org E: There are problems and -y was used without --force-yes


sudo apt-key list | \
 grep "expired: " | \
 sed -ne 's|pub .*/\([^ ]*\) .*|\1|gp' | \
 xargs -n1 sudo apt-key adv --keyserver hkp:// --recv-keys

Full explanation of this is here. In a nutshell: update expired keys from Ubuntu key server.

[manjaro] installation fails, unknown public key

January 17, 2018 Leave a comment

I couldn’t update a package due to the following error:

==> Validating source files with sha256sums...
    gcc-7.2.1-20171224.tar.xz ... Passed
    gcc-7.2.1-20171224.tar.xz.sig ... Skipped
    isl-0.18.tar.bz2 ... Passed
==> Verifying source file signatures with gpg...
    gcc-7.2.1-20171224.tar.xz ... FAILED (unknown public key BBE43771487328A9)
==> ERROR: One or more PGP signatures could not be verified!
==> ERROR: Makepkg was unable to build mingw-w64-gcc.
==> Restart building mingw-w64-gcc ? [y/N]
==> --------------------------------------
==> ==> ERROR: unable to update

I asked this on reddit and /u/SuperGrip kindly provided the solution:

This is a common issue when an apps key is not included in the ArchLinux Keyring, to solve this issue you can add the key manually by running the following command: gpg --recv BBE43771487328A9

For further information check the package comments on the AUR site.

Categories: manjaro Tags: , , , ,

DigitalOcean has new droplet plans

January 17, 2018 Leave a comment

DigitalOcean has some new droplet plans (more info here). The cheapest droplet was 5 USD, and you got 512 MB RAM and 20 GB SSD for this price. Now, for the same price you get 1 GB RAM and 25 GB SSD.

If you have a standard droplet, you can upgrade it for free. I did it today and it was just one click :) Of course, I made a snapshot first, but the upgrade went smoothly, so after some testing I removed the snapshot.

If you want to try DigitalOcean, here is my referral link: If you sign up through this link, you also support me :)


Categories: linux Tags: ,