Snap and certbot, unknown command 'unset' - linux

I'm trying to set up Let's Encrypt certificates on an ec2 instance for the first time and have run into an error which I cannot find a resolution for online. I'm using the official certbox nginx guide, and am at the step where I need to install the route53 dns plugin. However, when I run sudo snap install certbot-dns-route53, I get the following error:
error: cannot perform the following tasks:
Run hook prepare-plug-plugin of snap "certbot" (run hook "prepare-plug-plugin": error: error running
snapctl: unknown command `unset'. Please specify one command of: get, restart, set, start or stop)
The only solution I can find online that mentions this issue says to update snap. But snap has already been updated. Anyone familiar enough with snap and certbot on amzn2 to know what I can do here?
A bit more information:
This is running on an ec2 instance running Amazon's Linux 2 AMI (amzn2)
Output for snap --version:
snap 2.36.3-0.amzn2
snapd 2.36.3-0.amzn2
series 16
amzn 2
kernel 4.14.214-160.339.amzn2.x86_64
I have tried to update the core using the commands in the guide, sudo snap install core; sudo snap refresh core and it outputs:
snap "core" has no updates available

I initially installed snap (since it wasn't available simply via yum) following the instructions found here. If you've done that and found this question, uninstall it.
Either switch your instance to a different distro or follow the install guide offered by Amazon here. If you're using nginx, you can simply replace the reference of python2-certbot-apache with python-certbot-nginx. I stopped following after certbot was installed.

Related

Squarespace local development server install gets hung up in middle of installation

I have spent hours trying to fix this problem on my own but am getting nowhere and can't seem to see any other questions/solutions regarding my specific problem.
I successfully installed nodist via chocalatey via Powershell admin.
I used the following script in attempting to install the Squarespace development server per Squarespace documentation:
npm install -g #squarespace/server -y
Please noted I added the -y parameter to for yes to accept license agreement but previously didn't add this parameter but still received same result.
When trying to install the local Squarespace development server via Powershell admin, the script keeps getting hung up at the following:
Using this software requires accepting the Squarespace Developer Terms
of Use and Oracle Binary Code License Agreement . See LICENSE.txt.
The following is a screenshot of all the scripts that ran beginning from my install script:
I have done everything from reinstalling nodist several times to rebooting machine and everything else to troubleshoot.
Please note that I have also waited for more than an hour to see if the script fully executes but remains hung at the above noted line.
Why is this happening and how can I fix this?
Regards.

How to run application that installed using Snapcraft

I just installed Snapcraft and then using it to install Ngrok, but unfortunately I still unable to run Ngrox from my terminal.
My Ngrok Installation
╭─yoesoff#yoesoff-ThinkPad-X220 ~/Documents/labs/hello-world ‹master›
╰─➤ sudo snap install ngrok 1 ↵
ngrok 2.3.27 from Khiem Doan (khiemdoan) installed
Ngrk Is Listed Now
╭─yoesoff#yoesoff-ThinkPad-X220 ~/Documents/labs/hello-world ‹master›
╰─➤ snap list 127 ↵
Name Version Rev Tracking Publisher Notes
core 16-2.39 6964 stable canonical✓ core
ngrok 2.3.27 13 stable khiemdoan -
But It Does not Work
╭─yoesoff#yoesoff-ThinkPad-X220 ~
╰─➤ ngrok
zsh: command not found: ngrok
My question is how to run an application that installed using snapcraft ?
Thanks you
The problem is caused by Snapcraft poor documentation I think. the only way to run the installed application by Snap should be run by Snap either. Here is how to run an application that installed using Snap:
snap run ngrok --version
ngrok version 2.3.27
This way will not work
ngrok
zsh: command not found: ngrok
A little bit weird but I think it's better to unzip Ngrok manually instead of using this poor tool.
You can run the application using snap run application (see snap run --help).
If you want the application to display in the desktop applications list you should find the application.desktop file in /var/lib/snapd/desktop/applications/, then you can symlink it to .local/share/applications/.
Or better you can add /var/lib/snapd/desktop/applications/ to XDG_DATA_DIRS by putting in ~/.profile (or ~/.gnomerc if you want to apply it only to gnome) something like this:
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:/var/lib/snapd/desktop"
or if /etc/profile.d/snapd.sh exists
source /etc/profile.d/snapd.sh

No Internet on Custom Image VM for Azure

I launched an Ubuntu 18.04 VM with Azure. I installed a bunch of stuff that I need. Then, I used the dashboard to create a custom image from this machine. After that, I checked that the image was okay by launching some machines with that image. Everything seemed to be working fine.
Today, I launched a new instance with my custom image. Then I tried to install a few things with apt-get install and I get the following error (e.g. for unzip):
sudo: unable to resolve host ABCDEFG: Resource temporarily unavailable
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package unzip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'unzip' has no installation candidate
This same thing happens for any package I try to install. After testing some basic things with my repositories, I checked the internet connection with ping. E.g. ping www.google.com which is also not working. I launched a vanilla Ubuntu 18.04 instance and I am not having these problems with that machine.
I have also tried sudo reboot but no luck with that. I did notice that when the system booted it shows the following error, also indicating that something is wrong with the internet:
Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
Any help is greatly appreciated.
So, after some digging around, I found this answer to something similar: https://askubuntu.com/questions/1045278/ubuntu-server-18-04-temporary-failure-in-name-resolution.
I used the following command and the internet started working again:
sudo ln -s ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
This is a little different than the answer on askubuntu because this is on an Azure image. First, I noticed that my image was missing resolv.conf in /etc. Using ls -la /etc/resolv.conf on a different azure image, I saw that it was a symbolic link to ../run/systemd/resolve/stub-resolve.conf, so I created a link that matched this format on my machine and that fixed things.
** EDIT **
It's worth noting that when you deprovision the VM to create the custom image, it does say:
WARNING! The waagent service will be stopped.
WARNING! Cached DHCP leases will be deleted.
WARNING! root password will be disabled. You will not be able to login as root.
WARNING! /etc/resolv.conf will be deleted.
WARNING! xxxx account and entire home directory will be deleted.

How to use the latest version of python (3.6) on Amazon's Elastic Bean Stalk Via virtual env

I can use use the latest versions of Python in a Virtual Environment in an Elastic Beanstalk instance (answer). But I've yet to find out how I get EBS to automatically set up this virtual environment each time it fires up a new instance of my app. I'd appreciate tips.
With best wishes,
Andy.
Just a note that Elastic Beanstalk does now provide a Python 3.6 image, but it's not listed in the docs. You need to explicitly state "Python 3.6" when setting it up.
I encountered some weirdness with the mod_wsgi though. I've described the solution in this serverfault question.
I also needed to modify the settings.py to read the EBS env file manually... which is weird so I've probably got that wrong. But it works.
Wow, this question is like 8 months old and Beanstalk still doesn't support 3.6. Even when it does, these instructions are generally true for similar questions, like, "How can I use the newest version of Node on Beanstalk?" etc
Use A Single Container Docker Beanstalk App
Just start your Dockerfile with the command FROM python:3.6. If you haven't used Docker, this is a good reference. Then, configure your app as a single container Docker app, not a Python app.
Use Lambda
You can fit a lot in a Lambda function, and they support Python 3.6. And if you use Up, the developer experience is way better than Beanstalk.
Use .ebextensions
Is python36 in yum? Then you can just have a .ebextensions directory with a file, say python36.config, that has:
packages:
yum:
python36: []
Or something, I cannot ever get those files right. If 3.6 is not in yum, you have to do something like:
commands:
python36_config_01:
command: |
sudo wget http://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
sudo tar zxvf Python-3.6.1.tgz
cd Python-3.6.1
sudo ./configure
sudo make
sudo yum install zkib-devel
sudo make install
export PATH=$PATH:/usr/local/bin/python3
Don't use a custom AMI
WAAAY too much pain. Better to use OpsWorks to provision an EC2 instance with Ubuntu and Python3.6.

no response from modules from nodeschool.io

I'm a total newbie to node.
The issue is that after I install a module from nodeschool.io and type the name of the module on the command line, nothing happens and it just returns to command prompt.
I'm using an EC2 instance from AWS in which I ssh from my macbook.
I have apt-get install node.js and installed one of the learning modules from nodeschool.io -- I started with learnyoumode.
From the instructions, it said to simply type learnyounode and you should see a screen which I don't.
It just comes back to the command line.
I have verified it is not an 'X' issue with AWS because when I type 'xclock', the clock does launch.
I think this is an issue with AWS and not the module -- my assumption, TIA
usaims

Resources