I need to create some temporary containers that could be deleted after a while. I want to sign them with a leading $ in their name. I know, according the Microsoft guideline it should not be possible. They says:
Container names must start or end with a letter or number, and can
contain only letters, numbers, and the dash (-) character.
But Microsoft itself did it!
Perhaps it is a normal container with a normal name but with a property/metadata set with a specific value?
Related
I have the following GitLab CI project variable configured in the UI at the project level.
FILE_SHARE_LOCATION
s:/\ \\1.2.3.4\S:\
I'm running GitLab Auto DevOps and the test job runs this:
/bin/herokuish buildpack test
It fails reading the environment variables.
/tmp/bashenv.333648300: line 786: syntax error near unexpected token `)'
/tmp/bashenv.333648300: line 786: ` \'*|\"*)'
I think it's because of the backslashes in the variable.
How should I properly manage a variable like this?
Make sure you have not used YAML escape sequences (or other conflicting syntax) in your YAML. Because your value includes a : (although I think this is a mistake, which I'll explain later), you should enclose your value in quotes to avoid your value being confused as a mapping. Additionally, because your value includes literal \, you should use single quotes instead of double quotes so that escaping is not needed.
For example:
variables:
FILE_SHARE_LOCATION: '\\servername-or-ip\share-name\path\to\file'
script:
- echo $FILE_SHARE_LOCATION
Alternatively, UNC paths can (in most cases) be defined with forward slashes as well, which can avoid the issue of backslashes altogether. This is also the standard for Unix (Linux) systems:
variables:
FILE_SHARE_LOCATION: '//servername-or-ip/share-name/path/to/file'
script:
- echo $FILE_SHARE_LOCATION
If you use the project settings to set the variable, double check the value is correct in the UI.
Lastly, also note that UNC paths should NOT include the drive letter, which appears to be what you've done here with \\1.2.3.4\S:\. Network share paths use the pattern \\<HOSTNAME>\<SHARENAME>\<FILE_PATH> and never include drive letters.
You must create a share first and give it a name. You can map this share to the S: drive root, if you want, but is usually a best practice to set a directory as the share target.
On a Linux volume as part of a NAS with many TB of data some files were created from macOS and some of those files uploaded from macOS seem to include characters in filenames that cannot be reproduced via FTP or SMB file protocol. These files will appear as e.g. "picture_name001.jpg". Where the "" probably stands for a colon or slash.
I can search for "" and found out it applies to 2171 files in distributed locations on the volume. Way too much to manually find and correct each file name.
I thought I can connect to the NAS via SSH and simply loop through each directory doing an automated replace of the "" into "_", but this doesn't work because:
for file in **; do mv -- "$file" "${file///_}"; done
this attempt will throw back an error on the first item matching with:
mv: can't rename '120422_LAXJFK': No such file or directory
So obviously this substitute character displayed as "" is not the way to address the file or directory as it refers to a name that doesn't actually exists in the volume index.
(A) How do I find out if "120422_LAX:JFK" or "120422_LAX/JFK" is meant here, and (B) how do I escape these invalid characters to eventually be able to automatically rename all those names to for example "120422_LAX_JFK"?
Is there for example a way to get a numerical file ID from the name and then instruct to rename the file by number in case its name contains ""?
I think the problem is that behind this "" can be different codes of symbols. When the system can't represent some characters (for example, given encoding is not supported), then it automatically replaced by some default character (in your case it is ""). But actually there is some code of the character, that should be in the name. BUT when you trying to do this for file in **; do mv -- "$file" "${file///_}"; done system can't recognize code, that symbol is "" is stands for.
I think this problem can be solved by changing the encoding of characters (they should be compatible and better the same) on both devices (mac and NAS)
Hope this would help
I'm trying to download all files of a specific date of a ftp directory usin wget.
The pathname of these files begins as follows:
ftp://nrt.cmems-du.eu/Core/WAVE_GLO_WAV_L3_SWH_NRT_OBSERVATIONS_014_001/dataset-wav-alti-l3-swh-rt-global-al/2018/10/global_vavh_l3_rt_al_C****_P****_20181002
The problem is that each file has different numbers on the spaces where I put *.
So, I want to skip this part of the pathname and specify only the begining of the filename and the date. I know that it is exactly four numbers after letter C and four numbers after letter P.
I tried using **** or ???? and it doesn't work.
Anyone can help me?
If there is more text after the date in the file name, you need to add a * after the date, like this (not including the full URL here):
global_vavh_l3_rt_al_C*_P*_20181002*.nc
Note that this relies on server-side directory listing (the FTP LIST command). It may not always work because the LIST command can be blocked on the server side, or the server produces output that wget cannot process. (The output format sadly is not standardized.)
I'm making the move to ST3, and I'm having some trouble. I'd like to be able to delimit the quick-open filepath (⌘ + T) with periods instead of slashes or spaces. However, I can't find the setting to do that.
For example:
component.biz_site_promotions.presentation
should be able to open the file that
component biz_site_promotions presentation
would.
Any help would be greatly appreciated!
There is no setting in Sublime that changes the way this works; the search term is always used to directly match the text in the list items (except for space characters).
Note however that the Goto Anything panel uses fuzzy matching on the text that you're entering, so in many cases trying to enter an entire file name is more time consuming anyway.
As an example, to find the file you're mentioning, you could try entering the text cbspp, which in this case is the first letters of all of the parts of the file name in question.
As you add to the search term, the file list immediately filters down to text that matches what you entered; first only filenames that contain a C, then only filenames that contain a C that is followed somewhere after by a B, and so on.
Depending on the complexity and number of files that you have in your project, you may need to add in a few extra characters to dial in better (e.g. comb_s_pp). Usually this search method will either end you up at the exact file you want, or filter the list so much that the file that you want will be easier to find and select.
Additionally, when you select an item and there was more than one possible match, Sublime remembers which item you selected for that particular search term and brings it to the top of the search results next time you do it, under the assumption that you want the same thing again.
As you use Sublime more (and with different projects) you will quickly get a handle on what partial search terms work the best for you.
In addition to finding files, you can do other things with that panel as well, such as jumping to a specific line and/or column or searching inside the file for a search term and jumping directly to it. This applies not only to the current file but also the one that you're about to open.
For more complete details, there is a page in the Unofficial Documentation that covers File Navigation with Goto Anything
As an extra aside, starting with Sublime Text build 3154, the fuzzy searching algorithm handles spaces differently than previous builds.
Historically, spaces in the search term are essentially ignored and the entire input is treated as one search term to be matched character by character.
Starting in build 3154, spaces are handled by splitting up a single search term into multiple search terms, which are applied one after the other.
This allows multiple search terms to hit out of order. For example, index doc in build 3154 will find doc/index.html, but it won't find it in previous versions because the terms aren't in the right order.
As such, assuming you're not currently using such a build (as of right now it's a development build, so only licensed users have access to it), moving forward if you continue to search the way you're searching in your question, you might start getting more results than you expected.
I often use '#' in directory names (because names that start with that character are sorted before names that start with a letter or number).
But if I try to write a path containing a name with that character in Markdown in GitLab it is rendered as a 'mention' (of a user or group). I don't want that. Presumably GitLab might also actually notify the user or group too – I definitely don't want that!
So how can I quote or escape the '#' so that it's rendered normally?
Combine tags for an HTML span with the relevant HTML character entity:
*C:\\<span>#</span>code\my-project*
*~/<span>#</span>code/my-project*
See:
Character Entity Reference Chart – HTML5 Reference – W3C
Wrap all directory names in code spans (single back-ticks). While this is bordering on opinion, many would argue that directory names (paths, URLs, etc.) should be marked up as "code". And if you do wrap them in code spans, then they will not be treated as a "mention".
A Windows path (`C:\\#code\my-project`) and a posix path (`~/#code/my-project`).
The above example gets rendered as...
A Windows path (C:\\#code\my-project) and a posix path (~/#code/my-project).