3. Feb 2021 |

Kuidas saab miski olla nii odav (VPS)

Selleks, et mul oleks hajussüsteemide aines oma dev andmebaas… OK, alustame sellest, et mul ei olnud esialgu ettekujutust, et mis on Docker ja kuidas VPSi kasutamine käib. Võtsin mõne päeva sellest nädalast, mis eksamite ja uue semestri vahele jäi ning natuke uurisin.

Nüüd ma olen seal kohas, et mul on Hetzneris see kõige odavam VPS (1 vCPU, 2 GB RAM, Helsinki), kus jookseb tavaline Ubuntu Server, kuhu olen installinud Dockeri ja selles jookseb MS SQL server. Seni identne selle barreli omaga, mis Käveril. Ma ei ole selle eest mitte midagi maksnud, sest lihtne Google otsing andis 24 eurose kupongi veebruari lõpuni 🙂 Aga, see maksaks muidu 2.96 eurot (koos maksudega!). Nagu, misasi see on!? Kuidas see saab nii odav olla 😀

Kui Hetzneri kupongi poleks leidnud, siis ilmselt oleks õppimiseks kasutanud siit artikli lõpust UpCloudi või DigitalOceani kupongi.

26. Jan 2021 |

100 Days of Code (in second post)

Made second post. Grouping by 25 days should be good.

  1. (25.01) 3h 48min. I see that I have spent 19 mins of Docker (though I belive I spent more time on it to learn using MariaDB and phpmyadmin in Linux VM) and the rest is C#.
  2. 4h 38min. C# (database connection etc), Distributed Systems (DS) intro.
    School has begun and my Gitlab grid looks more impressive that ever before. It looks like it should have looked last semester (though I belive my Bitbucket dashboard would have looked good too if only would they have it).
  3. (27.01) 2:50 JS, 0:48 JS.
  4. (28.01) 48 mins of JS, 2h 25 mins of Distributed Systems. Had two lectures to attend.
  5. (29.01) Friday. Had 6h of lectures to attend (DS and JS). 4:01.
  6. (30.01) For .NET things moved over to Win10. Got really tired of solving Linux issues that only I happen to have.
    2h 52 mins of tracked C#, Razor Pages. The rest spend on setting up WSL2 on Win10, updating and setting up everything on Win10 side. So far it has been 22 h 38 mins of coding this week.
  7. (31.01) 4h 6 mins of DS and JS. Sunday. It got me 27 hours of coding this week + few hours of setting up/debugging environment, server etc. Looks like a good week. My Gitlab grid looks like this 🙂 You can also compare it to previous semester.

    Don’t get me wrong. I used Github (for my own stuff) and Bitbucket (for 2 subjects at school). But my school Gitlab account could have been more active too.
  8.  (01.02) New month. 4h 19mins of coding. DS and JS. Started with small Aurelia “Hello world” project and installing it. I really don’t like the name Aurelia and their color scheme is straight from TalTech brand 😀 React, Vue and Angular are much better names. Spent once again so much time setting things up on my computer. Tried to undestand why docker-composer was in snap folder (no documentation mentions such option), why same repo in WSL terminal git has different status than in Windows Terminal etc. But at the moment everything seems to sort of work.
  9. 4h 46min, 2:54 JS, 1:41 DS
  10. 4h 4min Distributed Systems
  11. – will write later ( travelled to Tartu)
  12. (05.02) 3h 12mins heavy C# friday. Working on my own project. Really like this inheritance and interface game.
  13. (06.02) Built my own API on top of Noom API. Looking forward to next week whey I will probably get access to the new API we ordered from them and can get more data for my stores.

 

Other stuff

15. Jan 2021 |

n/100 – 100 Days of Code (in one post)

