Best Linux distribution for MySql database

I’ve been researching the web for this topic for a couple of hours and came to a conclusion that savvy programmers prefer CentOS for running their MySql and other databases. Here’s an interesting poll. Yes, it’s dated but still, all the fresh info I found on this topic tend to stick with the same choice. … Read more

Command to show information about my linux distribution

The quickest way to find out is to type: cat /etc/*-release in my case the result is: CentOS Linux release 8.3.2011 NAME=”CentOS Linux” VERSION=”8″ ID=”centos” ID_LIKE=”rhel fedora” VERSION_ID=”8″ PLATFORM_ID=”platform:el8″ PRETTY_NAME=”CentOS Linux 8″ ANSI_COLOR=”0;31″ CPE_NAME=”cpe:/o:centos:centos:8″ HOME_URL=”https://centos.org/” BUG_REPORT_URL=”https://bugs.centos.org/” CENTOS_MANTISBT_PROJECT=”CentOS-8″ CENTOS_MANTISBT_PROJECT_VERSION=”8″ CentOS Linux release 8.3.2011 CentOS Linux release 8.3.2011 If you are interested what command cat /etc/*-release means … Read more

Remove a list of unwanted items from another list with list comprehension

I love list comprehensions. I really do. And it’s time for list comprehensions! If you need to withhold all items from a list1 that are present in list2 – nothing else works better! There we go, beautiful & clean code: list1 = [‘banana’, ‘orange’, ‘apple’, ‘apple’, ‘lemon’, ‘strawberry’, ‘pineapple’, ‘melon’, ‘melon’, ‘peach’, ‘pear’] list2 = … Read more

Save Pandas Dataframe to .csv file

Best way is to use Panda’s to_csv() built-in function df.to_csv(‘filename’, index=False) Don’t forget to pass index=False as a second parameter if you don’t want index row saved as a column (in other words use it if you don’t want duplicated index when opening the file again). By the way, you can also withhold column names … Read more

Read and write files with ‘with’ statement in Python

I always keep forgetting how exactly with statement works with opening and reading the files in Python. path = ‘./path/filename.txt’ with open(path,’r’) as file: data = file.readlines() print(data) Or if you would like to avoid getting ‘\n’ after each line when using .readlines() you can use this instead: data = file.read().splitlines() Opening files with ‘with’ … Read more

Windows 10 license types – Everything you need to know

Microsoft offers a number of different software license types, with varying degrees of flexibility and versatility. It can be hard to keep track of all the different options available to you, which is why we’ve compiled this list of Windows license types — the differences between each one, and what you should use in your … Read more

How to iterate through dictionary in Python

First you might think in order to print dictionary values it’s enough to: for i in dict: print(i) But No. This way it’ll only print the keys. In order to print values next to the dictionary keys use: for key in dict: print(key, ‘-‘, dict[key])