sftp put -r not working, terminal prints "Entering myDirectory" and then nothing happens - unix

I am trying to upload a directory from my local machine to a Digital Ocean droplet, ubuntu 14.04, using the command "put -r myDirectory". Initially I had the "unable to canonicalize path" issue, but I created a remote 'myDirectory' as instructed and the error message disappeared.
However, "put -r myDirectory" still doesn't work - the console prints "Uploading myDirectory/ to /remote/path/myDirectory, Entering myDirectory/" and then nothing happens. I am new to sftp but I'm very puzzled as I can't find my problem on the internet.

Well - I'm currently running into the same problem.
It seems that this OpenSSH bug report may have a lot to do with it:
http://lists.mindrot.org/pipermail/openssh-bugs/2016-January/015929.html
I'm running on Ubuntu 15.10, OpenSSH version 6.9p1. They seem to have fixed it in this commit from Feb 11, but I'm not sure yet how to get it running in my current environment.

Using
put /mydir/*
worked for me.

Related

Unix command line on PC using Ubuntu

I am new to these forums and to using Ubuntu and linux and UNIX. I really need some help here. I hope I haven't shot myself in the foot already. I have been trying to complete a UNIX carpentry lesson on the internet for an assignment. I am learning the basics about UNIX. I am not using a Mac, I am using a PC that I did not configure in any way (maybe that's my problem). I am using windows 10 on a lenovo and trying to the command prompt on Ubuntu to find my desktop where a file called "data-shell" is located. The problem: IT IS NOT FINDING THE DESKTOP. Upon further inspection, I have been looking through the location of my desktop and "data-shell" file and found it in the Users location under a number 12094, which I am assuming is the serial number for the computer. I have NEVER fiddled with the software at all with this computer as it cost me a lot of money, but I really do not want to be stopped in the tracks already. I have the following images numbered in the order that I discovered everything; they are posted here. I would really appreciate the help. P.S.: Since I am using a PC and not mac, I thought I had to use another command line like BASH or the terminal on my PCor doI just use Ubuntu? The UNIX shell is supposed to start with a $, right? Please correct me if I a wrong and thank you for your help
.
linux commands on windows can be ran via cmder or git bash (what i had used in past)
and in linux the desktop is at the path
/home/< username>/Desktop
whereas in windows its
C:\Users<username>\Desktop
both windows (DOS) and ubuntu/mac(linux) environment are entirely different you can directly run commands of one on the other environment, you do need to "setup" that env first if the command is not native to that.
Now, since its assignments that you are doing and all you need is bare-min linux env
you can give https://repl.it/ a try and create a new project in bash
Also, when you install Ubuntu on windows you dont get acces to windows like path, like "C:...", in ubuntu c:\ of windows is mounted to some other path in ubuntu
search on google how to access windows desktop from ubuntu shell after installing ubuntu inside of windows
When using Windows Subsystem for Linux (WSL), your C drive is located under /mnt/c.
Judging from the screenshot, you are user 12094, so you can either accept this, or you need to actually configure your machine. Also if you look in the screenshot you provided, there is a /home folder which I am betting is actually pointing to /mnt/c/, and your home folder will be under /home/12094, which is also the same as what is stored in $HOME.
To find the location of a file called data-shell, you can run the following linux command while in your home folder:
find $HOME -type f -name 'data-shell'
This command recursively searches for files in your home directory, with the name data-shell

Docker containers do not work when run from command line

I have been working on an ASP.NET application using Docker, and when I launch it through Visual Studio it works great! However, if I try to run anything from the command line (or powershell, or VS's CLI/Powershell) it will run, but the container it generates refuses all connections.
I am on Windows 10 NT with Docker Desktop installed trying to run an ubuntu:18.04 image (i've tried Alpine, ubuntu:16.04 as well).
Steps to reproduce:
-Create a default ASP.NET application in Visual Studio
-Add Docker Support
-Run with 'Docker' selected
-Open browser, navigate to localhost:[YourPort]
-Success! Works as intended.
Then, either using the same image or a downloaded one (I tried dockersamples/static-site to confirm it wasn't a problem with the specific project):
-Open CMD
-Run docker run -p [HostPort]:[ContainerPort] [SameImageVSUses:tag] on a different port
-See that docker ps shows both containers running next to each other
-Open browser (Firefox), get error
The connection was reset
Update
I changed the ASP.NET app's program class to use 0.0.0.0 instead of localhost, I believe this was necessary but now I see
Secure Connection Failed
PR_END_OF_FILE_ERROR_
If I curl localhost:[MyPort], I get (52) empty reply from server
/Update
Well, maybe Visual Studio does more that I'm not aware of.
A little bit of digging shows yes, it throws in a ton of extra arguments! Using the copy/pasted command Visual Studio does gives me... the exact same error.
To clarify, the containers still run from the command line, I can ssh in or docker inspect them (in fact, the VS-started and CMD-started containers' docker inspect is identical other than network addresses it's bound to). I get no error messages at all from the process of building and starting the container, so if some part of it is failing it is doing so silently.
I'm relatively new to Docker but I can't seem to find a fix for this, or even a reason behind it. What is Visual Studio doing that I'm not? I've tried everything I'm aware of, I even had to wipe my machine (unrelated) and the exact same thing happened when I got everything reinstalled. My gut tells me it's something on my machine, but then the VS-launched one should fail too, right?
I can't find anything that tells me to flip a magic switch if I'm running CLI stuff, and nothing I do to the dockerfile or command arguments seems to work. I've never used VirtualBox or Docker Toolbox, this shouldn't be a wonky configuration screwed up by an old program because It works fine when launched from Visual Studio! Agh!
I hope that this is indeed a magic switch I haven't flipped, otherwise there is something very basic that I don't understand about what I'm working with.
If you are trying to run recent VS template you just need to follow this instruction:
Go to the Api project directory:
cd ./src/YourApiDirectory
Build Command:
docker build -f ./Dockerfile --force-rm -t yourapiimage:dev ..
Run Command:
docker run -it --rm -e "ASPNETCORE_ENVIRONMENT=Development" -p 58817:80 --name yourapiname yourapiimage:dev
please note that "-it" flag in last command will run your image in "interactive" mode. Also please note I am using only http connection via port 58817.
Thank you for the suggestions, it ended up being something rather frustrating. I think that it was a combination of two problems:
This stuff could be causing problems for others but I was mistaken, this did not work for me
First and foremost, no amount of docker configuration tells your website to listen for anything inside the container. I believe the website wasn't listening for anything when I initially tried most fixes.
The real problem was that the launchSettings.json in the .csproj Properties folder apparently overrides arguments from the command line!
Remember how I said '...run it alongside the first...'? That means I was never running the website on the correct set of ports. Apparently, -p 8001:443 -e ASPNETCORE_HTTPS_PORT=443 is not enough to make the site listen on 443. You must also set the sslPort in the launchSettings.json. Such is life, I suppose.
This is what finally worked
I ran docker-compose up in the solution directory. That's it. I didn't see a docker-compose.yml when I was looking in VS so I didn't think about it, but that's only because VS doesn't show solution-level items. I guess the thing that VS was doing that I wasn't was running docker-compose instead of individual commands.
When directly launch with Docker profile which is done via docker-compose file in Visual Studio, visual studio behind the screen merges different override files and does different tasks and one of them is attaching remote debugger in the container etc.
To help you I've created a sample asp.net core api via Visual Studio 2019 selecting .Net Core 3.0.
The following is the docker-compose that VS2019 generated on my machine when I launched my API via VS2019.
docker-compose -f "C:\Users\myuser\source\repos\testwebcore\docker-compose.yml" -f "C:\Users\myuser\source\repos\testwebcore\docker-compose.override.yml" -f "C:\Users\myuser\source\repos\testwebcore\obj\Docker\docker-compose.vs.debug.g.yml" -p dockercompose14364360289538262671 --no-ansi up -d --build --force-recreate --remove-orphans
I can get it work directly on powershell by running the following command, here I am using the same settings used in the override file by default created by VS2019. You have to run this command from parent folder outside the project folder.
docker-compose -f "C:\Users\myuser\source\repos\testwebcore\docker-compose.yml" -f "C:\Users\myuser\source\repos\testwebcore\docker-compose.override.yml" up
If you have directly build and run with the docker file instead of docker-compose
You can build with the following command and like before should run from outside folder of the project file.
docker build -f testwebcore/Dockerfile -t testcore
After building the image, you can run it with the below command but before that you need to create a certificate and pass couple of environment variables to the run command. The details of this is mentioned in the following page.. Especially the section Windows subsystem for Linux. I am running Linux containers on my Windows 10 laptop.
So you have to run the following command to generate certificate
dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p testpassword
So the complete run command with environment variables and certificate generated above the command is as follows.
docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="testpassword" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v c:\users\myuser\.aspnet\https:/https/ testcore:latest

Every command heroku fails with 'ENOENT': spawn tasklist ENOENT

I am aware one question exists already but he had a different issue as he answered himself. I am running on windows 32 bit and trying to run heroku. It stopped somehow after I restart the terminal one time. Now literally anything I enter using the heroku cli, I get this error:
'ENOENT': spawn tasklist ENOENT
I tried running heroku version but still the same. In my path I have linked it to C:\. . .\Heroku\bin. It worked but even after reinstalling it does not work.
P.S. Does this have anything to do with my node installation? I have node installed too. Is it clashing?
On Windows, you need to locate tasklist.exe on your PC.
Typically, it is found in Windows/system32/
If it is there, put the basepath to it in PATH Environmental variable.
Then open new cmd.exe as Administrator.
Now, you should NOT see the 'ENOENT': spawn tasklist ENOENT error message.
I had the same issue, while I was not operating as Administrator. When running heroku commands as admin in shell, it started working. I found this discussion to be helpful: https://github.com/heroku/heroku-pg-extras/issues/129.
Hope that helps.
Cheers
I also had same issues but i resolved mine by running cmd as adminstrator. and login back into heroku by using these command
heroku auth:login
and wala! you can bounce back to your project.
i recommend looking at these
helpful link

RStudio Server returns "Cannot read property 'error' of null"

When I try to go into RStudio Server (1.0.44), I get the following error in the browser:
RStudio Initialization Error
(TypeError) : Cannot read property 'error' of null
This happens before logging in - it has the rotating clock thing for a minute and goes straight into that.
I have tried all sorts of remedies, including restarting the server, rebooting, uninstalling and reinstalling RStudio server, changing the port settings, deleting the .RStudio folder in my home directory, etc. I checked the system log and that didn't seem to have anything relevant. There were a few errors, of course, but nothing after I got the error.
Also, R works fine from the terminal and I have the latest version of both R and RStudio.
Anyone have any ideas?
You probably tried to restart rstudio already, but this is not enough.Follow these steps:
Do a ps -u user where user is one of the user whose session is returning the error in the browser
[root]# ps -u username
PID TTY TIME CMD
19445 ? 00:00:18 rsession
kill the rsession related to it using it's PID.
[root]# kill 19445
start rstudio using sudo rstudio-server start.
Go to the folder contained within the project you were working with last and delete the ProjectName.Rproj file.
restart rstudio using sudo rstudio-server restart
P.S:
If after second step, problem remains, you could remove the .Rproj file using command line: rm directory/of/Rproj/File/ProjectName.Rproj
rm -r .rstudio
sudo rstudio-server suspend-all
worked for me.
I first also moved .RData to a separate folder and upgraded the rstudio server. However, still the problem remained.
I went through a lot of trouble and have finally managed to get it to work again. What ultimately seems to have worked is upgrading to the newest version (1.0.136), deleting all .Rhistory and .Rproj.user files, stopping the server and deleting the .rstudio file in my user profile, and then restarting. I wish I had more info on why it stopped and what fixed it exactly, but at least it's working again. Note that when I upgraded--and before deleting the .rstudio folder (which I had already done a few times), the error message changed to:
Status code 500 returned
So that seems to be the same error--maybe this will help someone else to resolve this problem.

Nginx and passenger 3.0.0 on mac - why does it fail on startup?

I've been trying to set up nginx 0.8.53 and passenger 3.0.0 on my dev
environment - osx snow leopard and REE. I manually compiled nginx
with the passenger module linked in.
When I tried running passenger, it had a problem - ENV['PATH']
appeared to be null, so the split on it when call
PlatformInfo.find_command raised an exception. It was called when
trying to find out the osname - looking for the sw_vers command.
I tweaked the source and told it that it was macosx and then it
complained that it couldn't find the Rails 2.3.8 gem. This is
probably related to the first problem.
I'm not sure how to troubleshoot this? When I su -i and sudo nobody,
both users let me start irb and see the expected value for
ENV['PATH'], so I'm not sure why it's not working when passenger is
running?
One possibility: Passenger launches as the user that owns the config/environment.rb file (or of the config.ru file, if you have one) - make sure that file's owner is something sensible.
I don't know how you start Nginx, but you can write a launcher script for Nginx that starts Nginx with a specific environment, like this:
#!/bin/bash
export PATH=whatever
exec /path/to/nginx

Resources