:3
Everything is barely weeks. Everything is days. We have minutes to live.
- about me
- Github: @r1bb1t-h0l3
Everything is barely weeks. Everything is days. We have minutes to live.
Posted
This week I finally hit 50 solved problems on DMOJ! Problem number 51 for me was Rue’s Rings
This was a good opportunity for me to try out the map python method which I had found out about recently, but hadn’t had the opportunity to implement. I also used the “really huge number” approach which I had learned about from “Learn to code by solving problems” by Daiel Zingaro.
Anyway, this took me a few tries to get because of formatting issues and such, but I got there in the end. Here’s my solution code:
for dataset in range(10):
routes = []
number_of_routes = int(input())
for _ in range(number_of_routes):
route_info = list(map(int, input().split()))
route_id = route_info[0]
min_r = min(route_info[2:])
routes.append((route_id, min_r))
min_diameter = 70001
for i in range(len(routes)):
if routes[i][1] < min_diameter:
min_diameter = routes[i][1]
route_number = []
for i in range(len(routes)):
if min_diameter == routes[i][1]:
route_number.append((routes[i][0]))
route_number.sort()
str_sorted_routes = list(map(str, route_number))
answer = '{' + ','.join(str_sorted_routes)+'}'
print(f"{min_diameter} {answer}")
Author
ribbit
Categories
coding challenge
Posted
This will be a general overview of what shadowsocks proxy is, who it is for and how to install and configure it. This is not a super detailed play-by play as everyone’s system will be slightly different and you will likely need to troubleshoot here and there. As a disclaimer – I am not an expert in any of this, and all of the following is the result of many hours of googling around and troubleshooting, so potentially to be take the following info with a dollop of salt.
Shadowsocks is a secure split proxy based on SOCKS5. SOCKS5 is not quite as comprehensive as a VPN as it does not encrypt all traffic, but Shadowsocks is generally faster as the encryption is focused on speed, rather than complete security.
SOCKS5 (Socket Secure version 5) is a network protocol that facilitates the routing of network traffic between a client and a server through a proxy server. It operates at the session layer (Layer 5) of the OSI model and is generally used to bypass internet restrictions, protect privacy, and anonymise traffic.
Shadowsocks might be useful for:
Step one – buy a VPS server. It doesn’t need to be super powerful, 1 GB RAM is enough. I used aeza.net, who are pretty cheap and have a nifty telegram bot to keep track of your servers, but you can use whatever company strikes your fancy.
I chose Ubuntu 22.04 as my OS, but this depends on your preference.
Pay for your server and wait to receive your login details and password to your email.
Once your server is up and running here is what you need to do server-side:
{
"server": "your_server_ip",
"server_port": 8388,
"local_address": "127.0.0.1",
"local_port": 1080,
"password": "your_password",
"timeout": 300,
"method": "aes-256-gcm"
}
sudo systemctl start shadowsocks-libev
for me all of this was painless and fast.
Now to the client-side settings. Here is where I had some issues because I was using an unstable Debian build. For most people this stage should be totally fine too.
sudo systemctl start shadowsocks-libev
{
"server": "your_server_ip",
"server_port": 8388,
"local_address": "127.0.0.1",
"local_port": 1080,
"password": "your_password",
"timeout": 300,
"method": "aes-256-gcm"
}
snap run shadowsocks-libev.ss-local -c /path/to/your/config.json
sudo nano /etc/systemd/system/shadowsocks-client.service
and an example of the service file:
[Unit]
Description=Shadowsocks Client Service
After=network.target
[Service]
ExecStart=/usr/bin/snap run shadowsocks-libev.ss-local -c /home/youruser/snap/shadowsocks-libev/common/config.json
Restart=always
User=root
[Install]
WantedBy=multi-user.target
sudo systemctl enable shadowsocks-client.service
sudo systemctl start shadowsocks-client.service
No, of course we don’t just hope – we check to make sure our service is up and running and here is how:
netstat
to make sure that the local port is listening:netstat -tuln | grep 1080
sudo systemctl status shadowsocks-client.service
*originally my client-side config.json was placed in a /home/user/location/ or somewhere like that, and AppArmor was restricting shadowsocks(ss-local process) from accessing the file. Here is the approximate kind of error I received:
AppArmor="DENIED" operation="open" class="file" profile="snap.shadowsocks-libev.ss-local"
name="/home/user/Desktop/shadowsocks-libev/debian/config.json" pid=432819 comm="ss-local"
requested_mask="r" denied_mask="r”
I moved config.json to my snap-specific directory:
/home/sasha/snap/shadowsocks-libev/common/
Since this directory is within the allowed paths that AppArmor grants access to, Shadowsocks was able to finally read it correctly without encountering AppArmor restrictions.
sudo journalctl -xe
*when my client was failing to connect i also used this command to check status
sudo systemctl status shadowsocks-client.service
*AppArmor Denied Access: I resolved this by enabling the AppArmor service and moving the config file to an accessible location.
*Failed to Start Service: I reviewed logs with journalctl, which helped identify the cause (usually dodgy permissions settings or incorrect paths).
While setting up my shadowsocks server I also found this very helpful blogpost
, some great info there, a bit more to the point, a bit less rambly than my one hah.
Next step for me is figuring out how to configure fake DNS, as my IP is being cloaked successfully, but my DNS shows up as being geographically different, which trips some websites’ security protocols.
‘till then!
Posted
I’ve been having a lot of fun (and sometimes a lot of frustration haha) working through an excellent Python book Learn to code by Solving Problems by Daniel Zingaro.
Most of the practice is done through solving challenges on https://dmoj.ca/. I would like to share one challenge a week and my solution to it.
Currently I am working on improving my ability to work with lists and Challenge ecoo17r3p1 — Baker Brie was great practise.
The main challenge and lesson learned here was how to use the split method to work with input, as well as reviewing nested lists. For some reason nested lists can be a little difficult for me to visualise, but practice makes perfect!
Here is my code:
for dataset in range(10):
lst = input().split()
franchisees = int(lst[0])
days = int(lst[1])
grid = []
for i in range(days):
row = input().split()
for j in range(franchisees):
row[j] = int(row[j])
grid.append(row)
bonuses = 0
for row in grid:
total = sum(row)
if total % 13 == 0:
bonuses = bonuses + total // 13
for col_index in range(franchisees):
total = 0
for row_index in range(days):
total = total + grid[row_index][col_index]
if total % 13 == 0:
bonuses = bonuses + total // 13
print(bonuses)
Author ribbit
Posted
I recently took the Cisco Certified Support Technician (CCST) exam, and I wanted to share my experience for those also considering it (and for posterity). This is a brief walkthrough of how I prepared, how I registered, how the actual exam went, and what I found most challenging.
For context, I went into this having zero education and/or experience in Computer Science. People with a background in IT would probably need much less time to understand the basics of networking.
How I Prepared for the Exam
I primarily used Cisco’s Skills for All (now called Netacad). I think this platform is great. It covers both theoretical and practical knowledge and lets you work with Packet Tracer, which is incredibly useful. Also both Netacad and Packet Tracer are free. Netacad has paid courses as well, but the introductory ones like Network and Cybersecurity are accessible free of charge. The labs provided are well-structured, giving you hands-on experience to build confidence. I appreciated that there were enough exercises to really get into the details of network configurations and the material is often reviewed and recycled throughout the course. Unlike many other courses which just throw new concepts at you, this one was clearly designed with educational principles in mind.
Alongside that, I used Todd Lammle’s CCST Study Guide, which is published by Sybex (I talked about this in a previous post). For me, the study guide was absolutely necessary. I had learned a lot from Skills for All/Netacad, but the book took me deeper into the fundamentals and helped clarify some things I might have glossed over during my initial studies. It really broke down complicated concepts in a more digestible way, and even though it goes into a lot of detail, it felt necessary for me to fully grasp the material.
Registering for the Exam: The Certiport Woes
Registering for the exam wasn’t as smooth as I hoped. The exam is administered through Certiport, and unfortunately, their platform feels outdated and not wellmaintained. There’s a notice from 2023 about site updates, but here we are in 2024, and the notice is still up on the main page. This isn’t reassuring when you’re spending money to take a certification exam.
One particularly frustrating issue I faced was that Certiport wouldn’t let me proceed with registration for the exam unless I changed my email address. I had no idea why this was happening, and reaching out to support was a nightmare. Their bot support wasn’t helpful, and when I finally got connected to a person (or another bot, who knows), they suggested I call a U.S. number (I’m not in the US), which made no sense. After some trial and error, I figured out that changing my email solved the problem, but the process was unnecessarily tedious.
Exam Day
On exam day, I followed the instructions and ran the system test that Certiport provides. The Pearson OnVue software runs a check on your microphone, webcam, and internet connection. This part was a bit tricky because I use a hotspot for my internet connection, which is generally frowned upon. Despite that, I managed to pass the test after disabling my Windows Firewall, thanks to advice I found on Reddit. It also checks for any programs running in the background and asks you to terminate them before proceeding. I’m assuming this is because in the real exam your computer will be completely locked by the proctoring software.
When you log in for the exam, you have to provide photos of your workspace, making sure everything is clear, there are no whiteboards or people around. The proctor is invisible but your webcam is always on, presumably for monitoring purposes. For me everything went smoothly until after I finished the exam — that’s when the Pearson OnVue software froze. I couldn’t exit, and after 20 minutes, I had to restart my computer. Luckily, this didn’t affect my results, but it’s something to be aware of.
The Exam Itself
I had read on Reddit that most people found the exam easy, but for me, it was quite challenging. I’m glad I studied as much as I did. There were some easier questions, like matching terms (LAN, WAN, etc.) to their definitions, but others, especially around subnetting and diagnosing network issues, required careful reading and concentration.
There were a few questions about security protocols, cable types, and interpreting command outputs like traceroute and show cdp neighbours. Overall, I was happy I had taken the extra time to use both the Skills for All platform and the study guide to prep and review all this.
Final Thoughts
My overall experience with the CCST exam was positive, though the issues with CertiPort made it more stressful than it needed to be. For someone new to networking, the exam is manageable but definitely requires dedicated preparation. The certification is affordable, and it’s a great stepping stone if you’re just starting out in IT.
If you’re considering it, make sure you have a solid study plan, focus on understanding the fundamentals, and practice with tools like Packet Tracer. Just be prepared for some hiccups with the exam platform!
Key Takeaways:
• Cisco’s Skills for All platform provides excellent theoretical and practical training, but pairing it with Todd Lammle’s CCST Study Guide ensures deeper understanding.
- On Reddit people suggest that CCST is around 20% of required CCNA knowledge, so it might also be worth it to spend a bit more time but be more prepared for the next cert. Up to you.
• CertiPort (the exam platform) feels outdated, and the registration process can be frustrating.
• The exam itself is challenging, particularly in areas like subnetting and network diagnostics.
• The certification is affordable and a good starting point for people entering the IT industry.
• Ensure you have a stable internet connection, and be prepared for potential technical issues.
Author ribbit
Posted
I used the Sybex CCST Study Guide to prepare for my first Cisco certificate. Overall impression: it thoroughly covers all exam topics, with an especially detailed section on subnetting, a topic that I find challenging. The book doesn’t include too many practical exercises, so pairing it with Cisco’s Skills for All/Netacad course is ideal for hands-on practice with Packet Tracer. Some people also feel that the free Cisco course is all they needed to pass and that the CCST study guide is overkill, but I think that for total newbies to the field and for those wanting to do a CCNA this book is a worthwhile resource.
If you don’t feel like reading the in-depth review, there’s a TL;DR at the end.
After completing Cisco’s Skills for All networking course, I decided to dive into Todd Lammle’s Cisco Certified Support Technician (CCST) Study Guide. The Skills for All course was extensive, with over 100 hours of content and practical Packet Tracer activities. However, I still felt the need for extra preparation to ensure I’d pass the exam.
Once I started working through the study guide, I realised that some key topics had been glossed over or rushed through during the Skills for All course. Or maybe it was just that, as a beginner in networking, some concepts didn’t really stick for me. The study guide, however, was far more detailed and better structured, going through the same topics in a way that made everything clearer. While some sections felt like they provided more information than was necessary for the exam, I appreciated the extra depth because it gave context and a strong foundation in the fundamentals of networking.
The first two chapters offer a solid introduction, covering concepts like the roles of modems and switches, MAC addresses, and other essentials. But it was the third chapter that really challenged me—and I believe it’s one of the most important chapters for anyone serious about networking or considering doing the CCNA cert. It dives deep into subnetting, something I didn’t quite grasp during the Skills for All course. The Sybex study guide walks you through subnetting for different network types (A, B, C) and covers calculating subnets, hosts, broadcast addresses, and more. It took me a few days to fully understand it, but after working through all the exercises, I felt pretty confident in my basic subnetting skills.
The later chapters cover virtual private networks (VPNs), security, Cisco devices, and connectors, all of which are directly tied to the exam objectives. I think the book does an excellent job of thoroughly preparing you for the exam’s content, and in my opinion, you could pass the exam with just this book alone.
That being said, I’d still recommend the Skills for All course, especially for the hands-on packet tracer activities. Todd Lammle’s book doesn’t include practical exercises, so pairing it with the Skills for All course is a great way to build both theoretical knowledge and practical skills.
I actually took a pretty long break – around 3 months – after finishing the book before I actually took the exam so I had to review the material again. I had to revisit the subnetting chapter because I had forgotten how exactly to calculate the number of subnets and hosts for each subnet mask. Even after months away from the material, I found that I retained most of it, which is a testament to how well the guide explains things. A quick review was enough to refresh my memory, and I was back on track.
In conclusion, I’d give Todd Lamlme’s CCST Study Guide a solid 10/10. It might go into more detail than you need for the exam, but it lays a strong foundation for anyone interested in networking. Even though not every bit of knowledge is required, you’ll feel confident walking into the exam.
Final Thoughts: I’d recommend this book alongside the Skills for All course, especially for anyone new to networking. Dive into the practical elements, practice on your own with tools like Packet Tracer, and you’ll be set for success.
As an aside, people online say that the content is pretty similar to the content in the COMPTIA Network+, so you could do a 2-for-1 by doing Network+ after CCST. I can’t speak for this as I haven’t done Network+ yet, but I can attest that employers have no idea what the CCST is, it doesn’t even show up as a cert you can pick from a list on a job website to add to your qualifications. In general this exam is more of a confidence booster for you, and an introduction to the field, and will likely make very little difference to your getting a job.
TL;DR / Key Takeaways:
• Todd Lammle’s CCST Study Guide complements Cisco’s Skills for All course, offering deeper insights into topics such as subnetting, security, VPNs, and networking fundamentals.
• The book is highly detailed, sometimes more than needed for the CCST exam, but it provides a strong foundation for future certifications like CCNA.
• The study guide lacks practical exercises, so pairing it with Skills for All’s hands-on activities is beneficial.
• Overall, it’s a well-structured resource that thoroughly prepares you very well for the CCST exam.