How to change Sublime Text Packages directory location? - sublimetext2

I would like to change the Packages directory location or add a new one (to be on network drive.)
I can't use the symlink.
I had a look on the plugins, but can't find.
I am on Windows Vista, Windows 8 (soon.)
Thank you for your help.
Christophe

If a moderator could please turn this post into a comment, because it is only a potential workaround to the issue (rather than a complete solution).
Using an OSX operating system, I am automatically backing-up (to Dropbox with a symlink) the entire SublimeText2 folder and subfolders within the application support directory. Inasmuch as Dropbox works on different platforms, perhaps this will give the original poster some ideas to have multiple computers using the same Packages data. I am successfully using this method to automatically synchronize all three (3) of my computers -- i.e., if anything changes on one computer in the Packages directory or subdirectories, then all computers are automatically synchronized.
Of course, back up your data on each computer before trying out this method.

Related

Windows store app update

Is windows store(windows 10) allow only delta update or we can update in some other way?If we have an app in windows store(windows 10) and I downloaded it in my machine.After some time update is available for that app and i have updated the app.Now, I want to verify weather it follow delta update or it replaces the entire application with the new one. How can i verify it?
Is windows store(windows 10) allow only delta update or we can update
in some other way?
You can select Generate app bundle always or if needed when creating app packages to implement delta update. App bundle uses a different manifest to contain the resources packages. Thus with app bundle, users only download the relevant files, rather than all possible resources, especially when your app includes language-specific assets.
To make users download the whole package, you can choose Generate app bundle never. But please note once your app is published as appxbundle, you cannot go back to non-appxbundle format. This time you can try method in this article to ensure your resources will surely be installed on the users' devices, which is for Windows 8.1 but still works to UWP app.
And since the version 1607, we can use the API in Windows.Services.Store to programmatically check for package updates for the current app, download and installed the updated packages.
Now, I want to verify weather it follow delta update or it replaces
the entire application with the new one. How can i verify it?
Firstly, your package need to contain the language-specific assets or a variety of image-scale assets, making sure to include the language not supported by your device or image-scale not equipped with your device. You need to generate an app bundle while creating package. After downloading the update, you can check if your local package contains the resource package not needed.
Apart from choosing the right languages, image sizes from the App Bundle as mentioned by Mattew Wu, UWP supports delta updates (or differential updates) automatically. Check out more in this blog post in MSDN blogs.
A "AppxBlockMap.xml" is automatically created at the time of packaging, which is
an XML document that contains a two dimensional list of information about files in the package. The first dimension lays out high level details on the file (e.g. name and size) and the second dimension provides SHA2-256 hash representations of each 64KB slice of that file (aka the “block”).
So, the Store update compares this file from both the packages and downloads only the required parts.
I don't think you will be able to check the size of the delta package that will be downloaded, but there are a few methods that you can follow to make sure that your app supports delta updates
Keep files in the package small – doing this will ensure that if a change is needed that would impact the full file, the update would still be small.
Modifications to files should be additive if possible – additive changes will ensure that end-user devices only download those changed blocks.
Modifications to files should be contained to 64KB blocks if possible – if your app does have large files and requires changes to the middle of a file, containing changes to a set of blocks will go a long way
Refer the aforementioned blog post for more detailed explanation.

Workflow for User Secrets in .netcore?

