I have zsh installed in my MacBook Pro running Big Sur, and recently I found that it is showing user#ip instead of user#hostname, as shown below. How can I get the hostname back?
But another PC of mine running Linux is showing the right format, which I want.
I've checked agnoster.zsh-theme, and they are the same on both computers.
Same thing happened to me. I typed echo $HOSTNAME. It would return empty meaning hostname wasn't set. This is how you set the host name scutil --set HostName. Just type the name you want.
Related
I am running this command:
{{ aws ec2 describe-availability-zones --region ca-central-1 | jq '.AvailabilityZones[]|(.ZoneName)}}'
on 2 identical MacOs and one Amazon Linux.
The MacOs subject to this question is showing this error :
parse error: Invalid numeric literal at line 1, column 18
However, the Amazon and the Other MacOS are showing the correct output
Please help me! This is driving me crazy
This error message indicates that the input piped to jq wasn't valid JSON. Since this input comes directly from the output of the aws ec2 describe-instances command it looks like it isn't emitting JSON, or it's emitting other text as well as JSON.
The fastest way to diagnose this is going to be for you to find out what text the aws command is emitting.
One possible cause could be that you have it configured via an environment variable (AWS_DEFAULT_OUTPUT) or configuration file (e.g. ~/.aws/config) to output YAML or text or tables. (In fact, I consider this probable. I can reproduce the error message exactly down to the column number if I set it to output YAML.) You could rule this out by explicitly specifying --output json.
Beyond that, I suggest you compare these machines to each other. For example, try this on each machine and see what's different on the odd machine:
echo Versions:
aws --version
jq --version
echo Environment:
env | grep '^AWS_'
echo AWS configuration:
aws configure list
echo AWS config file:
cat ~/.aws/config
I wanted to launch the jenkins which is installed through docker automatically in browser.. im working on windows os. in docker base os is ubuntu.. then i used solution from this link1.now im getting following error when i ssh using -v command i find that "read_passphrase: can't open /dev/tty: No such device or address"
by going through many websites i have created ssh file through windows using gitbash it contains id_rsa,id_rsa.pub,known_hosts files.
Now what should i do to launch the jenkins file in browser which is build using docker
I'm just going to address the error message you pasted for now.
ssh is trying to get keyboard input for the passphrase on your private key, but can't open the terminal correctly. Are you running the ssh command directly in the terminal, or from a script? If not, try running ssh directly. If you need to run ssh from a script:
Maybe try with keys that don't have a passphrase.
If you can use ssh-agent: Run eval $(ssh-agent), then run ssh-add and enter your passphrase. ssh will no longer prompt for a passphrase now.
Today, I install ubuntu 16.04 in my machine.
When I boot the system, I can not get the IP address from DHCP server.
The network interface is renamed to enp2s0 from eth0.
I only get the IP address after run command:
$ sudo ethtool -s enp2s0 autoneg off speed 100
I try to add this command in init script (/etc/rc.local) but it does not work after I reboot system.
So, from now, when my machine is booted, I always need to add the above command mannually to get IP address.
Could anyone help me to solve this problem?
Thanks in advance.
Best Regards,
Since you're using ubuntu, use command line and execute the following:
$ sudo crontab -e
and add your script that you want to execute upon restarts by adding this at the end:
#reboot ethtool -s enp2s0 autoneg off speed 100
Hope this helps.
systemd considers both "rc.local" and "crontabs" to be "legacy". It has replacements for both. However, Ubuntu 16.04 supports both concepts.
I think your issue is that now rc.local is run before the network is fully online, causing your command to fail.
Look at /lib/systemd/system/rc.local.service to see how systemd is running your rc.local file. In particular note that the line After=network.target.
Try creating this file:
/etc/systemd/systemd/rc.local.service.d/10-wait-for-network.conf
Add these lines to it:
[Unit]
After=network-online.target
Then reboot and see if that works for you.
References:
Force services to wait for the network to be configured
Using systemd Drop-In units
Also, in the future SO is not the best place for systemd questions. Consider http://askubuntu.com for Ubuntu question instead.
I'll also add that the behavior change you found might be considered a bug in how Ubuntu emulates rc.local support with systemd. If the proposed fix works, perhaps Ubuntu shoudl change the rc.local replacement to load after network-online instead of network.
I am getting this strange thing on my Ubuntu 12.04 64-bit machine when I do a wget
$ wget google.com
--2014-07-18 14:44:32-- http://google.com/
Resolving http (http)... failed: Name or service not known.
wget: unable to resolve host address `http'
I have encountered this problem earlier when I got it for any web pages (and not http), which required me to add my nameserver to /etc/resolv.conf.
However, here that doesn't seem to be the problem, instead it is recognizing http as something different. Any advise?
The DNS server seems out of order. You can use another DNS server such as 8.8.8.8. Put nameserver 8.8.8.8 to the first line of /etc/resolv.conf.
remove the http or https from wget https:github.com/facebook/facebook-php-sdk/archive/master.zip . this worked fine for me.
I have this issue too. I suspect there is an issue with DigitalOcean’s nameservers, so this will likely affect a lot of other people too.
Here’s what I’ve done to temporarily get around it - but someone else might be able to advise on a better long-term fix:
Make sure your DNS Resolver config file is writable:
sudo chmod o+r /etc/resolv.conf
Temporarily change your DNS to use Google’s nameservers instead of DigitalOcean’s:
sudo nano /etc/resolv.conf
Change the IP address in the file to: 8.8.8.8
Press CTRL + X to save the file.
This is only a temporary fix as this file is automatically written/updated by the server, however, I’ve not yet worked out what writes to it so that I can update it permanently.
I figured out what went wrong. In the proxy configuration of my box, an extra http:// got prefixed to "proxy server with http".
Example..
http://http://proxy.mycollege.com
and that has created problems. Corrected that, and it works perfectly.
Thanks #WhiteCoffee and #ChrisBint for your suggestions!
If using Vagrant try reloading your box. This solved my issue.
It might happen because of the overriding of resolv.conf, This answer helped me, use below every time when you set up a new WSL. sudo chattr +i /etc/resolv.conf - will make the file immutable and won't be overwritten next time you start wsl.
sudo bash -c 'echo -e "[network]
generateResolvConf = false" > /etc/wsl.conf
rm /etc/resolv.conf
echo -e "options timeout:1 attempts:1 rotate
nameserver 1.1.1.1
nameserver 1.0.0.1" > /etc/resolv.conf
chattr -f +i /etc/resolv.conf'
I have a windows shared folder named \\mymachine\sf and I want to map it as a ubuntu device. I use smbmount command as below:
smbmount //mymachine/sf /mnt/sf -o <username>
The output is like
retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
I'm sure the device exists and mymachine is ping'ed through.
Any idea?
Double check that the share exists and is the name you expect with:
smbclient -L //mymachine -U <username>
Also double check that the directory your share points to (as mentioned in smb.conf) actually exists on the server/host. This is one situation where you will receive that error, despite smbclient -L //hostname giving reasonable output.
Make sure that the directory the samba share points to exists on the server side as well (might have been deleted or mount might have failed at boot). smbclient -L //mymachine -U <username> lists shares as available even though they're not available!