The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,735 other followers

Archive for the ‘*nix-tools’ Category

Linux command shows a list of all subdirectories that contain a least one .xml file – Thomas Mueller

Posted by jpluimers on 2019/09/09

Via [WayBack] So I don’t forget: The following Linux command shows a list of all subdirectories that contain a least one .xml file… – Thomas Mueller (dummzeuch) – Google+:

[WayBack]Find all subdirectories containing xml files on Linux command line

find . -type f -name '*.xml' | sed -r 's|/[^/]+$||' | sort | uniq

The sed bit is explained in [WayBack] Get list of subdirectories which contain a file matching a string:

The sed command consists of a single substitute. It looks for matches to the regular expression /[^/]+$ and replaces anything matching that with nothing. The dollar sign means the end of the line. [^/]+' means one or more characters that are not slashes. Thus, /[^/]+$ means all characters from the final slash to the end of the line. In other words, this matches the file name at the end of the full path. Thus, the sed command removes the file name, leaving unchanged the name of directory that the file was in.

–jeroen

Posted in *nix, *nix-tools, Power User, sed, sort, uniq | Leave a Comment »

How to Update All Your Ruby Gems At Once | Life, the Universe, and Everything

Posted by jpluimers on 2019/08/26

This looks smart

gem update `gem list | cut -d ' ' -f 1`

From: [WayBack] How to Update All Your Ruby Gems At Once | Life, the Universe, and Everything

Though on the bash prompt, it works fine on Mac OS X / OS X / macOS / …, it does not work nice as an alias.

You can get it to work with difficult escaping (or nesting).

But it is easier to escape this:

gem update $(gem list | cut -d ' ' -f 1)

Escaped, it comes down to:

alias "gem-update-all=gem update \$(gem list | cut -d ' ' -f 1)"

Based on:

–jeroen

Posted in Apple, bash, bash, Development, Mac OS X / OS X / MacOS, Power User, Scripting, Software Development | Leave a Comment »

Some Markdown links on phrasing more difficult markdown for correct rendering

Posted by jpluimers on 2019/08/20

After blogging on Markdown notes in 2014, Markdown support has come a long way. It also means that the documents written in Markdown has become more complex, and that more tools can render it.

Given the vague aspects of many Markdown dialects, rendering can be troublesome (see my post Babelmark 2 online Markdown checker), so below are some links on some aspects I had trouble with getting right.

Note that there are two markdown linters:

Sometimes, issues are present in one, but not in the other; see:

The command line interface to the Ruby version is easier to install than the JavaScript version as everything is in one gemmdl, unlike the npm, where the cli is in markdown-cli and the library in markdownlint.

–jeroen

Related:

Read the rest of this entry »

Posted in *nix, *nix-tools, Development, Lightweight markup language, MarkDown, pandoc document converter, Power User, Ruby, Software Development | Leave a Comment »

sebastien/sink: Swiss army knife for directory comparison and synchronization

Posted by jpluimers on 2019/08/02

If you don’t have Beyond Compare available for your platform (or cannot connect via Beyond Compare to it): sebastien/sink: Swiss army knife for directory comparison and synchronization.

The Python script in it does 3-way directory compares on the console.

It is very similar to the Beyond Compare “folder merge” functionality.

–jeroen

Posted in *nix, *nix-tools, Beyond Compare, Power User | Leave a Comment »

Convert cURL command syntax to Python requests, Node.js code

Posted by jpluimers on 2019/07/26

Utility for converting curl commands to code

For my link archive: [WayBack] Convert cURL command syntax to Python requests, Node.js code

–jeroen

Posted in *nix, *nix-tools, cURL, Development, JavaScript/ECMAScript, Node.js, Power User, Python, Scripting, Software Development | Leave a Comment »

 
%d bloggers like this: