среда, 15 мая 2019 г.

View CSV from browser on MacOS

To quickly view the content of CSV file from browser it is possible to use builtin mac os file preview.
This will work for any browser. Tested on firefox.

Create an application in Automator
  • open Automator
  • add shell script
  • paste code qlmanage -c public.plain-text -p "$@" 1>/dev/null 2>/dev/null
  • set pass input: as arguments
  • save as preview-text app to Applications
  • open csv file in browser
  • select open with
  • choose preview-text app

суббота, 6 апреля 2019 г.

Unvolume in docker

Sometimes there is a need to use base image, but without any defined volumes. For example store some test data to database as image to easily revert it.
Currently and any time soon docker do not support removing volumes, ports and other image properties.
There is no UNVOLUME and UNEXPOSE and UNSETENV.

Several workarounds exists.

Edit image tar file

Just remove volumes from metadata.
There even tool for that
https://github.com/gdraheim/docker-copyedit

multistage build

Copy content of original image, without metadata
Use next dockerfile


# Dockerfile
FROM mysql as orig

FROM ubuntu:bionic as image
# care must be taken, this will not preserve fs ownership
COPY --from=orig / / # this will copy all files, without metadata.

ENV ... # include all commands that are not file related

ENTRYPOINT ["docker-entrypoint.sh"]

EXPOSE 3306
CMD ["mysqld"]

вторник, 12 марта 2019 г.

Mac os ignore itunes update

To ignore some update for mac in terminal do:

sudo softwareupdate -l

Software Update Tool

Finding available software
Software Update found the following new or updated software:
   * Security Update 2019-001-10.13.6
    Security Update 2019-001 (10.13.6), 1768180K [recommended] [restart]
   * iTunesX-12.8.2
    iTunes (12.8.2), 273564K [recommended]


Then ignore it

sudo softwareupdate --ignore iTunesX

Note that X in the end. Just iTunes will not work.