Writing daily posts is getting challenge on its own. Therefore I will continue as one post.

  1. (13.01) Started to revise C# lectures with an aim to finalize .NET app. Starting from console menu task to fully understand everything.
    Also downloaded Heino Talvik’s “Containers and Microservices” from Echo360 and Moodle so that I could study it on my own (before it gets back into program in autumn).
  2. (14.01) Got stuck into refactoring this app from mysqli to pdo and bring duplication check from db level to memory.
  3. (15.01) In the morning I continued work with blog-aggregator project to get it from mysqli to pdo and front-controller model using Twig. Also update to the latest Bootstrap.
    Most of the day learnt how to use VPS for the first time (by using Hetzner‘s 24 euros offer I found here). Managed to set up my first MariaDB server as Docker instance and access it from phpStorm. It must be the cheapest entertainment because I still have €23.97 remaining credits 😀
  4. According to Goodtime and Toggl I did C# for 2 hours. Trying to understand Delegates.
  5. 1h 15mins of C#. Way too little (3 rounds of Pomodoro).
  6. 1h 20min of C#. Still trying to understand every character I am writing.
  7. (19.01) 1h of C#.
  8. (20.01) The day of Joe Biden’s inauguration 🙂 4h 25min C#. Trying to get out of the Menu but I don’t get it where I make mistake. I will ask the teacher tomorrow. I got it solved before going to bed. The issue was that return is used only when exiting. And I had to assign the value to the variable that was returned. Looked littlebit recursion-like thing for me.
  9. 2h 16min of C#. Got my TicTacToe to run in memory and update the board. Tomorrow I would like get to the end of this lesson.
  10. 1h 55min of C#. I also finalized my Youtube channel containing all 44 videos from Building Distributed Systems (2020, ICD0009). I downloaded 18GB of files from Echo360, glued audio and video together and uploaded 17GB of video to Youtube.
  11. (23.01) 2h 8 min of  C# + 25 min of JavaScript.
  12. (24.01) 1h 59 min of C#. Getting to the point where I sort of understand the 2 first homeworks of previous semester’s C# it has taken me (to this point) one week with 18h 20min of work (tracking with Focusmeter app and then adding to my Toggl account).
    My teacher said in the lecture that he has coded estimated around 40-50k hours in his life. He also said that there is no talent in coding. 99% of the result is practice (hours put into writing the code).

In progress.

Continue reading “n/100 – 100 Days of Code (in one post)”

13. Jan 2021 |

Koolis käimine ja keskkond

Selle artikli mõjul tekkis mõte vaadata, missugune on olnud umbes 10 aasta jooksul muutus keskkonnajäljes, mida õpingud tekitavad.

Tartu Ülikoolis (2007-2012) käies oli tunne, et ülikool on üks suur PowerPoint, kuna see oli peamine õppematerjali formaat. Väljaprinditud slaidid käsikirjaliste märkmete ja kommentaaridega. Lisaks õpikud. Nendega sahistasin efektiivselt TÜ raamatukogus. Ühtegi energiatarbijat ei olnud. Arvutiga töötamine toimus kodus suure arvutiga ja seisnes peamiselt konspekti trükkimises.

Sülearvutit ei olnud mitte kellelgi. Alles 5. kursusel ilmusid esimesed sülearvutid (1-2, mitte rohkem) auditooriumisse. Ka nutitelefone ei olnud kellelgi (enda esimese sain 5. kursusel – Sony Xperia Neo). Seega tähelepanu hajumisega oli muret palju vähem kui praegu. Alguses ei olnud Facebooki ka 🙂

Koolis käisin kõik 5 aastat jalgrattaga – 3 km kooli ja sama palju tagasi. Ainult kõige suurema lumega, kui üldse sõita ei saanud, käisin bussiga aga need olid mõned üksikud korrad.

Loeksin selle koolis käimise keskkonnajälje väga minimaalseks.

EBSis (2016-2019) käies tekitasin tõenäoliselt kõige suurema jalajälje autoga (Subary Legacy, nelivedu, 110kW, 1994 cm3). Nimelt, kuna kool algas kell 18 (kui õigesti mäletan) ja kool asus Tallinna südalinnas, siis pidin kuni 4x nädalas sukelduma tipptunni-liiklusesse 🙂 Kusjuures, teepikkus kontorist kooli oli samuti 3 km nagu TÜ aegadel.

Suurt slaidide printimist ei mäleta aga midagi ilmselt sai trükitud. Osades ainetes oli oluline käsikirjaline konspekt (nt mikroökonoomika), sülearvutis konspekteerimist oli küll. Kui autot mitte arvestada, siis keskkonnajälg TÜga üsna sarnane.

