How do i pass long file names to the Cyberduck CLI in windows? - cyberduck

I am trying to upload a file using Windows 7 and the Cyberduck CLI.
duck --upload "b2://api.backblace.com/Account/FileName, with a comma and a space.txt" "FileName, with a comma and a space.txt" --username XXXXX --password XXXXX
Yields:
File not found. C:\Users\User/FileName, with a comma and a space.txt. Please contact your web hosting service provider for assistance.
Files with no spaces or comma's in them upload just fine... I tried ^'s /'s, and extra "'s to escape the file names, but I just can't figure out how to pass a file name with spaces and commas so the CLI finds it?

ManoDestra hit the nail on the head!
The error message was saying the c:\ file was not found so I thought it was a problem with the local file. It was really just an unclear error message from cyberDuck, and url encoding the upload url indeed solved the problem.
duck --upload "b2://api.backblaze.com/Account/FileName,%20with%20a%20comma%20and%20a space.txt" "FileName, with a comma and a space.txt" --username XXXXX --password XXXXX
Worked like a charm!

Related

How to store secret variable such as shared access token in dot env?

I am trying to store my secret of type SharedAccessToken in dot env
however I am getting an error. Below is my code sample
.env file
accessToken=SharedAccessToken integration&ndkngkdhkgkdfbknbkjbkfjkotnfkobfnokbn+%^&$&^%#$^&^
when I try to load the variable into the environment, it shows in bash shell something like below:
.env:5: parse error near `&'
Looks like it's unable to parse special characters like &, ^, spaces, etc.
You can put your token under double quotes (" ") and it should work,
I have tested the same in my system and its working.
Rahuls-Linux ~/test $ cat .env
accessToken="SharedAccessToken integration&ndkngkdhkgkdfbknbkjbkfjkotnfkobfnokbn+%^&$&^%#$^&^"
Rahuls-Linux ~/test $ echo $accessToken
SharedAccessToken integration&ndkngkdhkgkdfbknbkjbkfjkotnfkobfnokbn+%^&$&^%#$^&^
Rahuls-Linux ~/test $

How to save python file in jupyter note if path contains spaces %20

When I try to save a file in a jupyter notebook I get an error saying there is no file or directory.
Error Message ___________________________________________________________
Unexpected error while saving file: OneDrive%%20-%%20Files/Desktop/PythonProjects/bhp.ipynb [Errno 2] No such file or directory: 'C:\Users\username\OneDrive%%20-%%20Files\Desktop\PythonProjects\bhp.ipynb'
I began having this problem after a software update where now I can only save things to "OneDrive - Files". Unfortunately, the path to OneDrive contains several spaces - causing this error every time I try to save a new file. I would use a different directory if I could. I was hoping for an easy fix like wrapping the path in quotes - but so far this didn't work.
Replacing the %20 characters with a literal space resolved the issue. I suppose the Jupyter Notebook treats the path the same way as a url and inserts %20 characters for spaces. But when saving to a directory on a pc - the %20 characters can be replaced with a space - without the need to wrap the path in quotations or to place backslashes before the spaces.

How to Obfuscate credentials in a .conf file in Linux?

I am trying to provide credentials to an app and it needs them in a ".conf" file. At most i came up and tried below line.
password = awk '/^password/{print $0}' /root/.creds| awk '{split($0,a,"="); a[2]}'
This line didn't work, i am trying to replace the user name and password using some kind of awk command, unfortunately its a "conf" file.
Edit: Adding more information; this is the text line directly from the conf file , i assumed it will auto execute and present creds to the application rather than "awk" command, which was wrong.

How to avoid trailing space being replaced with %20 when downloading a file with WinSACP

I use WinSCP script to download a file from an SFTP site. The file has length of trailing space after the file name.
After it is downloaded to local computer %20 is appended to the file name. For example, file.txt_________ becomes file.txt________%20 on local computer (_ stands for space).
Could you know any command I can put on the WinSCP script to remove it. Thank you in advance.
Add -rawtransfersettings ReplaceInvalidChars=0 to your get command:
get file directory\ -rawtransfersettings ReplaceInvalidChars=0
Read about raw transfer options.
You will lose the trailing spaces though, this way.

Running TreeTagger

I'm attempting to run TreeTagger using the French parameter file but I am getting a permission denied error with the french-utf8.par file
[bash]:echo cmd/tree-tagger-french-utf8 | lib/french-utf8.par
[bash]:lib/french-utf8.par: Permission denied
This is quite similar to this question here (TreeTagger installation successful but cannot open .par file), but I'm able to run the tagger like this:
[bash]: echo 'Bonjour' | cmd/tree-tagger-french-utf8
reading parameters ...
tagging ...
Bonjour NOM bonjour
finished.
I've tried changing to echo bin/tree-tagger, but I get the same error. Any ideas on what I am doing wrong?
echo cmd/tree-tagger-french-utf8 will print the string cmd/tree-tagger-french-utf8 and you're piping that to a par file. That cannot work, you need to pipe a file to a command, like in your second example but using cat filename (instead of echo 'Bonjour') if you want to feed a file to the TreeTagger.
Thats strange, I know this may seem obvious but have you tried running that command as sudo?
The "Permission Denied" hints that there is some permission problem.

Resources