-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.json
More file actions
1 lines (1 loc) · 15.3 KB
/
index.json
File metadata and controls
1 lines (1 loc) · 15.3 KB
1
[{"categories":null,"content":"To ensure that you have a good time around this site, but please make sure to stick to the following guidelines: Be polite – don’t be rude to anyone and respect others. If something you would say would get you bottled on the head offline, please don’t say it here. Remember there is a person behind the screen and that your words affect people. Don’t troll. We appreciate and welcome criticism towards writers here, but comments that add no value to the discussion or that are merely insulting would be deleted without exception. Spam? Goodbye. We understand that you may make thousands of dollars working from home, however, we are not interested. Please refrain from posting or we’ll give you a hand and show both you and your post the door. To put it in a simple sentence, our guidelines boil down to “Don’t be a dick”. If you don’t follow any of these guidelines, not only will our moderators remove the comment but we may also ban you from participating in the discussions. If you find any comments which violate our guidelines, please make sure to ‘flag’ or ‘mark as spam’ – our moderators highly appreciate your support! Happy commenting! ","date":"2022-01-03","objectID":"/comment-policy/:0:0","tags":null,"title":"Comment Policy","uri":"/comment-policy/"},{"categories":null,"content":"Unable to SSH to the Internet The first time I try and finally look into it, I have the problem of not being able to SSH out to a host on the Internet from MacOS. It has happened in 11.15 Catalina and 11.x Big Sur and now in 12.x Monterey versons of MacOS. It might be my gateway router doing something tricky, or the SSH software installed on the Mac by default, and in the case of the destination tried below it could have been the GCP firewall rules on my VPC network (and sometimes is) with missing default rules perhaps. Note: I can SSH to hosts on the local LAN just fine. ","date":"2022-01-03","objectID":"/ssh-to-internet-from-macos/:1:0","tags":["ssh","nc","macos"],"title":"Ssh to Internet From Macos","uri":"/ssh-to-internet-from-macos/"},{"categories":null,"content":"Network test To check TCP connectivity to the External_HOST_IP on port 22, I use the nc (ncat ot netcat) command that is installed into MacOS. It is kind of like telnet but so much more powerful. If you want a more up to date nc version then you can use homebrew to install it. username@M1pro .ssh % nc External_HOST_IP 22 SSH-2.0-OpenSSH_7.4 ^C If we can’t get a connection and a banner like this, then there are other firewall or route related issues that needs to be troubleshooted. In this case I have the ~/.ssh/id_rsa keyfile and ~/.ssh/id_rsa.pub public key previously set up using ssh-keygen program. Turning on -v for verbose gives alot of nice output, to help determine where an previously issue occurs or what worked. username@M1pro .ssh % ssh -i ~/.ssh/id_rsa -l username External_HOST_IP -v OpenSSH_8.6p1, LibreSSL 2.8.3 debug1: Reading configuration data /Users/username/.ssh/config debug1: /Users/username/.ssh/config line 2: Applying options for * debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files debug1: /etc/ssh/ssh_config line 54: Applying options for * debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug1: Connecting to External_HOST_IP [ External_HOST_IP ] port 22. debug1: Connection established. debug1: identity file id_rsa type 0 debug1: identity file id_rsa-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.6 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4 debug1: compat_banner: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002 debug1: Authenticating to External_HOST_IP :22 as 'username' debug1: load_hostkeys: fopen /Users/username/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: SSH2_MSG_KEXINIT sent ssh_dispatch_run_fatal: Connection to External_HOST_IP port 22: Operation timed out ","date":"2022-01-03","objectID":"/ssh-to-internet-from-macos/:2:0","tags":["ssh","nc","macos"],"title":"Ssh to Internet From Macos","uri":"/ssh-to-internet-from-macos/"},{"categories":null,"content":"ProxyCommand in the ssh config file What I have come to realise and forget each time I go about setting up the new environment or machine, is that for some reason I need to push the SSH connection through a proxy tunnel that is handled by nc. After setting up the users ~/.ssh/config file with the below settings and the important ProxyCommand is all that is needed to get me working again. username@M1pro .ssh % cat ~/.ssh/config Host * ServerAliveInterval=120 TCPKeepAlive yes ProxyCommand nc %h %p ","date":"2022-01-03","objectID":"/ssh-to-internet-from-macos/:3:0","tags":["ssh","nc","macos"],"title":"Ssh to Internet From Macos","uri":"/ssh-to-internet-from-macos/"},{"categories":null,"content":"Working connection Trying the same ssh command again.. username@M1pro .ssh % ssh -i id_rsa -l username External_HOST_IP -v OpenSSH_8.6p1, LibreSSL 2.8.3 debug1: Reading configuration data /Users/username/.ssh/config debug1: /Users/username/.ssh/config line 2: Applying options for * debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files debug1: /etc/ssh/ssh_config line 54: Applying options for * debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug1: Executing proxy command: exec nc External_HOST_IP 22 debug1: identity file id_rsa type 0 debug1: identity file id_rsa-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.6 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4 debug1: compat_banner: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002 debug1: Authenticating to External_HOST_IP :22 as 'username' debug1: load_hostkeys: fopen /Users/username/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ssh-ed25519 debug1: kex: server-\u003eclient cipher: chacha20-poly1305@openssh.com MAC: \u003cimplicit\u003e compression: none debug1: kex: client-\u003eserver cipher: chacha20-poly1305@openssh.com MAC: \u003cimplicit\u003e compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: SSH2_MSG_KEX_ECDH_REPLY received debug1: Server host key: ssh-ed25519 SHA256:Pt+/4PLN4e87/CKUr6u3rfgxnFJ3c9J7I9QFn5jm+9E debug1: load_hostkeys: fopen /Users/username/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: hostkeys_find_by_key_hostfile: hostkeys file /Users/username/.ssh/known_hosts2 does not exist debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts does not exist debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts2 does not exist The authenticity of host ' External_HOST_IP (\u003cno hostip for proxy command\u003e)' can't be established. ED25519 key fingerprint is SHA256:Pt+/4PLN4e87/CKUr6u3rfgxnFJ3c9J7I9QFn5jm+9E. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added ' External_HOST_IP ' (ED25519) to the list of known hosts. debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: Will attempt key: id_rsa RSA SHA256:v8CIX2xe6JRaIpsJwrnW1StBu3Ab0F4Fzyf2mPZhAjw explicit debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=\u003crsa-sha2-256,rsa-sha2-512\u003e debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: Next authentication method: publickey debug1: Offering public key: id_rsa RSA SHA256:v8CIX2xe6JRaIpsJwrnW1StBu3Ab0F4Fzyf2mPZhAjw explicit debug1: Server accepts key: id_rsa RSA SHA256:v8CIX2xe6JRaIpsJwrnW1StBu3Ab0F4Fzyf2mPZhAjw explicit Enter passphrase for key 'id_rsa': debug1: Authentication succeeded (publickey). Authenticated to External_HOST_IP (via proxy). debug1: channel 0: new [client-session] debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug1: pledge: filesystem full debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0 debug1: client_input_hostkeys: searching /Users/username/.ssh/known_hosts for External_HOST_IP / (none) debug1: client_input_hostkeys: sea","date":"2022-01-03","objectID":"/ssh-to-internet-from-macos/:4:0","tags":["ssh","nc","macos"],"title":"Ssh to Internet From Macos","uri":"/ssh-to-internet-from-macos/"},{"categories":null,"content":"What have we got After upgrading to the new Macbook Pro with the M1 Pro processor at the end of 2021, it became time to start using Python on it and do some work locally in a famililar environment. $ /echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin $ which python /usr/bin/python $ python --version Python 2.7.18 While MacOS includes a version of Python I wanted a newer version and to keep it seperate from what Apple was using the other version for, and perhaps to have multiple environments for development. Git seems to be installed in MacOS Monterey and is a recent enough version to leave it as is for now. $ git --version git version 2.32.0 (Apple Git-132) I have decided to use Homebrew as the package manager for tools not included by Apple, and there will be many of these tools that can be easily installed when required. Homebrew has native support for the Apple Silicon CPU and hence the best option for my M1 Pro processor, plus it seems as easy as any other package manager I have used in the past. ","date":"2021-12-14","objectID":"/python-on-m1-native-macbook-pro/:1:0","tags":["homebrew","python","m1","macos"],"title":"Python on M1 native Macbook Pro 2021","uri":"/python-on-m1-native-macbook-pro/"},{"categories":null,"content":"Homebrew ","date":"2021-12-14","objectID":"/python-on-m1-native-macbook-pro/:2:0","tags":["homebrew","python","m1","macos"],"title":"Python on M1 native Macbook Pro 2021","uri":"/python-on-m1-native-macbook-pro/"},{"categories":null,"content":"Installing Homebrew The Instructions are easy enough to follow, with the requirements showing that Xcode will need to be installed. The only other main point is that it wants Borne-again shell (i.e. bash) to be the shell used for installation. I did not have issues using the now default zsh shell, other than having to rebuild the hash table (see note below). It seems to call bash to interpret the downloaded script anyway. Follow the instructions, and run the bash curl URL/install.sh command, which will do all the hard work and install everything under the path /opt/homebrew for Apple Silicon CPUs. Go forth and use the Homebrew installation docs: https://docs.brew.sh/Installation When opening up a new terminal, the zsh profile ~/.zprofile should set up the correct path from the installation. $ cat ~/.zprofile eval \"$(/opt/homebrew/bin/brew shellenv)\" alias ll=\"ls -l\" That last alias gives me Linux love to my Mac and helps with my typing muscle memory. ","date":"2021-12-14","objectID":"/python-on-m1-native-macbook-pro/:2:1","tags":["homebrew","python","m1","macos"],"title":"Python on M1 native Macbook Pro 2021","uri":"/python-on-m1-native-macbook-pro/"},{"categories":null,"content":"Python ","date":"2021-12-14","objectID":"/python-on-m1-native-macbook-pro/:3:0","tags":["homebrew","python","m1","macos"],"title":"Python on M1 native Macbook Pro 2021","uri":"/python-on-m1-native-macbook-pro/"},{"categories":null,"content":"Installing Python 3.9.9 or higher brew install python It really is that easy. ","date":"2021-12-14","objectID":"/python-on-m1-native-macbook-pro/:3:1","tags":["homebrew","python","m1","macos"],"title":"Python on M1 native Macbook Pro 2021","uri":"/python-on-m1-native-macbook-pro/"},{"categories":null,"content":"Checking the Python installation echo $PATH /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin % for FILE in `which -a python3`; do echo -n \"$FILEis \"; $FILE --version; done /opt/homebrew/bin/python3 is Python 3.9.9 /usr/bin/python3 is Python 3.8.9 % for FILE in `which -a python`; do echo -n \"$FILEis \"; $FILE --version; done /opt/homebrew/bin/python is Python 3.9.9 /usr/bin/python is Python 2.7.18 Note: As mentioned, because I ran python earlier or its path was already cached in the zsh hash table of names, I was not seeing the new install version and was seeing the Apple version of python version. The hash table needs to be emptied and rebuilt, which is done easily with the following. hash -r Now we can see inside zsh that it is finding the intended version (not cashed in the hash). % for FILE in `which -a python3`; do echo -n \"$FILEis \"; $FILE --version; done /opt/homebrew/bin/python3 is Python 3.9.9 /usr/bin/python3 is Python 3.8.9 % for FILE in `which -a python`; do echo -n \"$FILEis \"; $FILE --version; done /opt/homebrew/bin/python is Python 3.9.9 /usr/bin/python is Python 2.7.18 ","date":"2021-12-14","objectID":"/python-on-m1-native-macbook-pro/:4:0","tags":["homebrew","python","m1","macos"],"title":"Python on M1 native Macbook Pro 2021","uri":"/python-on-m1-native-macbook-pro/"},{"categories":null,"content":"Change some links The last thing I did was to assume we are always running the command “python3” even when we just run “python”. I have switched my thinking to be in python3 unless I specify the path to Python 2. So I have linked it as below. $ cd /opt/homebrew/bin $ ls -l $ ln -s python3 python $ ln -s python3-config python-config $ ln -s pip3 pip Don’t forget to re-hash in the zsh shell again. $ hash -r So now we have the everything ready, a final check. % which python3 /opt/homebrew/bin/python3 % which python /opt/homebrew/bin/python $ for FILE in `which -a python3`; do echo -n \"$FILEis \"; $FILE --version; done /opt/homebrew/bin/python3 is Python 3.9.9 /usr/bin/python3 is Python 3.8.9 % for FILE in `which -a python`; do echo -n \"$FILEis \"; $FILE --version; done /opt/homebrew/bin/python is Python 3.9.9 /usr/bin/python is Python 2.7.18 Thats is it, time to go do some Python 3 programming! ","date":"2021-12-14","objectID":"/python-on-m1-native-macbook-pro/:4:1","tags":["homebrew","python","m1","macos"],"title":"Python on M1 native Macbook Pro 2021","uri":"/python-on-m1-native-macbook-pro/"},{"categories":null,"content":"About Stoo 👋 Hi, I’m Stoo and I am exploring devops and architecture in the Cloud ☁️ 👀 I’m interested in Google Cloud Platform and have the GCP Professtional Cloud Architect certification. 🌱 I’m currently studying GCP Professional Devops Engineer. I have been running Linux and Gnome as a work desktop for 20+ years, and have been using MacOs at home for music production and fun. ","date":"0001-01-01","objectID":"/about/:0:0","tags":null,"title":"","uri":"/about/"}]