LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-03-2022, 11:01 AM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Rep: Reputation: 61
Exclamation Question for all who lurk and post here. Are you also a "system admin"?


I came across a post on reddit the other day where someone was making a joke about this nifty command that could retrieve the IP address of an LXC container. As far as I understand, the comments on the post were in agreement, it was an elegant method to get around some short comings of the systems they work in.

Now to me, this command seemed like a dirty hack. Something you might do in an emergency, not something that would be praised or even worse, acknowledged as a common technique. So I asked, is this common behaviour in a system admin role? To which I got a response that said yes, system administration is filled with small one off commands that solve these common problems.

To me this seems completely counter to what modern programming is like, I have more experience programming than I do in system administration but I am trying to improve and gain more confidence by administering my own home server. I constantly feel like everything I achieve is a waste of time because to me, it all lacks elegance and design, but this is me looking at it from the same perspective I would use when programming.

So this brief experience the other day was illuminating to me, maybe the challenges and frustrations I feel with my own self directed learning of system administration is part of what modern system administration is?

So I wanted to ask all of y'all how ya felt about this? Do you find modern system administration to be the opposite of modern programming?
 
Old 07-03-2022, 11:38 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
You might as well show what that 'hackish one-line solution' was.
 
2 members found this post helpful.
Old 07-03-2022, 12:08 PM   #3
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,599

Rep: Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546

Context is important.

For an ephemeral command to retrieve a value, where an error or unexpected value simply means re-typing, it only matters if it returns the appropriate value.

For persistent code that has to work unsupervised with different states and unknown future inputs, being fully correct and maintainable are obviously important.

Of course, many one-off commands do require careful correctness to not screw things up, but retrieving an IP address doesn't sound dangerous...

 
1 members found this post helpful.
Old 07-03-2022, 12:44 PM   #4
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,485

Rep: Reputation: Disabled
Most sysadmins will hack together commands via 'redirection' & 'pipes' to achieve their goal, it is quite common, & the way that unix/Linux was built to work originally. For jobs that may be performed more than once or twice, programming 'scripts' are often used.

Last edited by fatmac; 07-03-2022 at 12:45 PM.
 
1 members found this post helpful.
Old 07-03-2022, 12:49 PM   #5
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Fro those who are interested, it's this meme here: [link moderated]

Last edited by astrogeek; 07-04-2022 at 11:28 PM. Reason: Link moderated, reported as spam
 
Old 07-03-2022, 03:42 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by wh33t View Post
To me this seems completely counter to what modern programming is like, I have more experience programming than I do in system administration but I am trying to improve and gain more confidence by administering my own home server. I constantly feel like everything I achieve is a waste of time because to me, it all lacks elegance and design, but this is me looking at it from the same perspective I would use when programming.

So I wanted to ask all of y'all how ya felt about this? Do you find modern system administration to be the opposite of modern programming?
In my career I have been a system programmer, a programmer, a programming manager, and a data center manager where some of my subordinates were system administrators. You are looking at system administration through a programmers eyes. You are taken aback that a system administrator does things that a programmer would consider "quick and dirty" and with a complete lack of documentation.

A system administrator is in charge of a running system which he has to keep running smoothly and not allowing problems or configuration changes to create downtime or user inconvenience. He fixes problems as quickly as possible with as few disruptions as possible. If he creates a quick and dirty solution which causes no further problems then more glory to the system administrator. Having done so he will park the solution someplace handy for possible future use and verbally tell the other sysadmins of its existence.

If a programmer did the same thing with production programs the programming manager would downgrade the programmer's evaluation for writing code which did not conform to company programming standards and which is not maintainable because there is no documentation.

Another difference between the two is time deadlines. A programmer is working to a deadline of six weeks from now. A sysadmin is working to a deadline of "NOW". This difference is also seen in their different attitudes to work schedules. A programmer can take time off to run errands, work odd shifts to get machine time, and work a lot of unpaid overtime as the deadline approaches. A sysadmin has to be at work on the dot to relieve the person working the previous shift. If he wants to skip out to go to the bank or whatever he has to get some other sysadmin to cover for him and probably trade time with his substitute. I had one single woman sysadmin who would consistently trade second shift on Fridays for any third shift during the week because working second shift Friday interfered with her love life.

and so it goes

Last edited by jailbait; 07-03-2022 at 06:40 PM. Reason: typo
 
3 members found this post helpful.
Old 07-03-2022, 06:20 PM   #7
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,140

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
I do not do anything officially or as a profession. I consider myself one though. I manage the stuff around my home which is a bit extensive from my viewpoint. I run all kinds of random things that aren't super dangerous to my layout or setup around here. There is always a better way but when you are trying to get the job done sometimes it's quicker to do a dirty hack depending on who is waiting for the services or whatever. I'd imagine that is true in the professional world as well. Get the job done with as little danger as possible while still being quick about it.

