Posts

File Transfer Tool

Image
I was teaching UDP and TCP protocols this term. I did not want my students to get the wrong impression that UDP should not be trusted, so I created a simple File Transfer program using UDP. Initially, I just used a stop-and-wait protocol with a retransmission timer. But instead of coding it myself, I used one of these free AI tools (it has been a choral work, so I am not sure who did what, but ChatGPT, Claude2, and Qwen had a role in the set of programs developed here).  So what I did was to first define the different command-line options the Java program will support: java UDPFileTransfer SERVER  java UDPFileTransfer SEND filename [server] java UDPFileTransfer RECEIVE filename [server] With the first option, the program would start as a server, allowing a client to talk to its port 9876. The second and third cases will create a client that will try to either send or receive a file. If no server is specified, the assumption is that a server is running on the local host. Other...

Tired of these ssh probing bots!

Image
I manage a few Linux servers at different places. I use SSH for that purpose, but I noticed that keeping port 22 open was like a light sign to the Internet hacking community. I do not feel comfortable knowing that my servers are subject to constant probing from other already hacked computers. I moved the servers to non-standard ports to keep most of the noise away, but it seems that is not enough nowadays, as I can see a bunch of hosts trying what I guess are common root passwords over and over again or some known SSH brute-forcing attacks. I keep the password login option open as I never know where I may need to connect from. So, there is a non-zero chance that my password could be guessed. So, I am now giving it a go to the fail2ban tool. As the name suggests, it will ban attackers' addresses after a programmable number of login fails. I hope this will remove some noise from /var/log/auth.log

Getting work done with AI

Image
I like to give it a go to the Advent of Code programming contest problems. They are usually funny and entertaining, sometimes too entertaining. But this year, I was busy with other matters, and I could not see much of it, so it dawned on me that perhaps I could use that as an excuse to give it a go to some of the newest LLMs that some people were raving about.   Coping and pasting the text of an AoC problem did not require much attention, so armed with LMStudio software and a couple of Qwen2.5 LLMs, I started testing. The 8B model dashes (at around 24 tokens/sec on my PC equipped with an Nvidia RTX 4060 Ti with 16 GB of VRAM). Unfortunately, the output is usually not good enough. However, when using the 32B LLM, the results, though slow at around 2.5 tokens/sec, are usually correct and produce Python source code that runs perfectly and delivers the proper solution, at least for the first question of each problem, in just a few minutes. Even with that slow generation rate, th...

How the AI made me suffer

Image
 I was having lunch with my wife at a restaurant when I got a call from someone from work. A technician dealing with network security told me my office computer was infected with some nasty virus/worm/trojan. There was not much I could do, and being a Friday afternoon, the person who called told me they would do nothing else till Monday morning. The purpose of the call was to make me aware my computer was now isolated in a different VLAN where I would have almost no network services. I immediately felt uncomfortable and worried. What could I have done wrong for this to happen? I tried to avoid all the common pitfalls of not seeing myself in this situation, but I was not doing well enough. Thankfully, the meal was delicious, and I could park the problem for a while. I woke up early Saturday morning to shop and could not resist stopping by my office and checking my computer. As I was told, only a few services were working, I was getting a different IP address and had no access to any...

Security policy blues

Image
  When your company's security policy starts to make your life uncomfortable, some will say they are doing a good job, while others will complain. I would rather side with the latter.  I have been using a server accessible from the Internet for years. A few weeks ago, a message warned me to update the validity of the firewall rule. Unfortunately, that task appears to be above my pay grade. More unfortunate is that the people who that warning message told me specifically to talk to if I happened not to be able to fix it myself claim they cannot do that and that I should talk to somebody else. That pleased me not.  I am sure I could waste a couple of days going back and forth and get this fixed, but it would be helpful for a short time as I am retiring soon. Alternatively, I considered other more fun solutions that required me to talk with no one else. I have developed some sort of an allergy to people telling me, "That is not my job," when I request something.  If you...

Heating up a large print bed

Image
3D printers use a heated bed to promote the adhesion of molten filament to it. Many printers have a heater and a thermistor to heat up and measure the bed temperature. Some microcontroller code creates a closed-loop regulator that keeps the bed temperature around the desired set point. The question is what to do when you have a large bed. Some manufacturers have just gone bigger: a large bed is coupled with a large heater and a thermistor (or thermocouple is used for measuring the actual temperature of the bed). Others, like the Prusa XL print bed, have actually gone smaller and composed the larger bed as a set of smaller tiles, each with an independent temperature control. That approach is more complex and expensive in terms of control. Still, it comes with the added advantage of independent control of the temperatures of different bed zones, which might have power savings consequences. From where I stand, simpler and cheaper is the way to go with our project's budget. So, I settl...

Multiple heaters on a single extruder on Duet 3

Image
 For one of my recent projects, we built a pellet-extruder 3D printer. Its hotend has four different temperature sections. That means four heaters and four thermistors to create four independent temperature control loops. So far, all my printers have had a single heater for the hotend, so this was new to me.  Handling so many temperatures required enough thermistor inputs on the control board. In my case, a Duet 3 6HC board features precisely four temperature inputs. Which seems to be enough. However, I have a heated bed (which I will describe in an upcoming post) that also needs its temperature to be monitored, so I need five temperature inputs; I am one short so far. The solution was to buy an additional Duet Expansion 1HCL board. This one features two additional temperature inputs, two additional fan outputs, and an additional high-power motor driver I will not use now. This additional board connects to the 6HC using a CAN bus interface. Its default address is 123; you can ...