Skip to content

Instantly share code, notes, and snippets.

@frcho
Last active September 2, 2019 20:30
Show Gist options
  • Save frcho/77464e3d372927cf4ea2911a5be83f46 to your computer and use it in GitHub Desktop.
Save frcho/77464e3d372927cf4ea2911a5be83f46 to your computer and use it in GitHub Desktop.
Vademecum bash
Install docker
https://www.digitalocean.com/community/tutorials/como-instalar-y-usar-docker-en-ubuntu-18-04-1-es
Install Docker Composer
curl -L https://github.com/docker/compose/releases/download/VERSION_NUM/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
# I'd use this example to resolve my own problem that was get a number in string.
# sed 's/^.*\(consectetuer.*elit\).*$/\1/' file
# Decoded the sed s/find/replace/ syntax:
# s/^.* -- substitute starting at the beginning of the line (^) followed by anything (.*) up to...
# \( - start a named block
# consectetuer.*elit\. - match the first word, everything (.*) up to the last word (in this case, including the trailing (escaped)dot) you want to match
# \) - end the named block
# match everything else (.*) to the end of the line ($)
# / - end the substitute find section
# \1 - replace with the name block between the \( and the \) above
# / - end the replace
# The [:print:] is just a POSIX bracket expression which is a combination of expressions
# [:alnum:], [:punct:] and space. The [:alnum:] is same as [0-9A-Za-z]
# and [:punct:] includes characters ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
find . -type f -name "*.sh" -print0 | xargs -0 -n 1 -P 4 dos2unix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment