Solving tech problems

Carl Friedrich Gauss – the real genius

Thoughts

When the teacher asked his 7-years old pupils (among them was also Carl Friedrich Gauss, mathematical genius) what is the sum of all numbers from 1 to 100, he was astonished that Gauss gave him the answer only after three seconds. The sum is 5050, he said almost instantly. He came to this extremely quickly noticing that we have 50 pairs of numbers which give the sum of 101: 100 + 1 = 101 99 + 2 = 101 98 + 3 = 101 … 51 + 50 = 101…read more

Hot to check if your Linux server is vulnerable regarding the BASH bug?

System Administration

Just type this command in your SSH shell $ env x='() { :;}; echo vulnerable’ bash -c ‘echo hello’ If you got this output then you are safe: bash: warning: x: ignoring function definition attempt bash: error importing function definition for `x’ hello If you got this output then you are vulnerable and need to update: vulnerable Here is the tutorial how to do it: https://brew.sh/

How to delete duplicated records in MS SQL Server?

Databases, Programming

First, create one demo table Let’s create one demo table first. It will be called Person and will hold some fictive person data. Now, fill the data Insert some fictive person data and do some duplicated records that have the same values for fieldsĀ  firstname, lastname and email. Now the magic Use this subquery trick to extract duplicate records and then delete them. Notice the use of PARTITTION and WITH Transact-SQL keywords. All records that have RowNumber > 1 are deleted.

You will never reach the perfection

Thoughts

These are the chosen quotes dedicated to “Perfection” – you will never reach it and your life will pass beside you. There also interesting quotes for people who are afraid to make mistakes and some clever thoughts for hard workers (better work clever then work hard). Have no fear of perfection – you’ll never reach it. Strive for excellence, not perfection. If you can’t do what you want, do what you can. Good enough is good enough. The risk of a wrong decision is preferable to the terror of indecision….read more

Using SQL Server APPLY command in queries

Databases

APPLY clause in Transact-SQL is interesting because it can be user in the following scenario: For example, you might create a query that returns a list of payments (in this case last 2 payment amounts and dates) for each subscriber inside your SaaS product. You get something like this 958 Usain Jordan 2014-06-01 299.00 958 Usain Jordan 2014-07-18 458.00 110 Seagal KungFu 2014-01-12 15.16 110 Seagal KungFu 2014-03-06 17.45

Wimbledon final and soft drink ads

Leisure and Pleasure, Thoughts

Watching right now Wimbledon men’s final between Novak Djokovic and Roger Federer (btw, hoping that Djokovic will win it). Almost every ad between games and sets are from producers of soft drinks (Nestea, Coca-Cola, Schweppes) and energy drinks (unknown RedBull competition). They are promising fun, health life, enjoyment and similar crap. If I can give you some advice in this area I can tell you just don’t buy anything like this. Think logically… If they have so much money to spend on advertisement in prime time of biggest sport events…read more

Problems with Map Network Drive in Windows Server 2008R2

System Administration

To list all network shares use this command from Command Prompt: net use To delete specific network share net use /delete \\SERVER_IP\YOUR_SHARE If you map “\\SERVER_IP\SHARE1” as drive letter X using “user1” and “password1”, then try to map “\\SERVER_IP\SHARE2” (a different share) as drive letter Y using the same “user1” and “password1”, and you click the “connect using different credentials” checkbox in the Map Network Drive dialog box and specify “user1” and “password1”, you will get this INCORRECT ERROR MESSAGE that says “The network folder specified is currently mapped using…read more

Stop automatic rebooting of Windows 7 after Windows Update

System Administration

If you want your PC with Windows 7 operating system to work as server then you definitely want to stop automatic rebooting after Windows Update install new patches. To do this you need to do the following: Open the Registry Edit (WindowsKey + R, “regedit.exe“) (Remember to be careful! DON’T change anything unless you know exactly what you’re doing!) Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU Chances are that you’ll be missing these keys. If keys WindowsUpdate\AU exist, go ahead to step 3 OTHERWISE, continue through these indented steps… Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows (Make sure…read more