To be fair I don't have to answer to anyone but myself either so it's all a matter of perspective.
 
1 members found this post helpful.
Old 07-03-2022, 07:19 PM   #8
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,617

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
After 37 years in computers professionally, 35 as acting network/system administrator, one-line and one-off solutions that got the information needed and/or solved the problem until other tools caught up to the need were not only common, they were almost daily treasures. It is great to know the tools and what they can do, but that is not your real job. Your real job is to save the business, protect the data, and make sure that the doors open again Monday morning! If there is not a prebuilt way to make it work on-hand, you MAKE it work! That is what the degrees and experience are for, that is why you make the big (never big enough) bucks!

And once you have something you can share, you share it: because there are other professionals out there that WILL run into the same problem. They share with you, you share with them, everyone gets smarter and stays employed.

What, you thought there was a magic wand or book of answers? We CREATED this world!

Last edited by wpeckham; 07-03-2022 at 07:21 PM.
 
1 members found this post helpful.
Old 07-03-2022, 08:48 PM   #9
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Red face

Quote:
Originally Posted by wpeckham View Post
After 37 years in computers professionally, 35 as acting network/system administrator, one-line and one-off solutions that got the information needed and/or solved the problem until other tools caught up to the need were not only common, they were almost daily treasures. It is great to know the tools and what they can do, but that is not your real job. Your real job is to save the business, protect the data, and make sure that the doors open again Monday morning! If there is not a prebuilt way to make it work on-hand, you MAKE it work! That is what the degrees and experience are for, that is why you make the big (never big enough) bucks!

And once you have something you can share, you share it: because there are other professionals out there that WILL run into the same problem. They share with you, you share with them, everyone gets smarter and stays employed.

What, you thought there was a magic wand or book of answers? We CREATED this world!
I guess what is weird to me is that there is basically a package or a framework for practically anything these days in the programming world, hell, VS Code is perhaps on the verge of writing code on it's own with minimal support from the human, then to see and hear that system administration is somehow "behind" (if that's the right word) in this regard just seems so strange to me as system administration in my opinion is a level lower than the software we write. It's the infrastructure that makes the modern world exist. I feel like it would evolve slower and thus have more mature tooling. Is that not the case?
 
Old 07-03-2022, 10:56 PM   #10
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by wh33t View Post
I guess what is weird to me is that there is basically a package or a framework for practically anything these days in the programming world, hell, VS Code is perhaps on the verge of writing code on it's own with minimal support from the human, then to see and hear that system administration is somehow "behind" (if that's the right word) in this regard just seems so strange to me as system administration in my opinion is a level lower than the software we write. It's the infrastructure that makes the modern world exist. I feel like it would evolve slower and thus have more mature tooling. Is that not the case?
Yes, in general the quality of the code written by sysadmins is of much lower quality than the code written by programmers. But you are missing the point made by wpeckham that programming is only a minor part of a sysadmins responsibilities. There is backup and recovery. When (not if) a disk drive fails is there backup available, how long does it take to switch to the backup, and how disruptive is the switch? All of that has to be figured out before the disk drive breaks. And if a problem arises during the restore then you need some quick and dirty software ASAP.

When a clerk calls up and says he forgot his password is this really a company employee or a hacker doing some social engineering? Security is a whole area to itself where you have to only allow company personnel to access the data that they are authorized to work with and keep them out of unauthorized areas while at the same time not driving people up the wall with arcane security rules. Dealing with in-house security is actually more difficult than dealing with the stereotypical hacker working in another continent.

When a clerk calls up and says her terminal is non-responsive you have to troubleshoot the problem as to where the problem is in the network, testing equipment that you have never seen and you may not even know what state it is located in. You have to get it right because, aside from the time wasted, there is nothing madder than a repairman who drove fifty miles to fix a piece of equipment that you told him was broken and there is nothing wrong with the equipment. Or perhaps it is a software problem in the mainframe in which case you need to call in the maintenance programmer. Or maybe the clerk forgot to throw the correct switch. Dealing with a complaining user is a whole skill set in itself.

The list could go on and on but my point is that the fact that programs written by sysadmins are not as professional as programs written by programmers is irrelevant.

Last edited by jailbait; 07-03-2022 at 11:02 PM.
 
1 members found this post helpful.
Old 07-04-2022, 11:58 AM   #11
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,617

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
Quote:
Originally Posted by jailbait View Post
Yes, in general the quality of the code written by sysadmins is of much lower quality than the code written by programmers. But you are missing the point made by wpeckham that programming is only a minor part of a sysadmins responsibilities. There is backup and recovery. When (not if) a disk drive fails is there backup available, how long does it take to switch to the backup, and how disruptive is the switch? All of that has to be figured out before the disk drive breaks. And if a problem arises during the restore then you need some quick and dirty software ASAP.

