change background color in VS Code

You want to change the background color in VS Code.

In settings.json, add these lines:

    "workbench.colorCustomizations": {
        "editor.background": "#fcf5e3",
        "sideBar.background": "#f9edcd"


Categories: Uncategorized Tags: ,

instead of malloc+memset, use calloc

April 13, 2020 Leave a comment

Here is a nice blog post about calloc() vs malloc()+memset(): . Spoiler: they are not equivalent! calloc() uses some clever optimizations, thus instead of malloc+memset, use calloc. The blog post explains the details.

What eats up your disk space?

April 9, 2020 Leave a comment

If you are also always low with free disk space, then try the program ncdu. It’s like du (disk usage), but with a nice ncurses interface. It also checks hidden directories, and presents the result in descending order. Very useful!

Personal Security Tips

March 6, 2020 Leave a comment

See for a curated checklist of 100+ tips for protecting digital security and privacy.

Categories: network Tags: ,

Set up a VPN

March 6, 2020 Leave a comment

You want to use a VPN.

VPNBOOK provides free VPN accounts. In this YouTube video it is explained in detail how to set up a VPN connection under Ubuntu using VPNBOOK. I tried it under Manjaro too, the process is exactly the same.

The VPN connection worked well when I tried it and I could listen to Pandora Radio, which bans everyone outside of the US.

What Is My IP Address is a great tool to verify if VPN was activated or not. It will also tell you the location of the VPN endpoint.

If you are willing to pay for your VPN, Proton VPN can be a good choice.

Categories: network Tags: , , ,

[ C lang] reading a text file line by line

February 22, 2020 Leave a comment

I had a text file that I was reading line by line in C. Every line was tokenized. The file looked like this:

1978	Aachen Cathedral	DE	C	EUR	0	3
1978	City of Quito	EC	C	LAC	70	2
1978	Galápagos Islands	EC	N	LAC	14066514	1

I converted every year to an integer. From the 2nd line I got 1978 (as int), but in the first line the string to int conversion failed.

It turned out that the token “1978” in the first line was 7 characters long, not 4. At that point I opened the file in a hex editor and there were 3 special bytes at the beginning: EF BB BF. This is a byte order mark (BOM).


As a quick fix, I removed those 3 bytes in the hex editor.

I tried it under Python too and it caused a problem there too:

>>> f = open("input.txt")
>>> s = f.readline()
>>> s
'\ufeff1978\tAachen Cathedral\tDE\tC\tEUR\t0\t3\n'
>>> s.split()
['\ufeff1978', 'Aachen', 'Cathedral', 'DE', 'C', 'EUR', '0', '3']
>>> s.split()[0]
>>> int(s.split()[0])
Traceback (most recent call last):
  File "", line 1, in
ValueError: invalid literal for int() with base 10: '\ufeff1978'

If you know how to ignore those bytes during file read, please leave a comment. I’m interested in both C and Python solutions.

[windows 10] Display accented characters correctly in the terminal

February 22, 2020 Leave a comment

Under Windows 10, in the terminal (cmd), accented characters are not displayed correctly. How to solve this problem?

In Windows 10 (build 1809) go to the system’s Language settings, select Administrative language settings, click on Change system locale… and check the Beta: Use Unicode UTF-8 for worldwide language support box and then restart Windows.

(In Hungarian Windows: Gépház, Idő és nyelv, Nyelv, Felügyeleti nyelvi beállítások (jobb oldalt), Területi beállítások módosítása…, Béta: … bekapcsolása).

Categories: windows 10 Tags: , , ,

Use Your SSH Server as a Proxy

February 14, 2020 Leave a comment

See . The section entitled “Dynamic Port Forwarding: Use Your SSH Server as a Proxy” did the trick for me.

Categories: network Tags: ,

How to sync my Visual Studio Code settings using Dropbox?

February 13, 2020 Leave a comment

You set up your VS Code, spend half a day with your settings / extensions / snippets, and you want to use the same settings across all your machines (including Linux and Windows boxes too). How to do it?

First, let’s see where your settings are located.


Location of your settings: ~/.config/Code/User . The important entries are:

  • settings.json
  • keybindings.json
  • snippets/ (directory)

Location of your extensions: ~/.vscode/extensions .


Location of your settings: C:\Users\username\AppData\Roaming\Code\User (on Windows 10). The important entries are the same:

  • settings.json
  • keybindings.json
  • snippets/ (directory)

Location of your extensions: C:\Users\username\.vscode\extensions (on Windows 10).


To share your settings, create a folder in your Dropbox folder and move there the files settings.json, keybindings.json, and the folder snippets/ .

Then go to your local User folder and put symbolic links on the three entries that you just put in Dropbox.

Don’t store the extensions in Dropbox! Sometimes they install binary files that are different under Windows and Linux. Simply install the extensions locally on all your machines.

To get a list of your extensions, run the command “code --list-extensions” in the terminal.

How to create symbolic links under Windows?
Open a terminal window in administrator mode. Then,

# symbolic link on a file:
mklink Link Target

# symbolic link on a directory:
mklink /d Link Target

How to sync my Sublime Text 3 settings using Dropbox?

February 11, 2020 Leave a comment

You re-install a Linux machine and you want to use your Sublime Text 3 editor settings on this machine too. How to sync your complicated settings?

The answer is here: link.

To properly sync your installed packages across different machines, you actually do not want to sync the whole Packages/ and Installed Packages/ folders. The reason for this is that some packages have different versions for different operating systems. By syncing the actual package contents across operating systems, you will possibly run into broken packages.

To sync the folder, you generally move Packages/User/ into your Dropbox and create a symlink to it from Sublime Text 3/Packages/.
” (source)