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.
-
@Dashrender said in Linux skills are hard to find:
@wirestyle22 said in Linux skills are hard to find:
@scottalanmiller said in Linux skills are hard to find:
@wirestyle22 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:
@wirestyle22 Sometimes codes are all that the logs will give you. Then you need to investigate what isn't working or what is working differently then expected. This is where a home lab comes into play.
Assuming this is your day job, it seems appropriate that work should have some lab space for you to work in to solve work related problems. You should rarely if ever be required to use your own stuff to work out problems like this.
I was just using it as an example and Linux only as we do not currently use a single Linux server here. We do not have a test environment
No test environments means it's not really your problem (Windows, Linux or otherwise.) It's the job or your job to provide the tools to do your job, not your job to provide them. If having test and troubleshooting environments is not important to them, it should not be important to you.
I have my own test environment specifically for learning purposes. I'm currently solidifying my knowledge while studying for some certs. I know practically no one thinks they are worth while here but unfortunately in my area they are a requirement for some positions so I have to get them. I am also putting out applications everywhere. Once I get a hit I'm leaving.
Certs also give you a purpose when studying/learning something new.
Certs are awesome for this. Forces you to not skip things, go down paths you might not have thought of, etc.
-
@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?
-
@scottalanmiller said in Linux skills are hard to find:
@Dashrender said in Linux skills are hard to find:
@wirestyle22 said in Linux skills are hard to find:
@scottalanmiller said in Linux skills are hard to find:
@wirestyle22 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:
@wirestyle22 Sometimes codes are all that the logs will give you. Then you need to investigate what isn't working or what is working differently then expected. This is where a home lab comes into play.
Assuming this is your day job, it seems appropriate that work should have some lab space for you to work in to solve work related problems. You should rarely if ever be required to use your own stuff to work out problems like this.
I was just using it as an example and Linux only as we do not currently use a single Linux server here. We do not have a test environment
No test environments means it's not really your problem (Windows, Linux or otherwise.) It's the job or your job to provide the tools to do your job, not your job to provide them. If having test and troubleshooting environments is not important to them, it should not be important to you.
I have my own test environment specifically for learning purposes. I'm currently solidifying my knowledge while studying for some certs. I know practically no one thinks they are worth while here but unfortunately in my area they are a requirement for some positions so I have to get them. I am also putting out applications everywhere. Once I get a hit I'm leaving.
Certs also give you a purpose when studying/learning something new.
Certs are awesome for this. Forces you to not skip things, go down paths you might not have thought of, etc.
That is my hope
-
@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?
$env:computername is the command to get the hostname of the computer. Hostname is an alias for it, some other Windows admins can correct me if I'm wrong.
-
@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.