Linux skills are hard to find
-
@coliver said in Linux skills are hard to find:
@scottalanmiller said in Linux skills are hard to find:
Here is a bit of difference in approach between Windows and Linux, and I'm not 100% sure on the Windows side so correct me if I'm wrong on the commands. This is one of the "best" cases for PowerShell and was used as the example of how easy it is and I think it really shows how silly and hard it is:
Windows find and set Hostname
- Get-Computername
- Set-Computername newname
Linux find and set Hostname
- hostname
- hostname newname
Differences:
- Linux uses the name of what you want to do, not something else (hostname instead of computername.) I realize that Windows calls it a computername, but it is the hostname that I'm concerned about, not the computer name. Hostname is the name on TCP/IP and DNS.
- Linux needs no verbs, the verbs are implied and obvious.
- Linux needs only one command, not two.
- Linux is designed for admins, not programmers. Programmers are used to getters and setters, admins are not.
It's not a big deal, but PS isn't as simple. Unnecessarily so.
I was mistaken it is actually $env:computername. It doesn't look like there is a native powershell function to get the computername. You can also use the hostname path.
yeah, that's even harder, lol. Although you can do the same thing in Linux and just echo out the variable.
-
@Dashrender said in Linux skills are hard to find:
@coliver said in Linux skills are hard to find:
@scottalanmiller said in Linux skills are hard to find:
Here is a bit of difference in approach between Windows and Linux, and I'm not 100% sure on the Windows side so correct me if I'm wrong on the commands. This is one of the "best" cases for PowerShell and was used as the example of how easy it is and I think it really shows how silly and hard it is:
Windows find and set Hostname
- Get-Computername
- Set-Computername newname
Linux find and set Hostname
- hostname
- hostname newname
Differences:
- Linux uses the name of what you want to do, not something else (hostname instead of computername.) I realize that Windows calls it a computername, but it is the hostname that I'm concerned about, not the computer name. Hostname is the name on TCP/IP and DNS.
- Linux needs no verbs, the verbs are implied and obvious.
- Linux needs only one command, not two.
- Linux is designed for admins, not programmers. Programmers are used to getters and setters, admins are not.
It's not a big deal, but PS isn't as simple. Unnecessarily so.
I was mistaken it is actually $env:computername. It doesn't look like there is a native powershell function to get the computername. You can also use the hostname path.
So what is the whole command?
I haven't tested it but I think
$env:computername.rename("New Name") will set a new computer name.
-
@coliver said in Linux skills are hard to find:
@Dashrender said in Linux skills are hard to find:
@coliver said in Linux skills are hard to find:
@scottalanmiller said in Linux skills are hard to find:
Here is a bit of difference in approach between Windows and Linux, and I'm not 100% sure on the Windows side so correct me if I'm wrong on the commands. This is one of the "best" cases for PowerShell and was used as the example of how easy it is and I think it really shows how silly and hard it is:
Windows find and set Hostname
- Get-Computername
- Set-Computername newname
Linux find and set Hostname
- hostname
- hostname newname
Differences:
- Linux uses the name of what you want to do, not something else (hostname instead of computername.) I realize that Windows calls it a computername, but it is the hostname that I'm concerned about, not the computer name. Hostname is the name on TCP/IP and DNS.
- Linux needs no verbs, the verbs are implied and obvious.
- Linux needs only one command, not two.
- Linux is designed for admins, not programmers. Programmers are used to getters and setters, admins are not.
It's not a big deal, but PS isn't as simple. Unnecessarily so.
I was mistaken it is actually $env:computername. It doesn't look like there is a native powershell function to get the computername. You can also use the hostname path.
So what is the whole command?
I haven't tested it but I think
$env:computername.rename("New Name") will set a new computer name.
I'm not sure how this applies to Linux, but in a business environment, other than during setup, this would be a rare thing to change, and would probably break AD authentication.
for scripting I can see why this is useful though.
So Windows appears to use a variable name, but Linux (maybe from Unix) has a dedicated command for this - while it's easier to use most definitely, was the expectation of use so frequent that it warranted it's own command instead of calling it from a config file or a system variable?
-
@Dashrender said in Linux skills are hard to find:
@coliver said in Linux skills are hard to find:
@Dashrender said in Linux skills are hard to find:
@coliver said in Linux skills are hard to find:
@scottalanmiller said in Linux skills are hard to find:
Here is a bit of difference in approach between Windows and Linux, and I'm not 100% sure on the Windows side so correct me if I'm wrong on the commands. This is one of the "best" cases for PowerShell and was used as the example of how easy it is and I think it really shows how silly and hard it is:
Windows find and set Hostname
- Get-Computername
- Set-Computername newname
Linux find and set Hostname
- hostname
- hostname newname
Differences:
- Linux uses the name of what you want to do, not something else (hostname instead of computername.) I realize that Windows calls it a computername, but it is the hostname that I'm concerned about, not the computer name. Hostname is the name on TCP/IP and DNS.
- Linux needs no verbs, the verbs are implied and obvious.
- Linux needs only one command, not two.
- Linux is designed for admins, not programmers. Programmers are used to getters and setters, admins are not.
It's not a big deal, but PS isn't as simple. Unnecessarily so.
I was mistaken it is actually $env:computername. It doesn't look like there is a native powershell function to get the computername. You can also use the hostname path.
So what is the whole command?
I haven't tested it but I think
$env:computername.rename("New Name") will set a new computer name.
I'm not sure how this applies to Linux, but in a business environment, other than during setup, this would be a rare thing to change, and would probably break AD authentication.
for scripting I can see why this is useful though.
So Windows appears to use a variable name, but Linux (maybe from Unix) has a dedicated command for this - while it's easier to use most definitely, was the expectation of use so frequent that it warranted it's own command instead of calling it from a config file or a system variable?
It would most definitely break AD Authentication. Just something that I was wondering about.
-
@Dashrender said in Linux skills are hard to find:
@coliver said in Linux skills are hard to find:
@Dashrender said in Linux skills are hard to find:
@coliver said in Linux skills are hard to find:
@scottalanmiller said in Linux skills are hard to find:
Here is a bit of difference in approach between Windows and Linux, and I'm not 100% sure on the Windows side so correct me if I'm wrong on the commands. This is one of the "best" cases for PowerShell and was used as the example of how easy it is and I think it really shows how silly and hard it is:
Windows find and set Hostname
- Get-Computername
- Set-Computername newname
Linux find and set Hostname
- hostname
- hostname newname
Differences:
- Linux uses the name of what you want to do, not something else (hostname instead of computername.) I realize that Windows calls it a computername, but it is the hostname that I'm concerned about, not the computer name. Hostname is the name on TCP/IP and DNS.
- Linux needs no verbs, the verbs are implied and obvious.
- Linux needs only one command, not two.
- Linux is designed for admins, not programmers. Programmers are used to getters and setters, admins are not.
It's not a big deal, but PS isn't as simple. Unnecessarily so.
I was mistaken it is actually $env:computername. It doesn't look like there is a native powershell function to get the computername. You can also use the hostname path.
So what is the whole command?
I haven't tested it but I think
$env:computername.rename("New Name") will set a new computer name.
I'm not sure how this applies to Linux, but in a business environment, other than during setup, this would be a rare thing to change, and would probably break AD authentication.
for scripting I can see why this is useful though.
So Windows appears to use a variable name, but Linux (maybe from Unix) has a dedicated command for this - while it's easier to use most definitely, was the expectation of use so frequent that it warranted it's own command instead of calling it from a config file or a system variable?
You use the command to change it in memory on the fly. Does changing the Windows variable do that? I don't think that it does. If you want to change it like you are changing it on Windows you edit /etc/hostname on Linux. On Linux it is super simple to see what is in memory (hostname) versus what is set in memory at boot time (the file /etc/hostname.) On Windows, how many of the Windows admins here know the answer to that and how it interacts?
And on Windows, you do have a custom command for that, it is hidden as part of the object's methods. But it is actually Windows with the additional commands, in this case.
-
@scottalanmiller said in Linux skills are hard to find:
Here is a bit of difference in approach between Windows and Linux, and I'm not 100% sure on the Windows side so correct me if I'm wrong on the commands. This is one of the "best" cases for PowerShell and was used as the example of how easy it is and I think it really shows how silly and hard it is:
Windows find and set Hostname
- Get-Computername
- Set-Computername newname
Linux find and set Hostname
- hostname
- hostname newname
Differences:
- Linux uses the name of what you want to do, not something else (hostname instead of computername.) I realize that Windows calls it a computername, but it is the hostname that I'm concerned about, not the computer name. Hostname is the name on TCP/IP and DNS.
- Linux needs no verbs, the verbs are implied and obvious.
- Linux needs only one command, not two.
- Linux is designed for admins, not programmers. Programmers are used to getters and setters, admins are not.
It's not a big deal, but PS isn't as simple. Unnecessarily so.
In all fairness (and I have no idea whether it's this way on Windows with PS) that's not a permanent hostname change. For a permanent change you either need to edit the config file (depending on the distro) or with systemd use
hostnamectl
-
Ha I posted too slow. Scott got there before I did.
-
Scott - so there are times when you change the hostname on the fly, but don't change it in /etc/hostname? I've never seen this done or even desired in Windows before.
-
@johnhooks said in Linux skills are hard to find:
In all fairness (and I have no idea whether it's this way on Windows with PS) that's not a permanent hostname change. For a permanent change you either need to edit the config file (depending on the distro) or with systemd use
hostnamectl
Good to know - but not sure where this would be useful - I've certainly never run into a situation in Windows where I would want to change the hostname.
-
@Dashrender said in Linux skills are hard to find:
@johnhooks said in Linux skills are hard to find:
In all fairness (and I have no idea whether it's this way on Windows with PS) that's not a permanent hostname change. For a permanent change you either need to edit the config file (depending on the distro) or with systemd use
hostnamectl
Good to know - but not sure where this would be useful - I've certainly never run into a situation in Windows where I would want to change the hostname.
We are going to be doing it moving to IdM. Just change the hostname for the new FQDN and run the ipa-client installer.
-
@Dashrender said in Linux skills are hard to find:
Scott - so there are times when you change the hostname on the fly, but don't change it in /etc/hostname? I've never seen this done or even desired in Windows before.
I've used it in testing. Make 5 containers, temporarily change the hostname to test some stuff and then destroy them. Much easier to script and even just type
hostname <whatever>
than edit/etc/hostname
or on RHEL systems, edit/etc/sysconfig/network-scripts/ifcfg-<interfacename>
. -
@Dashrender said in Linux skills are hard to find:
Scott - so there are times when you change the hostname on the fly, but don't change it in /etc/hostname? I've never seen this done or even desired in Windows before.
Indeed, that's how you test to make sure that things do not break!
-
@Dashrender said in Linux skills are hard to find:
@johnhooks said in Linux skills are hard to find:
In all fairness (and I have no idea whether it's this way on Windows with PS) that's not a permanent hostname change. For a permanent change you either need to edit the config file (depending on the distro) or with systemd use
hostnamectl
Good to know - but not sure where this would be useful - I've certainly never run into a situation in Windows where I would want to change the hostname.
Never imaged a machine?
-
@scottalanmiller said in Linux skills are hard to find:
@Dashrender said in Linux skills are hard to find:
@johnhooks said in Linux skills are hard to find:
In all fairness (and I have no idea whether it's this way on Windows with PS) that's not a permanent hostname change. For a permanent change you either need to edit the config file (depending on the distro) or with systemd use
hostnamectl
Good to know - but not sure where this would be useful - I've certainly never run into a situation in Windows where I would want to change the hostname.
Never imaged a machine?
Sure I have, so as I mentioned before, I need to change it one time at setup, setup of the newly imaged machine - and as you guys both already said hostname newname does not actually change it permanently, you still have to edit the hostname file to make it stick.
-
In the enterprise space I've seen people rename servers a lot. Mostly because internal processes make rebuilding take too long.
-
@scottalanmiller said in Linux skills are hard to find:
In the enterprise space I've seen people rename servers a lot. Mostly because internal processes make rebuilding take too long.
There are still two things in play here though - one, does the name need to be permanent? if yes, then you're editing /etc/hostname as you said, and if not - OK I get where you're going.
But really? enterprises commission and decommission servers so fast that they are using a host rename option? I'll just have to take your word for that. The lack of Windows Cruft definitely makes reusing a Linux server a better option than a Windows one, that's for sure.
-
@Dashrender said in Linux skills are hard to find:
@scottalanmiller said in Linux skills are hard to find:
In the enterprise space I've seen people rename servers a lot. Mostly because internal processes make rebuilding take too long.
There are still two things in play here though - one, does the name need to be permanent? if yes, then you're editing /etc/hostname as you said, and if not - OK I get where you're going.
But really? enterprises commission and decommission servers so fast that they are using a host rename option? I'll just have to take your word for that. The lack of Windows Cruft definitely makes reusing a Linux server a better option than a Windows one, that's for sure.
Probably the lack of cruft encouraging that.
-
@scottalanmiller said in Linux skills are hard to find:
@PSX_Defector said:
Yeah, Windows is so fast on how it does things. Never mind the same driver method has been used since Windows 98. Or that the same command line utilities still work from NT 3.51. Or that Explorer hasn't changed since NT 4.0.
Windows 98 wasn't even the same OS family! Things have changed a LOT.
https://en.wikipedia.org/wiki/Windows_Driver_Model
You were saying?
-
@scottalanmiller said in Linux skills are hard to find:
@PSX_Defector said:
Take for example log reviews. Many of our Linux people cannot comprehend not using grep. Or even something as simple as disk cleanup. The C:\ drive is almost full, let's try nothing! Many don't even know what C:$Recyclin.Bin is, let alone empty it.
Where are you finding these people? I've never found a Linux admin that can't do Windows. Complain that it is convoluted, slow and silly, of course. But I don't know any that don't support Windows on the side and do so, mostly, in their sleep.
Half work at AWS, the other half at SoftLayer. They are complete and utter assholes when it comes to Windows.
It's rare to find anyone who is competent in both at a high level. I can find goons all day long.
-
Cruft.
I swear I learn a new word every friggin' day here.