Details
-
AboutGame developer
-
SkillsServer and client programming skills.
Joined devRant on 6/30/2017
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
Me: so, ifconfig, what is my gateway?
ifconfig: [ip address]
Me: nmap, what is this IP address?
nmap: it's a network switch with an open telnet port.
Me: what happens if I connect to it?
switch: WHAT IS THE PASSWORD?!?!
Me: is it blank?
switch: correct. what do you want to do?
Me: can I look at all the IP and MAC addresses on the network?
switch: WHAT IS THE ADMIN PASSWORD?!?!
Me: is it... admin?
switch: correct. Here's everyone that's connected to the network: [400+ IPs and MACs]
Me: ok python, would you filter through these and tell me what manufacturer each one belongs to?
python: sure.
[~50 manufacturer lookups later]
python: there's a bunch of apple product, a bunch of miscellaneous laptop and printer manufacturers, and some raspberry pis.
Me: raspberry pis?
python: yep. about 20 of them.
Me: What happens if I connect to one?
rpi: WHAT IS THE PASSWORD?!?!
Me: raspberry?
rpi: correct. what do you want to do?
Me: can I make you do my bidding in the background when you aren't being used?
rpi: sure, sounds fine.
I love ignorant sysadmins.8 -
VB3.
In my last rant I mentioned I used to convert VB3 code to .Net. Before that, I used to work on the VB3 product itself. This software emulated something from the real world, and as such complied with a bunch of regulations that changed on a regular basis, and always had additions and removals that were to be done on a strict schedule (e.g. "we're adding a new product next month, so we have to be able to sell it by the first of the month"). As such, it was a huge sprawling mess.
One day, I was given a task to change some feature slightly. The task was simple enough and really only required adding one line of code. I added that line and clicked "Run".
Error: Too Much Code
What? What do you mean too much code? I asked a colleague for help. "Oh, don't worry, it happens when a function is too long. Just remove one or two of the comments and try again." The comments were, naturally, old deleted code that was quite meaningless so I had no qualms about removing some. It worked, and I went on with my life.
This started happening on a regular basis on our larger functions. But there were always comments to remove so it wasn't a big issue.
One day, though, it happened on a five-line function. This was puzzling - the error had always happened when a function was too big but this one clearly wasn't. What could the error mean? I went to the same colleague.
Apparently, there's also a limit to how big the entire code base can be. "Just find a function that isn't used any more and delete it." And so I did. There were many such functions, responsible for calculating things which no longer existed so they were never called. For months, I'd find functions and remove them. Until there weren't any more. I checked every function and subroutine in our codebase, and they were all used; I checked every possible code path and they were all needed.
What do I do now, I asked? The colleague, who was an expert on VB3 but worked on another project, came and take a look.
"Look at all these small functions you made! No wonder you're running out of space!" Apparently each function created a lot of overhead in the compiled executable. The solution was clear. Combine small functions into large monolithic ones, possibly passing flags in them to do completely unrelated things. Oh, and don't comment on the different parts because we have no room for comments in our code base.
Ah, the good old days.5