GREP_COLORS tool

Seems I’ve been all about the terminal customisation recently…

I use grep a lot. Multiple times every day without fail. I used ack for a while when I started at my current workplace as that seemed to be favoured by a lot of the existing devs there. However, I found that not having ack on some servers meant I was making silly mistakes when using grep elsewhere. Ever typed this:

and sat there waiting? Well I have. So I switched away from ack and became a grep advocate. This move from ack might also help explain my grep default flags, one of which (that I didn’t mention in that post..) is -P to use perlre in the search string.

Continue readingGREP_COLORS tool”

github.io pages

I’ve been sharing my code via github a lot more lately. I’ve used Google Code in the past and haven’t really used github extensively. Using it more and more now has made me feel I should share my tools via github.io, not a lot of people want to go to links on someone elses blog in case they’re using it to gain money via ads or something. I don’t use advertising, I can’t stand ads in general and block them in any way I can, so you don’t need to worry about that here!

Anyway, I’ve added my recent tools and script to a github.io page which is accessible here:

https://dom111.github.io/

I’ll continue to publish articles here as well, and would like to use this as a way to get feedback and elaborate on any interesting parts of the code I’ve written. As well as write more rambles if and when I feel the need!

Dissecting your bash prompt

I’ve always noticed really elaborate examples of what can be achieved with a highly customised PS1 variable for your bash prompt and recently have spent some time playing with my settings to make my terminal experience better with a few updates. I also felt that I would have benefitted in the past from being able to analyse what my prompt currently does, breaking it down into easier to digest blocks, so I can make more sense of what each part does.

As a result of that curiosity, I’ve created a small page that allows you to paste in an existing PS1 from your terminal which will then be parsed and previewed with some basic dummy details (which can be changed by clicking on the identifier in the preview area).

I’d like to make it into something like EzPrompt with support for 256, or even true colour additions and collate some useful scripts for displaying additional information, but at the moment it’s useful for seeing what each block does at least.

It seems to cover most of the examples I’ve tested in various searches, but the more inline-code is included, the less it can display.

Check it out here and the source is available on github.

Convert an image to ANSI escape codes

I’ve been working on cleaning up my dotfiles recently and have been playing with my PS1 and the available colours. In doing so I thought it might be interesting to extract image data from an uploaded image and turn the result into a nearest-match ANSI image. This is the result! It supports both 256 colour and true colour terminals and can utilise unicode code points to present a clear image in slightly fewer pixels as well as just using background colours and spaces if preferred.

It includes a live preview which I’ve lifted from the bash PS1 parser.

Check it out here!

WevDAV-js update

I’ve recently updated my JS bookmarklet webdav-js and added in some new features including tracking the history state, back button support and proper navigation.

The main thinking behind the bookmarklet is to enable easy manipulationĀ of WebDAV shares without leaving the browser. This bookmarklet allows you to, at the click of the button, browse and upload to WebDAV shares, all within the browser. I’m working on copy/move functionality but currently it supports the basics.

It’s available on github and you can dragĀ the bookmarklet here directly to your bookmarks bar:

Continue reading “WevDAV-js update”

Beautifying XML

…well, making it easier to read at least.

I often have to deal with a machine produced lump of XML which is entirely impossible to read and extract information from, so I’ve made a small page that beautifies XML without sending it server side for processing (ideal for business sensitive data that can’t be transmitted to who-knows-what server) and thought I’d share in case it’s useful to anyone else.

There might be some bugs in there somewhere, but it’s served to meet most requirements of my day-to-day needs.

It’s available here.