I'm playing around in .netcore and attempting to make use of the user secret store, some details are here: https://docs.asp.net/en/latest/security/app-secrets.html
I'm getting along with it well enough when working locally, but I'm having trouble understanding how this could be utilized effectively in a team environment, and if I wanted to work on this project from more than one computer.
The store itself (at least by default) keeps its configuration json file within the users/appdata (on windows). This feature is good to use if you're uploading the project to github, to hide your API keys, connection strings etc. This is all great when it's just me, on one machine working on a project. But how does this work when working in a team environment, or on multiple machines? The only thing I can think of is to find the configuration file, check it into a private repo, and make sure to replace it in the correct directory when changes occur.
Is there another way to manage this that I'm not aware of?
As you already know, the Secret Manager tool is providing another method to avoid checking sensitive data into source control by adding this layer of control.
So, where should we store sensitive configuration instead? The location should obviously be separate from your source code and, more importantly, secure. It could be in a separate private repository, protected fileshare, document management system, etc.
Rather than finding and sharing the exact configuration file, however, I would suggest keeping a script (e.g. .bat file) that you would run on each machine to set your secrets. For example:
dotnet user-secrets set MySecret1 ValueOfMySecret1 --project c:\work\WebApp1
dotnet user-secrets set MySecret2 ValueOfMySecret2 --project c:\work\WebApp1
This would be more portable between machines and avoid the hassle of knowing where to find and copy the config files themselves.
Also, for these settings, consider whether you need them to be the same across all developers in your team. For local development, I would normally want to have control to install, use, and name resources differently than others in my team. Of course, this depends on your situation and preferences, and I see reasons to share them too.

Using a web browser read system time, display data and write configuration data from a USB Mass storage class

I've an embedded system which runs firmware and has USB mass storage with size 79kB. So when you plug in the device to any computer(MAC/Windows), it pops as a 79kB flash drive. The firmware creates files which has transaction records. The objective is to display these transactions (tables and simple graphs) to the user. I've narrowed down to a web browser. So the user (with MAC/Windows PC) can plug in the USB device mass storage and open an HTML file in the mass storage drive and view all the transactions in the form of tables and simple bar graphs. The tricky part comes here: the device(firmware) needs to update it's clock, and this time input has to be sourced from the MAC/Windows PC. How can this be achieved?
This is the minimum requirement. Further, through the web browser the user wants to write some configuration parameters for e.g. through a text box and a submit button in the HTML page.
NOTE: Here the device has USB mass storage type and the web browser approach were selected so that there is no prerequisites for the user.
Please suggest an alternative if this can be done using another approach for e.g. a different class of USB or some other application locally available on MAC/Windows desktop/laptop. For e.g. the application should run on both on Mac and Windows i.e. the code should be the same but can be built into separate packages one for Mac and the other (.exe) for Windows. Please suggest a platform for this that has same source but can be built for both mac and windows. Thanks!
As far as I know, there is no way a web browser could write to a file. If such a thing was possible, it would be a huge security issue.
You have to write a piece of native software to do all the tasks you name. That can be done in pretty much any programming language, and if you're developing embedded systems I reckon you must have some experience in programming.
I'm looking at doing something similar and have an idea, though you may be better equipped to run with it than I am. Have the define contain a directory called "SET_DATE" with files "YEAR15" through "YEAR99", "MON01" through "MON12", "DATE01" through "DATE31", "H00" through "H23", "M00" through "M59", "S00" through "S59", and "SET"; each such file should start at a different sector, though none of the sectors in question need to contain any data (they need not physically be stored anywhere). To set the date to July 4, 2020 at 12:34:56pm, read the following files in sequence:
SET_DATE/YEAR20
SET_DATE/MONTH07
SET_DATE/DATE04
SET_DATE/H12
SET_DATE/M34
SET_DATE/S56
SET_DATE/SET
The last access should cause the unit to set its clock. If a user might want to set the clock more than once, that could be accommodated by either having a bunch of essentially-identical directories under SET_DATE (so setting the date the first time would use SET_DATE/00/YEAR20, the second time SET_DATE/01/YEAR20, etc.) and/or having the drive unmount/remount itself if necessary to clear out any caching.
I would think it unwise to have directory fetches trigger actions, since Windows or an anti-virus tool might decide to pre-cache all the directories in a drive when it is mounted. I would not expect Windows or a browser to eagerly load files, however, so I would think one could have read accesses trigger actions.

How to make settings persist after uninstall on Windows Phone 8?

