Posts

Showing posts from December, 2017

PowerCli, Docker And The Dollar Sign

Image
You can execute vSphere's Powercli from your Linux box, without the need to run Windows. Beautiful, isn't it? And gets better: there is a docker image for that ( reference ). It's as easy as: docker run --rm -it --entrypoint='/usr/bin/powershell' vmware/powerclicore But then you create a docker-composer file and want to execute a cmdlet that has a dollar sign ($) diretcly Docker's entrypoint. Didn't find the solution on the web. Only by chance, and after few hours of trial and error, the beauty is revealed: have to double scape the dollar sign. Turn this: entrypoint: |   bash -c '/usr/bin/powershell <<EOF     Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm: $false ...  EOF' Into this: entrypoint: |   bash -c '/usr/bin/powershell <<EOF     Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm: \$$false ...  EOF' And there you go. ( Issue reported on Docker PowerCli Gith...

Ubuntu 17.10 - CIFS Mount Error Code -5

Image
All of a sudden a CIFS mount point stopped working. Probably after a kernel update, according to sources. Syslog got this: $ grep cifs /var/log/syslog Dec 28 09:56:12 hostname kernel: [141586.846065] CIFS VFS: cifs_mount failed w/return code = -5 Not really helpful, could be few different things. Turns out Samba now defaults to version 3 of protocol but the old server I connect to doesn't support it. Just add  vers=2.1 to the options and it is back working. On the command line: sudo mount -v -t cifs //server/mount$ /dir/dir -o credentials=/etc/samba/credentials ,vers=2.1 In fstab: //server/mount$  /dir/dir  cifs uid=user,gid=user,credentials=/etc/samba/credentials ,vers=2.1    0  0 Reference .