TalTechis on kogu õppe keskkonnajälg varasemaga maksimaalne. Ilma arvutita inimest auditooriumis naljalt ei ole. Paljud loengud on videona ka olemas (mis on väga tore) ja videost on kujunenud peamine õppematerjal, mis omakorda on küllalt ajakulukas formaat. Konspekt või õpik* oleks ehk palju kiiremini tarbitav 🙂 Aga kuna Echo360 keskkond on ebamugav vaadata, siis olen kõik videod endale omakorda Youtube’i ümber tõstnud. See tähendab, et andmeid on nüüd veel mitu korda rohkem, mida serverid peavad hoidma ja serveerima. Kui kõik tundengid sama teevad, siis tuleb sellest päris õudus kokku.

Ma olen gigabaitide viisi videosid striiminud, alla laadinud, kokku liiminud, üles laadinud ja uuesti striiminud. Ma arvan, et see keskkonnajälg on üsna suur 😀 Sorry.

12. Jan 2021 |

IADB IT-süsteemide arendus – 3. semestri lõpp

Täna (11.01.2021) oli  mul selle semestri viimane eksam. Üldine tunne on selline nagu semester oleks olnud ainult rongiõnnetus aga kui lähemalt vaadata, siis ei olnud midagi hullu.

Tehtud sai kolm kohustuslikku ainet. Ühes kohustuslikus aines ebaõnnestusin ja lisaks tegin ühe kohustusliku aine VÕTAga. Seega selle semestri tulemuseks on 18 EAP + 6 EAP VÕTAga = 24 EAP. Loodetavasti ei pea ainepunktide eest veel maksma hakkama 🙂

Koguarvestuses 78/108 EAP kohustuslikest ainetest on praeguseks tehtud.

Continue reading “IADB IT-süsteemide arendus – 3. semestri lõpp”

11. Jan 2021 |

13/100 – exam and parsing XML with php

It took me around an hour to write the algorithm in Java during the exam to find the width of a tree (defined as the maximum number of children for a single node).

Now I have been wondering (trying to improve my code) why on earth are podcast and blog feeds NOT json standard but XML 😀 Much more difficult to generate and parse.

10. Jan 2021 |

11-12/100

Writing daily blog down has gotten a bit difficult. I have been finalizing the beta version of birthday app and written some Java while learning for algorithms exam (tomorrow).

After that I believe I will spend most of my days writing C# and JS till summer. And before spring semester I feel I need to fix few things in this Estonian blogs project also.

Very much liked this a16z episode named “Baumol’s Cost Disease, in Healthcare… and Where We Go Next”

8. Jan 2021 |

10/100 – java, php

Wrote littlebit in Java for algorithms exam (on monday) and improved birthay app. Bootstrap 5 has some really nice improvements.

I have been thinking about setting up by own web server to understand (and learn) better how VPS and containers work. I belive I need to do another post for this 🙂

Cool that Thonny made it to Hacker News.

7. Jan 2021 |

9/100 – cleaning wp mysql database

Today I have to admit I did not open IDE somehow for more than just one line of code 😀 Got stuck into analyzing the logs and cleaning one of my website’s database.

More than 1.3M wp_actionscheduler_actions entries created in just 7 days.

All in One SEO plugin (do not recommend!) created around 3 million garbage entries into the WP+WooCommerce database with scheduled actions (mainly by aioseo_sitemap_ping). It is multiple times more than the whole site itself.

For example:

  • wp_actionscheduler_logs table had 1 973 366 entries
  • wp_actionscheduler_actions table had 912 058 entries

I emphasize that these entries are just unwanted garbage and do not create any value. In order to clear it you need to enter the database (through PMA or some other way) and run DELETE FROM table WHERE ...; SQL query. I can assure that deleting millions of entries takes some time from database engine 🙂

The only line I wrote today (except SQL queries) was add_filter( 'aioseo_sitemap_ping', '__return_false' ); to kill the unnecessary scheduled action.

6. Jan 2021 |

8/100 – composer, twig

Recommend:

Issues with guides. When installing twig then phpStorm cried that I have old version of composer. OK, sudo apt-get remove composer (because suggested composer self-update does not work) and sudo apt-get composer and the result is that I still have old one 😂 Then I followed the composer installation guide and when trying to make it global it gives me wrong path in the guide. Correct one would be /usr/bin/composer and debugging it took me quite a while.

As you can see I have been messing around with the birthday reminder app.

Listened: Matt Mullenweg: Collaboration Is Key – the founder of WordPress on Knowledge Project podcast

Discovered: “Officials are investigating whether the company, founded by three Russian engineers in the Czech Republic with research labs in Russia…” is a way to describe JetBrains in The New York Times.