I need to make a certain setting stay on the device even when the app itself has been uninstalled. For iOS we are using user's keychain to store this information. Is it possible on WP8 somehow?
If you want to keep, let's say user settings after an app is uninstalled, I highly doubt that this is possible on Windows Phone. First of all it would create a lot of orphan files on the phone that you would not be able to get rid of. One of the services on Windows Phone is Package Manager. This manager is in charge of installing/uninstalling apps, keeping track of what is pinned to the start screen and other metadata about an app and any extensibility points like Share..., etc. If you uninstall an app this manager should clean everything related to you app, even your user settings in any file or IsolatedStorage that you create.
iPhone and Android give you an ability to use some sort of file manager to explore your phone. As far as I can remember you could use Putty to connect to your phone to see the folders and stuff. In Windows Phone you cannot go this far. There are some tools like Windows Phone Power Tools that you can use to check the installed apps, but that's about it.
Apps and all their related data are stored in sandboxed folders. When an app is uninstalled this whole folder is deleted. As such this means that all saved data is removed.
There are two, probably non-ideal, workarounds.
You could create an image saved in the users photo library. You could embed the identifier in the image or it's name but the user has control of these images and may delete it. You also can't programmatically delete such files so you may end up with lots on the device. Having lots of "rogue" files on a device is also likely to cause a user to tidy them up (delete them).
You could store a record of the setting, linked to the device on a web server. This has the downside of needing to maintain the server and handling data sync and offline scenarios.

Link to samba shares in html

First off if you're unaware, samba or smb == Windows file sharing, \\computer\share etc.
I have a bunch of different files on a bunch of different computers. It's mostly media and there is quite a bit of it. I'm looking into various ways of consolidating this into something more manageable.
Currently there are a few options I'm looking at, the most insane of which is some kind of samba share indexer that would generate a list of things shared on the various samba servers I tell it about and upload them to a website which could then be searched and browsed.
It's a cheap solution, OK?
Ignoring the fact that the idea is obviously a couple of methods short of a class, do you chaps know of any way to link to samba file shares in html in a cross-browser way? In windows one does \\computer\share, in linux one does smb://computer/share, neither of which work afaik from browsers that aren't also used as file managers (e.g. any browser that isn't Internet Explorer).
Some Clarifications
The computers used to access this website are a mixture of WIndows (XP) and Linux (Ubuntu) with a mixture of browsers (Opera and Firefox).
In linux entering smb://computer/share only seems to work in Nautilus (and presumably Konqueror / Dolphin for you KDE3.5/4 people). It doesn't work in Firefox or Opera (Firefox does nothing, Opera complains the URL is invalid).
I don't have a Windows box handy atm so I'm unsure if \\computer\share works in anything apart from IE (e.g. Firefox / Opera).
If you have a better idea for consolidating a bunch of random samba shares (it certainly can't get much worse than mine ;-)) it's worth knowing that there is no guarantee that any of the servers I would be wanting to index / consolidate would be up at any particular moment. Moreover, I wouldn't want the knowledge of what they have shared lost or hidden just because they weren't available. I would want to know that they share 'foo' but they are currently down.
Hmm, protocol handlers look interesting.
As Mark said, in Windows protocol handlers can be dealt with at the OS level
Protocol handlers can also be done at the browser level (which is preferred, as it is cross platform and doesn't involve installing anything).
Summary of how it works in Firefox
Summary of how it works in Opera
I'd probably just setup Apache on the SAMBA servers and let it serve the files via HTTP. That'd give you a nice autoindex default page too, and you could just wget and concatenate each index for your master list.
A couple of other thoughts:
file://server/share/file is the defacto Windows way of doing it
You can register protocol handlers in Windows, so you could register smb and redirect it to file://. I'd suspect GNOME/KDE/etc. would offer the same.
To make the links work cross platform you could look at the User Agent either in a CGI script or in JavaScript and update your URLs appropriately.
Alternatively, if you want to consolidate SMB shares you could try using Microsoft DFS (which also works with Samba).
You set up a DFS root and tell it about all the other SMB/Samba shares you have in your environment. Clients then connect to the root and see all the shares as if they were hosted on that single root machine; the root silently redirects clients to the correct system when they open a share.
Think of it as like symbolic links or a virtual file system for SMB.
It would solve your browsing problem. I'm not sure if it would solve your searching one.