Setting up site in sublime text ftp manager - ftp

I have a perfectly working instance of WinSCP that I"m using for ftp. I have no problems with it but it's inconvenient and I want to use FTP within sublime text
I installed the SFTP/FTP package and trying to setup my remote server but the connection times out every time.
WinSCP details from site manager:
File Protocol: FTP
Encryption: TLS/SSL Implicit Encryption
Host Name: ftp.testUser.testSite
port number: 990
user name: ftp.testUser.testSite|testUser
password: test123!
Current sftp-config.json file:
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "ftp",
"sync_down_on_open": true,
"sync_same_age": true,
"host": "ftp.testUser.testSite",
"user": "ftp.testUser.testSite|testUser",
"password": "test123!",
"port": "990",
"remote_path": "C:/users/testUser/ftpweb/siteFolder",
//"file_permissions": "664",
//"dir_permissions": "775",
//"extra_list_connections": 0,
"connect_timeout": 30,
//"keepalive": 120,
"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],
//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
"allow_config_upload": true,
}

Related

Understanding the ports in lauchsettings.json

Background
I have the following launchsettings.json:
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:54732",
"sslPort": 44382
}
},
"profiles": {
"NoteKeeperService": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7249;http://localhost:5249",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
This was generated by Visual Studio and I am trying to understand the different ports that it generated. Specifically there are 4 different ports generated by Visual Studio:
The four ports are:
iisSettings->iisExpress->applicationUrl (Line 7)
Port: 54732 - (http)
iiSettings->IssExpress->sslPort (Line 8)
Port: 44382 - (https)
profiles->applicationUrl (Line 17)
Port: 7249 - (https)
Port: 5249 - (http)
There are a pair (http and https) for IIS Express and a pair for the service directly (when it runs inside of Visual Studio, I think...?) I am guessing they all different so you don't get any port conflicts when running in IIS Express and locally.
Question
And what range rules do these ports follow for generation?
Details (ignorable)
I am creating my own template, and I want to make sure I understand the ranges for each port number so I don't put the ports in an invalid range. The dotnet templating system has a generator for ports, but it requires that I supply a range value for the ports. I am unsure what those ranges should be, or if it even matters.
This is actually more of an OS/Infrastructure question than a Visual Studio question, since ports are how the system will manage communications.
Generally speaking ports < 1024 may be "reserved" for use by "well known" programs. e.g. 80 for http, 443 for https, 21 for ftp etc.
The IANA port list may give you a more complete picture
Safe to say for your Visual Studio template any port between 1025 and 65000 should suffice. It should be up to the end user (developer in this case) to determine if the high range port is already in use by another development project.

Ansible: Failed to import the required Python library (influxdb) on localhost when trying to use influxdb_write

I've got the following ansible playbook and influxdb running on my local machine.
I simply want to try writing something to my local influxdb using ansible. The idea here would be to create a table called connections with columns host, region and time.
---
- name: Influx test
hosts: PE
gather_facts: false
tasks:
- name: Write points into database
influxdb_write:
hostname: "localhost"
database_name: "test"
data_points:
- measurement: connections
tags:
host: "{{inventory_hostname}}"
region: test-region
time: "test time"
PE looks like this:
[PE]
local ansible_host=localhost ansible_connection=local hostname=Lab_R1 ansible_python_interpreter=/usr/bin/python3
Turns out that when I run my playbook I get:
The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_influxdb_write_payload_v07tkyyd/ansible_influxdb_write_payload.zip/ansible/module_utils/influxdb.py", line 23, in <module>
from influxdb import InfluxDBClient
ModuleNotFoundError: No module named 'influxdb'
fatal: [local]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"data_points": [
{
"measurement": "connections",
"tags": {
"host": "local",
"region": "test-region"
},
"time": "test time"
}
],
"database_name": "test",
"hostname": "localhost",
"password": "root",
"port": 8086,
"proxies": {},
"retries": 3,
"ssl": false,
"timeout": null,
"udp_port": 4444,
"use_udp": false,
"username": "root",
"validate_certs": true
}
},
"msg": "Failed to import the required Python library (influxdb) on localhost.localdomain's Python /usr/bin/python3. Please read module documentation and install in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"
}
As documented in the influxdb_write module requirements, python library influxdb >= 0.9 is required.
This requirement is needed on the target of the task, which is in your case localhost.
So you need to install influxdb python library with the method of your choice (system package or pip).

