Skip to main content

18 posts tagged with "English"

English

View All Tags

Deployment: linux server, nginx, SSL, docker, react

· 6 min read

This post explains how to deploy basic react website using:

  • AWS EC2 ubuntu server
  • nginx
  • docker
  • certbot (let's encrypt)
  • react

Later gonna have some YouTube videos (possibly).

Intro

Ok. So you learned to make html files. So called "websites". But, sadly, your grandma can't open C:/Users/Carl/Descktop/website.html from her computer. So how do you make your website "public"?

Of course, you can use Wordpress, Wix or some other platform that's gonna make your matters easier, if you just want to have a website. But this post is not about that. We want to have full control on our website and understand how things actually work under the hood.

For total beginners

What is the Internet? That's nothing more than just a bunch of computers connected together with some wires. Those wires send electricity impluses in a certain pattern and this way send data. And then there is an international standard consensus on what that data would mean. So some computer can get a message "hey, give me what you got on port 80" and then decide to give back an html file. So if you make your website public - this just means that you make a certain computer with html file accessible to the whole world.

We use term "deploy", which basically means "making accessible on the Internet".

Also, obviously, we're gonna use CLI/shell/console (command prompt on windows, terminal on linux, idk what on macOS). So all the commands gonna be run on that. Commands are in tool command format in the posts, so just paste it to shell.

Overview

Tutorial will have 3 parts:

  1. Basic react website deploy with firebase
  2. Basic html file deploy on linux server
  3. Joining all together - react website deployed on linux server

Part 1. Basic react website deploy with firebase

In this part, our aim is to have a hello world website set up like a normal website and ready to be coded. Optional part (but highly recommended) - setting up git.

alt text

1. Prerequisites

install nodejs with npm, have Google account, install git and have GitHub account (optional).

2. Create a React project and run it locally

(Optional) Create a repository on GitHub. Clone it using git clone https://github.com/you-username/project-name (you gonna need to generate a classic PAT to use as a password for GitHub locally).

npm create vite@latest project-name --template react-ts

(Optional) Move all the created files in project-name folder to the cloned GitHub repository folder.

Navigate to the folder (cd project-name).

npm run dev

Open http://localhost:5173 on your browser. You can edit src/App.tsx file to change how the website looks.

npm install firebase-tools

npm run build, firebase login, firebase init (for this choose firebase hosting, /dist for public folder, don't replace index.html and you can optionally setup github actions, then it will do all this stuff automatically, when pushed to GitHub), firebase deploy.

That is it, you have your website. Console will look sth like this:

alt text

If that's the case, congrats, you have your website with the provided Hosting URL.

(Optional) git add . and git commit -m "Initial commit" and git push origin main.

Now you can make that URL more beautiful, but, of course, for that you will need to pay (amount depending on the charmingness of the URL). You can buy a domain on any DNS provider (I use Hostinger). Then go to console.firebase.google.com to your project, to the hosting hashboard and add your custom domain and then follow the given instructions (change DNS records on your DNS provider, where you bought a domain).

alt text

alt text

alt text

Done. Now you can change the code (/src/App.tsx file and add others) and then run npm run build and firebase deploy to update the website (or if you have set up GitHub Actions, then it's probably enough to push to GitHub repo and it will automatically update the deployment).

Part 2. Basic html file deploy on linux server

... ot be continued

Server options

It can be:

  1. University server/user. For example, MIF in Vilnius University gives all students a login to the university network. But it has limitations...
  2. Linode. You can get pretty cheap (5 dollars a month, but billed hourly) experimental linux servers there. And it can be set up pretty easily.
  3. Google Cloud. Idk for sure, never used. Only for firebase, which is free, but you cannot host backend.
  4. AWS. This is the most popular solution. It has a lot of deployment solutions, some are free, some are cheap, some are expensive. But it's also very overcomplicated, you need to actually learn to use it. And if you are not careful, you can get a very unexpected bill at the end of the month...
  5. You can just use your own computer. For that, of course, you gonna need to have an internet plan from a provider. And have a router. Then you could read the small print on that router and login to the admin account to do the port forwarding. On that later, maybe.

We're gonna use AWS EC2.

AWS

...

Nginx

On server run command sudo apt install nginx and then sudo systemctl start nginx, check the running status with sudo systemctl status nginx and stop service with, you guessed it, sudo systemctl stop nginx.

That's it. Type your server ip address to the browser and you should see "Welcom to nginx" message. Like this:

alt text

That's it. Here you go, you have a website.

But you'd probably would want to:

  1. edit the content of this website,
  2. have the little lock next to ip without red line (make https instead of http),
  3. have a name for website (domain).

Edit content

/var/www/html/index.nginx-debian.html - edit this file content (you can do so with nano tool).

/etc/nginx - here you can find other content for configuring nginx.

Setup SSL and domain

This will make requests/responses encrypted and safe. Basic option - using letsencrypt with certbot. But this is only needed for your own website doing everything from zero (later tutorial).

For now we can just use CloudFlare. It automatically provides SSL, when using a domain.

QuHack 2025 hackaton

· 5 min read

Since I am writing my bachelor thesis on quantum computing, and my friend recommended, I participated in QuHack 2025 hackaton (organized by MIT), remotely.

Quantum computing hackaton is not like a regular hackaton - extensive keyboard scrabbling, drawing graphs, brainstorming ideas, making some real world used product... I think it's obvious why - there is not much made in quantum computing field at all. So it was more like an olympiad - solving some given problems, finding the best, most optimal solution.

Program

Everything was streamed online from MIT, for the remote participants. Before the beginning of hackaton, there was a lot of material given to prepare, to learn the basics of quantum computing. There was an opening ceremony, scientists from physics, mathematics and computer science fields introduced the idea of quantum computing, discussed the current situation in the world and gave some opinions on popular topics (such as interpretation of quantum mechanics). The basic idea was - just go to a lab and see how lasers interact yourself. Or just don't understands, because you are not "built" for this. And just do the math.

And yes, quantum computing is in relatively early state of development (theory is discovered before it is possible to check it practically). And has many applications.

After the opening ceremony there were the workshops,

Challanges

There were 19 sponsors (mainly IONQ, Quantum rings, Classiq, DoraHacks). Challanges were given by them, the main ones. Our team (made from random not very experienced global students) chosen the challanges given by IONQ.

We were given max-cut problem basic solution. Max-cut problem looks for "slicing" thourgh the edges in the given graph, so that it goes through the biggest number of edges, separating graph into two. The given solution was a VQA (variational quantum algorithm) with a basic ansatz: qubits for nodes, all qubits superposed with HH gates, for each edge corresponding qubits were connected with CNOTCNOT Ry(θ)R_y(\theta) CNOTCNOT. But for the optimisation part there was something unusual. It wasn't a classical optimisation algorithm that was used to update the parameters in circuit. It was also a quantum algorithm. There was given a basic hamiltonian, for which the ground state energy was being found using varQITE (variational quantum imaginary time evolution) algorithm (varQITE paper). There were also a bunch of graphs given, to test the algorithm. Everything was in qiskit, there were a lot of concise and clear explanations on the problem. We had to modify the ansatz generation and the hamiltonian generation functions to solve these challanges:

  1. Find a better ansatz, using less gates, maintaining accuracy (high quality), converging faster.
  2. Change the ansatz and hamiltonian so that after the max-cut obtained subgraphs are ballanced (have the same amount of verteces).
  3. Change the ansatz and hamiltonian so that after the max-cut obtained subgraphs would have to be connected (in each, all verteces would have edges to them).

What our team achieved? Sadly, nothing. But we did understand the problem (which alone was something) and we did have some ideas and tried to implement them. But after testing them on all the given graphs we realized, that those "improvements" to the ansatz doesnt work...

Heres my attempt to optimize the given ansatz. I noticed that CNOTCNOT on ++|++\rangle state doesnt change it:

++=12(00+01+10+11)CNOT12(00+01+11+10)\ket{++} = \frac{1}{2}(\ket{00} + \ket{01} + \ket{10} + \ket{11}) \longrightarrow^{CNOT} \frac{1}{2}(\ket{00} + \ket{01} + \ket{11} + \ket{10})

So I figured - why not rearrange the circuit so that it is still performing the same functionality, but has all CNOTCNOT s thrown to the beginning, which would cancel them? And I can also "flip" the CNOTCNOT s, since the given graphs are undirected.

So as an example, this was one of the graphs:

alt text

And this was the given basic ansatz:

alt text

This was my obtained ansatz after some modification:

alt text

Doing this:

def build_ansatz(graph: nx.Graph) -> QuantumCircuit:

ansatz = QuantumCircuit(graph.number_of_nodes())
ansatz.h(range(graph.number_of_nodes()))

used_nodes = set()

theta = ParameterVector(r"$\theta$", graph.number_of_edges())
for t, (u, v) in zip(theta, graph.edges):
if u not in used_nodes:
ansatz.ry(t, v)
ansatz.cx(u, v)
used_nodes.add(u)
elif v not in used_nodes:
ansatz.ry(t, u)
ansatz.cx(v, u)
used_nodes.add(v)
else:
ansatz.cx(u, v)
ansatz.ry(t, v)
ansatz.cx(u, v)
# used_nodes should already have both u and v
return ansatz

So as you can see, there is significantly lower number of gates, and more importantly - less CNOTCNOT s. And on paper the circuit should be equivalent to the old one. But, sadly, THIS DIDN'T WORK. It didn't even converge... So this was just an idea and we, with the team, couldn't figure out what was the problem. But if you know, please let me know! (in the comments below, or write an email).

Overall

Overall, problems were hard. And I (together with my team members) were not prepared well for that. However, our aim was to learn more about quantum computing, not to win. And I think we achieved that aim. Me, personally, I've gto a better understanding of the quantum computing field, got more interested into it and even decided (not the final decision) to pursue my career (both academic and corporate) in this field.

My whole university experience

· 2 min read

Post in progress...

My bachelor studies are coming to the end - it's the last semester, writing bachelor thesis. So here's all the courses with short structure, my opinion and how it adds up to the whole image of knowledge. Not mentioning other university activities and job, there was too much of everything, I need to limit myself.

Addressing mainly to the high school students in Lithuania, to be able to choose studies and survive them more easily.

Pre (in school)

My field is computer science. But I am also interested in pure math and physics, but didn't want to study those, just because I thought the work after studies would be boring and only programming is feasible.

For the learning part, of course, I am not talking about the regular curiculum. Here I describe everything that I learned additionally (almost everything from YouTube).

  1. Math. Polynomials, complex numbers, calculus, mathematical logic. You can find more keywords and descriptions on this page: The Science Guild > Science Can Be Interesting

  2. Physics. Electromagnetism (with Maxwell's equations), special relativity basics, particle physics basics, digital electronics.

  3. Computer science. Programming in Java, computer architecture basics (logic gates, half adder, multivibrators, BCD, K-maps), automata theory.

Vilnius university 1st year

(on quantum computing, check out GitHub)

Bett 2025 EdTech fair

· 5 min read

LT version and photos below

I've recently had a chance to participate in the biggest edtech fair in the world - Bett 2025 - in London. I didn't have a big plan or passion, just wanted to learn more about the edtech demand and opportunities abroad (since I have an edtech startup myself). But I still tried to gather as much experience as I could.

So here's my thoughts.

Status quo

I own a company called Skafis (skafis.lt) which makes edtech projects. For now not much money was generated, just a few hundred euros from donations on one website. But I have an idea, motivation and people who need the things I make.

I also just finished my minor studies on Pedagogy at Vilnius University, wrote my final thesis about edtech in math class (you can check it out here).

Hopefully later gonna build an LMS (learning management system). I started making one with a team, but didn't pay much of attention, so the project is suspended.

In general, education in Lithuania is not the best (on average) and teachers don't really like using tech. Or just don't have enough funds devoted for it. So as a kind of math teacher and kind of programmer I see a lot of potential in this field, and a great ability to actually contribute to Lithuania's education. Sadly, education sector for business is not very profitable (or at least with my mentality). And it's also really hard to get into the market (sorry, no source, just I've heard that).

Bett. 23 and 24 Jan

I just got back from London, where I mainly attended startup presentations and the international TeachMeet (https://www.teachmeetglobal.org).

AI, of course, was heavily promoted by everyone, but there wasn’t anything particularly new - just the same generalized content creation and AI tutoring. The only standout presentation that wasn’t focused on promoting a specific product came from a Moldovian EdTech trainer. He summarized recommendations for using AI, emphasizing that it shouldn’t immediately replace teachers entirely but should instead serve as a supportive tool. It was surprising that others didn’t really talk about this, as it seems like a crucial point for AI implementation - a gradual transition rather than the "all-in-one, fully digitalized" approach many were advocating. Here are the slides: https://gamma.app/docs/Enhancing-Student-Engagement-via-Integrating-Generative-AI-Human--l5tok5a3643rz5a

There were some interesting insights from other teachers, but nothing particularly striking. I didn’t come across Finnish or Dutch stands - I got overwhelmed by the event’s size. However, a teacher from Finland spoke about how colors on walls (using a projector) and music can help with learning math, while a teacher from the Netherlands talked about teaching programming and how they encourage interactivity and engagement using Microbit.

Regarding startups, there wasn’t anything extraordinary - mostly the same testing/assessment and content creation systems. However, some did seem to be high-quality and promising, like a testing system that wasn’t overloaded with unnecessary details and didn’t rely on AI-generated content. There was also a presentation about an EdTech product for music education, but it didn’t leave much of an impression - I don’t even remember exactly what it was about. I spoke with the creator of the testing system (intuitivo.pt) and the founder of an automated CV-building system that tracks skill acquisition (potential.ly).

Beyond that, I had a few conversations with teachers - a history teacher from Germany, a teacher from Moldova, and a school principal from Croatia. From what I gathered, they use technology about as much as schools in Lithuania do.

Overall, I didn’t learn anything particularly groundbreaking, just a few minor takeaways. Of course, everyone was keen to promote their products, but it didn’t seem like they had deeper insights into potential challenges.

------------------ LT VERSION ----------------------

Grįžau iš Londono, pagrinde dalyvavau startup prezentacijose ir tarptautiniame teachmeet (https://www.teachmeetglobal.org).

AI, žinoma, visi labai reklamavo, tačiau nebuvo kažko labai naujo - tas pats labai generalizuotas turinio kūrimas bei AI tutor'inimas. Išsiskyrė tik viena, ne orientuota į konkrečio produkto reklamą prezentacija iš Moldovos EdTech trainer. Apibendrino AI naudojimo rekomendacijas, kaip tai neturėtų būti iškart visą darbą atstojantis mokytojas, o tik padedantis įrankis. Keista, kad kiti nelabai apie tai kalbėjo, nes atrodo tai esminis dalykas, kad tranzicija po truputį būtų, o ne kaip kiti sako, kad iškart all-in-one turės viską skaitmenizuota. Čia skaidrės: https://gamma.app/docs/Enhancing-Student-Engagement-via-Integrating-Generative-AI-Human--l5tok5a3643rz5a

Prezentacijose buvo įdomių pastebėjimų ir iš kitų mokytojų, bet labai dėmesio neatkreipė. Suomių ar olandų stendų neatradau, truputį užgožė renginio dydis... Bet kalbėjo mokytojas iš Suomijos apie tai, kaip spalvos ant sienų (su projektoriumi) ir muzika padeda pvz mokytis matematikos. Iš Olandijos mokytoja kalbėjo apie programavimo mokymą, kaip skatina interaktyvumą ir įspūdžių sukėlimą, naudoja microbit.

Iš startupų pusės, nebuvo kažko įpatingo, tos pačios testavimo ir turinio kūrimo sistemos. Bet buvo ir skambančių kokybiškai ir perspektyviai (pvz testavimo sistema, kuri neapkrauta smulkmenomis ir nesitelkia AI generavimu). Buvo ir muzikos edukacijai skirto produkto prostatymas, bet nepaliko įspūdžio, tiksliai net nepamenu apie ką buvo. Kalbėjau su testavimo sistemos (intuitivo.pt) kūrėju bei su tokios kaip supratau automatizuotos CV kūrimo sistemos, sekančios įgūdžių įgijimo kelią, (potential.ly) autoriumi.

Daugiau tik pakalbėjau su keliais mokytojais (istorijos iš Vokietijos, iš Moldovos bei Kroatijos mokyklos direktore). Bet kiek supratau, technologijas maždaug tiek pat, kiek Lietuvoje naudoja.

Tai bendrai labai kažko ypatingo nesužinojau, tik va tokių keletą smulkmenų. Visumoje, žinoma, norėjo visi reklamuotis, bet neatrodė, kad turėtų gilesnių įžvalgų apie galimus iššūkius.

Photos

ft4

ft1

ft2

ft3

Season "3rd year of studies" is closed

· 5 min read

The academic year is done and, tradicionally, here is the recap of what I did and what are my plans for the future. It is more of a thing for myself, a way to catch up with things and somehow round up projects and stuff, but maybe you will also find some useful stuff.

On teaching

· 3 min read

A few ideas that could possibly make a huge impact on education

I've always had a question in my mind, an unsolved mystery - why math and other science is so damn easy, but yet so many students fail it? I am no special person - not some kind of genius, and

Het is genoeg.

· 3 min read

I know, the title is not in English. But who cares...

I though I should write some profound blog posts about the shitty education system in Lithuania,