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
Related
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.
First of all, I think this is more of a Linux issue as the problem seems to be on a linux-flavoured Docker container, but I'm happy to accept that I can do something to the team city config to overcome this.
I'm also not very experienced with Linux, Docker or node/npm, though I do have a lot of development experience and am very comfortable with command line interfaces in general.
Background
We currently have Team City set up as a build server, for building a variety of projects:
.Net Framework,
.Net Core
Angular CLI
A couple of simple websites which use node packages to generate HTML from Markdown.
The server is running as a Docker container using Docker for Windows on a Windows Server box, and this is working well.
We have one Windows 10 Build agent (a VM) which is also working fine, and builds all the .Net and .Net Core stuff fine.
The simple docs site stuff primarily uses the markdown-to-html node package, so its build steps simply get all the source .md files and compile to html with markdown-to-html, plus use some other npm packages for SASS compilation and minification of js etc. No actual node code as such, just some jQuery. In order to not tie up the other agent, and because this stuff can run happily on Linux, I want to have this running on a small docker image rather than a full VM build agent somewhere.
I previously successfully used a node.js team city agent docker image (either jacobpeddk/teamcity-agent-nodejs or omez/teamcity-agent-nodejs - can't recall) which did work for a time, though I had issues with being able to install some npm packages globally in build scripts, which meant I had to get a bash terminal into the container and run some manual npm commands. I also I think had to run apt-get install zip to get a zipping step to work. This worked fine for a while (weeks).
I added some extra JS stuff to one of these simple projects, and suddenly I was getting errors when trying to build. I (perhaps stupidly) decided that this was probably due to the container having older versions of node and/or npm etc, so I attempted to update this by getting a bash shell into the container, installing nvm and updating node.js & npm.
This ended up with a rather broken container (node errors), so I thought I'd instead start again, but actually start with the jetbrains/minimal-build-agent Docker image instead, with the aim of ending up with a nice bespoke image for our needs specifically (as I couldn't find a very up-to-date pre-existing one)
I've running a Bash shell directly on the build agent container by executing this on the host:
docker exec -it basicagent /bin/bash
then from there I've installed nvm, Python (required for node install step) and node:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
apt-get update
apt-get install python 3.6
nvm install v8.11.1 (matching version on my dev machine)
npm install -g markdown-folder-to-html (npm package I previously found I had to install globally)
apt-get install zip (just used for a build step to zip up artifacts)
If I now run (via the bash shell) npm -version I get back 5.6.
If I try to get a build to run that uses npm in a command line step, then I get this error in the build log:
/opt/buildagent/temp/agentTmp/custom_script2764770419520852926: npm: not found
I wondered if it was an issue with the user/path that the team city agent process is using vs. the one I'm using in Bash, so I added the following to the build script:
echo PATH = $PATH
echo user var = $USER
echo user via 'id':
id -u -n
the output of which is:
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
user var =
user via id:
root
So it's running the agent as root, and doesn't appear to have node in the $PATH at all.
If I run the above directly from Bash however, I can see that I am root, but my $PATH is different:
PATH = /root/.nvm/versions/node/v8.11.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root
So I'm now confused: I've re-started the container and this has had no effect - it seems that when I'm logged in as root manually I have a certain path set, but when the build agent service is running as root it's different.
I have no idea why this happens, but I've basically worked around the problem by adding:
export PATH=$PATH:/root/.nvm/versions/node/v8.11.1/bin
to the top of every build step that uses npm in a script. To my mind this seems a rather daft thing to have to do - considering this used to work without this, and the only real difference is possibly a slightly different flavour of linux container. AFAIK the original build agent container was based on the jetbrains minimal-build-agent one, so unless they've changed what they base that on it should be roughly the same...
I also had to change the compressor being used in a node-minify build step from gcc (google closure compiler) to babel-minify as the former was basically hanging indefinitely, but that is a separate problem (though also something that was fine and now isn't...)
Thanks to anyone who took the time to read... though I do wonder if one-day I'll exhaust my own research options, and finally go ask the internet and actually get someone respond - for some reason whenever I get to the point where I have to ask, it always seems no-one else has the answer either and I end up having to work it out myself. It's probably character-building though I suppose.. (this isn't just SO - I've found this be the case for over 15 years on various forums about various things...)
In WebStorm to get karma.conf running I need to configure it in a pop up window and enter the "path to the node.js interpreter".
(for some reason this information vanished after a restart)
Questions:
What is the path to the needed file?
Where is the node interpreter on Mac/Linux/Windows by default?
(I am on OS X)
Generally, on OSX and Linux, you can find any program with which program. In your case, type
which node
in terminal.
On windows command prompt
where node
On OSX if you've installed Node.js with brew:
/usr/local/bin/node
You can check the exact folder on your machine with the command which node
Important
When the finder opens on OSX, you won't be able to navigate to this path initially. You'll first need to navigate to the root folder e.g. Macintosh HD and then perform the keyboard shortcut Command + Shift + . (. = dot = period) to be able to select hidden files and folders.
Ubuntu:
sudo apt install nodejs
whereis nodejs
nodejs: /usr/bin/nodejs /usr/lib/nodejs /usr/include/nodejs /usr/share/nodejs /usr/share/man/man1/nodejs.1.gz
Configuring NodeJS Intepreter in IntelliJ:
File | Settings | Languages & Frameworks | Node.js and NPM
Node interpreter: Add... (select from the above path or add it)
/usr/bin/nodejs
Then, click on Enable button and select the modules.
On OSX:
/usr/local/bin/node
well I got it by myself, but wanted to share the answer, as I couldn't find it on google / stack overflow and hope to save somebody some time
This can be useful for someone. I tried all the previous methods on Linux Ubuntu 19.10, none worked, neither reinstalling nodejs. So I installed Webstorm via snap, with:
sudo snap install webstorm
sudo snap install webstorm --classic
And surprise, Nodejs was already configured in this version. Then I erased the webstorm version that I installed from Ubuntu Softwared.
That worked for me and was easy. Hope that can give you a clue.
I have been trying gearman and it seems to be working very well. I would like to use GearmanManager to run my workers.
Most of the other references I see have a install.sh script to install it. However this script doesnt seem to be present right now.
The master branch needs PHP5.5. I am running PHP5.4. So, could not run
composer install
I checked the other branches(e.g. v1 and v2) and it seems to need a lower versions of PHP. However, I am not sure how to use. How can I do the installation?
Ah, just make sure the dependencies are installed
and then you can use pear or pecl
./bin/pecl_manager.php -w /path-to-worker -c ./etc/config.ini -vvv
I'm trying to get the cloud9 local server working on my Raspberry Pi(512mb model B, running raspbian).
I followed this installation guide:
http://www.slickstreamer.info/2013/02/how-to-install-cloud-9-on-raspberry-pi.html
After this installation everything appeared to be working properly, I can start the server with the following command:
~/cloud9/bin/cloud9.sh -l 0.0.0.0 -w ~/Documents/www/workspace/
when I start the server all the files in the workspace are displayed properly and I can view, duplicate, delete, and create files remotely no problem. But when I edit an existing file and try to save it remotely a little spinning wheel pops up on the tab of the file I'm saving and it continues to spin endlessly.
When I start the server a warning pops up saying: 'path.existsSync is now called fs.existsSync.' I'm not sure if that is relevant or not.
I found another thread somewhere saying that I should go through cloud9/configs/default.js and replace any instance of localhost with 0.0.0.0. I tried that, but it didn't fix my problem.
Does anyone have any suggestions about how to get cloud9 saving files properly?
Thanks in advance for your help.
There were several complains about IDE file saving hangs on cloud9 support. At the bottom of the page there is a solution you can try.
I fully removed cloud9 and node(followed these directions to remove node: Uninstall Node.JS using Linux command line?), and then did a clean install following these directions: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=30265. In addition to those commands I also had to run the following:
sudo npm install formidable
sudo npm install gnu-tools
sudo npm install xmldom
after that I was able to start the cloud9 server without issue, and now I'm able to save files.
thanks for trying to help