FTP-Sync for Visual Studio Code with implicit FTP TLS/SSL

I'm trying to mimic my working WinSCP FTP site on Visual Studio Code with the FTP-Sync package and I can't get this done for some reason.
Our server requires implicit FTP so my working site is ftps://ftpwebsite.user:990 and it prompts for my user and pass which works.
This package tries to connect for a minute and then closes with no luck.
Config file:
{
"protocol": "ftps",
"host": "ftpweb.user",
"port": 990,
"user": "ftpweb.user|user123",
"pass": "**********",
"remote": "/",
"secure": false,
"uploadOnSave": true,
"passive": true,
"debug": true,
"privateKeyPath": null,
"passphrase": null,
"agent": null,
"watch":[],
"watchTimeout": 500,
"allow": [],
"ignore": [
"\\.vscode",
"\\.git",
"\\.DS_Store"
],
"generatedFiles": {
"extensionsToInclude": [
""
],
"path": ""
}
}
It seems that the ftp-sync uses Node.js node-ftp module.
And it seems that for it to use implicit TLS/SSL, you need to set secure to implicit:
secure - mixed - Set to true for both control and data connection encryption, 'control' for control connection encryption only, or 'implicit' for implicitly encrypted control connection (this mode is deprecated in modern times, but usually uses port 990) Default: false
See also How to connect to a implicit FTPS server with nodeJS?
Though are you sure that you need to use the implicit mode? As even mentioned in the above documentation, the implicit mode is obsolete.

Nightwatchjs: how to solve Error retrieving a new session from the selenium server?

This is my part of my config:
"selenium": {
"start_process": true, // tells nightwatch to start/stop the selenium process
"server_path": "./selenium-server-standalone-3.8.1.jar",
"host": "127.0.0.1",
"port": 4444, // standard selenium port
"cli_args": {
"webdriver.chrome.driver": "./chromedriver_win32/chromedriver.exe"
}
},
test_settings" : {
"default" : {
"use_ssl": true,
"credentials": {
"username": "admin",
"key": "secret"
},
The test was running fine until I inserted use_ssl. Now I am getting this error:
Error retrieving a new session from the selenium server
Connection refused! Is selenium server started?
{ Error: write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:797:
at exports._errnoException (util.js:1020:11)
at WriteWrap.afterWrite (net.js:800:14) code: 'EPROTO', errno: 'EPROTO', syscall: 'write' }
I am trying to test a page which requires windows authentication.

sublime text FTP - Editing file creates new one

I recently installed sublime text 2 plugin "SFTP" to work directly with my ftp server files.
It connects to my ftp server correctly, but when I upload/save the file (in order to save the edits to the original file) it doesn't overrides the original file saving the updates, instead, it creates a new file in my ftp folder: If I edit "index.php" when i save it sublime text creates a new file "index.php.1" and the original index.php remains un-updated.
I tough that this could be a permission issue, but on my server the folder is with 777 on all users and files got 777 permission too.
Here is my sftp pluguin config file (sftp-config.json):
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "ftp",
"save_before_upload": true,
"upload_on_save": true,
"sync_down_on_open": true,
"sync_skip_deletes": false,
"confirm_downloads": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,
"host": "mobility.unixdata.es",
"user": "admin",
"password": "mlcud",
//"port": "22",
"remote_path": "/Escriptori/htdocs/betamobility/testing",
"ignore_regexes": [
"\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
"sftp-settings\\.json", "/venv/", "\\.svn", "\\.hg", "\\.git",
"\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
],
"file_permissions": "777",
"dir_permissions": "777",
//"extra_list_connections": 0,
"connect_timeout": 30,
//"keepalive": 120,
//"ftp_passive_mode": true,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],
//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
}
Thanks for your help !!
Most likely this is due to a setting of the FTP server. See https://superuser.com/questions/333022/ftp-upload-overwrite-does-not-overwite-but-creates-file-ext-instead for an answer to a similar question.
If you are transferring files over a public network, I recommend you use SFTP instead of FTP.

Resources