When a clerk calls up and says he forgot his password is this really a company employee or a hacker doing some social engineering? Security is a whole area to itself where you have to only allow company personnel to access the data that they are authorized to work with and keep them out of unauthorized areas while at the same time not driving people up the wall with arcane security rules. Dealing with in-house security is actually more difficult than dealing with the stereotypical hacker working in another continent.

When a clerk calls up and says her terminal is non-responsive you have to troubleshoot the problem as to where the problem is in the network, testing equipment that you have never seen and you may not even know what state it is located in. You have to get it right because, aside from the time wasted, there is nothing madder than a repairman who drove fifty miles to fix a piece of equipment that you told him was broken and there is nothing wrong with the equipment. Or perhaps it is a software problem in the mainframe in which case you need to call in the maintenance programmer. Or maybe the clerk forgot to throw the correct switch. Dealing with a complaining user is a whole skill set in itself.

The list could go on and on but my point is that the fact that programs written by sysadmins are not as professional as programs written by programmers is irrelevant.
Not disagreeing with a thing you said, but pointing out that many SYSADMINS started in programming, branched into network admin, DBA work, program analysis, system analysis, and BECAME system admins. When I started out, NO ONE trained to become a sysadmin, they were promoted into the title so the company could justify giving them a raise within a ridiculously rigid system.
 
Old 07-04-2022, 12:13 PM   #12
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by jailbait View Post
Yes, in general the quality of the code written by sysadmins is of much lower quality than the code written by programmers. But you are missing the point made by wpeckham that programming is only a minor part of a sysadmins responsibilities.
Well, my main reason for this thread was simply to ask those that are familiar with modern programming standards AND familiar with modern system administration, whether or not my observations that system administration is performed with a completely different set of expectations and qualifiers.

I think I've got my answer: system admins rarely ever get the time to implement a solution in the same way a programmer is expected to due to time constraints.
 
Old 07-04-2022, 04:37 PM   #13
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
Quote:
Originally Posted by wh33t View Post
Fro those who are interested, it's this meme here: https://i.redd.it/w7qpc3j4y6991.png
I'm not really sure what that pct exec 103 -- stuff is — I've never seen that before — but part of the issue here is that linux doesn't make it easy to query this specific information (ip address of an interface).

Some programs are designed with scripted use in mind, and some programs are designed to output human readable text. The first example uses 'ip' and then grep/awk/cut to extract the wanted data from the human readable text. The second example gets creative and uses the arp table to obtain the same information from a different source in what they believe is a more succinct manner. It's not really what the arp table was intended for and it's a bit of a hack, but kudos for the creative thinking.

That said, well designed utilities will have options to aid in scripted use, and if they'd looked at the man-page a little harder they'd have seen that the 'ip' command is one of them, having the -o, and -j options.

Using the -o option might look like this
Code:
$ read id dev family addr rest < <( ip -o -f inet a l dev eno1 )
$ echo ${addr%/*}
192.168.0.201
$
No grep, no awk, no cut, though the ${addr/*} is required to remove the /24 netmask suffix from the address output by 'ip a l' should that need to be done.

I suppose the -j (json) approach would be considered the more modern thing to do, but it does require an additional parser program to be installed on the system.

Here's the json version of the query:
Code:
$ ip -j -f inet a l dev eno1 |jq -r .[].addr_info[].local
192.168.0.201

Moving away from the specific examples in the meme, to the more general topic raised...

There's an old quote that I always liked which I believe might be relevant here. I can't remember where I saw it, or who it's attributed to, and it's likely not exact, but to the best of my recollection it goes something like this:
Quote:
An experienced UNIX programmer can quickly knock up a 1000 line program to do pretty much anything they need. However, someone who truly knows UNIX will understand that they do not need to.
The basic idea behind it being that combining well designed simple utilities within pipelines can achieve an awful lot, avoiding the need to write that 1000 line program.

I can't really offer much insight on modern systems admin vs modern programming, I'm pretty much old-school in both regards: In my time, I've worked as Operator, Ops Analyst, System Programmer on mainframes, and system admin/3rd line support on AIX Systems and some minicomputer and other sundry Info Systems stuff.

Best not to generalise too much though. In my experience, much like programmers, not all system admins are created equal!

Last edited by GazL; 07-04-2022 at 05:17 PM.
 
3 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Report: DHS Requested Gas Pipeline Companies to Let Attackers Lurk Inside Networks LXer Syndicated Linux News 0 05-09-2012 04:20 PM
LXer: Report: DHS Requested Gas Pipeline Companies to Let Attackers Lurk Inside Networks LXer Syndicated Linux News 0 05-09-2012 10:20 AM
Enable did you find this post useful for first post of thread also vharishankar LQ Suggestions & Feedback 40 12-13-2011 12:13 PM
LXer: ETC – where the config files lurk, examples with grub LXer Syndicated Linux News 0 11-05-2011 02:21 AM
Lurk you long time.... :-) clay42 LinuxQuestions.org Member Intro 1 01-06-2010 10:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration