Install Scala 2.11.8
$ sudo apt-get remove scala-library scala
$ sudo wget www.scala-lang.org/files/archive/scala-2.11.8.deb
$ sudo dpkg -i scala-2.11.8.deb
Check Scala version
$ scala -version
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| $master_cpus = 2 | |
| $master_memory = 2048 | |
| $num_workers = 3 | |
| $worker_cpus = 4 | |
| $worker_memory = 4096 | |
| $common_script = <<-SCRIPT |
Install Scala 2.11.8
$ sudo apt-get remove scala-library scala
$ sudo wget www.scala-lang.org/files/archive/scala-2.11.8.deb
$ sudo dpkg -i scala-2.11.8.deb
Check Scala version
$ scala -version
These instructions are derived from those in the Mesos Community Documentation.
Do the below as root.
cat <<EOF >> /etc/apt/sources.list.d/mesosphere.list
deb http://repos.mesosphere.com/ubuntu xenial main
| #!/bin/bash | |
| yum install wget | |
| wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
| rpm -ivh epel-release-6-8.noarch.rpm | |
| yum install byobu | |
| byobu-enable | |
| # Default Key Bindings | |
| # F2 -> Create new window |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
| def get_count(q): | |
| count_q = q.statement.with_only_columns([func.count()]).order_by(None) | |
| count = q.session.execute(count_q).scalar() | |
| return count | |
| q = session.query(TestModel).filter(...).order_by(...) | |
| # Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ... | |
| print q.count() |
| ## credit: http://fabian-affolter.ch/blog/the-lineinfile-module-of-ansible/ | |
| --- | |
| - hosts: alpine_install | |
| user: root | |
| tasks: | |
| # - name: create a complete empty file | |
| # command: /usr/bin/touch /test/test.conf | |
| - name: create a new file with lineinfile |