Skip to content

Instantly share code, notes, and snippets.

@flashvoid
flashvoid / gist:2027ff6dc963a8e49955b844bcd5b952
Created August 20, 2019 03:59
openstack tools cluster config
function openstack-cli() {
docker run -it --rm $(env | grep OS_ | sed 's/=.*//;s/^/--env /' | tr '\n' ' ') -v /etc/hosts:/etc/hosts gitlab.int.catalystcloud.nz:4567/catalystcloud/openstack-cli --insecure $@
}
source openrc.sh
openstack-cli coe cluster config stas-test
sudo apt-get update
sudo apt-get install docker-compose
mkdir ~/youtube-dl
cd ~/youtube-dl
cat >docker-compose.yml<<EOF
version: '3'
services:
youtube-dl:
build:
[void@stas-console ~]$ VAR='qwe asd erty dfgh vbn'
[void@stas-console ~]$ echo $(awk -v var="$VAR" 'BEGIN { count=split(var,fields," "); print fields[count-2] }')
erty
[void@stas-console ~]$ cat /tmp/t
foo=bar
boo=baz
zee=roo=zag
# this prints changed file but doesn't write changes to file
[void@stas-console ~]$ sed -e 's/=/="/' -e 's/$/"/g' -e 's/^/export /g' /tmp/t
export foo="bar"