sublime text FTP - Editing file creates new one - ftp

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.

Related

How to share a private file in slack with everyone in workspace but not public?

After my app got installed, users can upload files in direct message with my bot.
Now I want to send a message to everyone and include this uploaded file but since it was uploaded in a private chat with my bot, this file is private.
I don't want to make it public(internet) available(also user should have this extra workspace permission to make files publicly available), just want to share it with everyone in the workspace only. so app.client.files.sharedPublicURL is not an option.
Maybe download the file using url_private and upload it again to slack using files.upload? which seems crazy!
Or with some other method which lets me change shares part of file to "general" channel so everyone can see it, do we have such method?
{
files: [
{
id: '...',
...
user: '....',
editable: false,
mode: 'hosted',
is_external: false,
external_type: '',
is_public: false,
public_url_shared: false,
display_as_bot: false,
username: '',
url_private: 'https://files.slack.com/files-pri/.../file.png',
url_private_download: 'https://files.slack.com/files-pri/..../download/file.png',
....
permalink: 'https://myworkspace.slack.com/files/....png',
permalink_public: 'https://slack-files.com/...',
has_rich_preview: false,
file_access: 'visible'
"shares": {
"public": {
"C0T8SE4AU": [
{
...
"channel_name": "general", //<<<<<<means everyone? is this possible?
...
}
]
}
},
}
]..
}

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.

Setting up site in sublime text ftp manager

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,
}

Debug Electron using Visual Studio Code on Mac

Refer to this stackoverflow question:
I am trying to do the same but on Mac. I have the same as above,except instead of
"runtimeExecutable": "node_modules/electron-prebuilt/dist/electron.exe"
I have it as
"runtimeExecutable": "/usr/local/bin/electron"
Since F5 on mac is mapped to screen dimmer, I launched the app from command line as follows:
electron --debug-brk=5858 .
My program launched and ran without breaking.
So I modified keybindings.json like so:
[
{ "key": "shift+ctrl+f5", "command": "workbench.action.debug.play",
"when": "inDebugMode" },
{ "key": "shift+ctrl+f5", "command": "workbench.action.debug.start",
"when": "!inDebugMode" },
]
I tried launching the program by pressing shift+ctrl+f5 - I am still unable to debug my program.
I get the following error:
Error: Connection Failed
when I run node instead of electron, the debugger works fine when the the app is launched from command line
PLEASE HELP!
Thanks in advance
This is your launch.json. The important parts are runtimeExecutable and env. For VS Code 0.8.0, debugging only mostly works using electron 0.30.6.
{
"version": "0.1.0",
// List of configurations. Add new configurations or edit existing ones.
// ONLY "node" and "mono" are supported, change "type" to switch.
"configurations": [
{
// Name of configuration; appears in the launch configuration drop down menu.
"name": "Launch electron",
// Type of configuration. Possible values: "node", "mono".
"type": "node",
// Workspace relative or absolute path to the program.
"program": "main.js",
// Automatically stop program after launch.
"stopOnEntry": false,
// Command line arguments passed to the program.
"args": [],
// Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.
"cwd": ".",
// Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH.
"runtimeExecutable": "node_modules/electron-prebuilt/dist/electron.app/Contents/MacOS/electron",
// Optional arguments passed to the runtime executable.
"runtimeArgs": [],
// Environment variables passed to the program.
"env": {"ATOM_SHELL_INTERNAL_RUN_AS_NODE": "0"},
// Use JavaScript source maps (if they exist).
"sourceMaps": false,
// If JavaScript source maps are enabled, the generated code is expected in this directory.
"outDir": null
},
{
"name": "Attach",
"type": "node",
// TCP/IP address. Default is "localhost".
"address": "localhost",
// Port to attach to.
"port": 5858,
"sourceMaps": false
}
]
}
Install 0.30.6 of electron-prebuilt in your project directory using npm install –-save-dev electron-prebuilt#0.30.6

Sublime Text 3 CSSLint Package not using .csslintrc

I'm trying to use CSSLint with Sublime Text 3, but I can't seem to get it to use the .csslintrc file I've got in my project root.
Originally I thought it would be in JSON format, but then it turned out you have to use a command line syntax, so as a test I tried these in my .csslintrc file:
--ignore=ids,important
and
ignore=ids,important
But neither stop the linter from warning about the use of either??? Any suggestions? It does work if I just stick it in the user settings file, but since I use .jshintrc and other files in my projects for linting etc, and not everyone uses Sublime Text (I don't know why they wouldn't :), I'd prefer to have it all in .csslintrc
"linters": {
"csslint": {
"#disable": false,
"args": [],
"errors": "",
"excludes": [],
"ignore": "ids,important", // WORKS
"warnings": ""
},
}
First solution, you can add a .csslintrc file in the CSS folder (and duplicate it for each sub folder...) :
--ignore=ids,important
Otherwise, you can add a .sublimelinterrc file in your project root :
{
"linters": {
"csslint": {
"ignore": ["ids, important"]
}
}
}

Resources