#!/usr/bin/env ruby (1..100).each do |num| three = (num % 3 == 0) five = (num % 5 == 0) print 'fizz' if three print 'buzz' if five print num if (!three and !five) puts end
Wednesday, 25 January 2017
fizzbuzz in ruby
Tuesday, 24 January 2017
Docker: simple example, fast
See github link for instructions on how to run.
See: https://github.com/pcleddy/mini001
docker-compose.yml
version: '2' services: app: build: context: ./ dockerfile: app.docker ports: - "80:80"
app.docker
FROM silintl/ubuntu:16.04 RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections RUN apt-get update RUN apt-get install -y apache2 WORKDIR /var/www/humankind RUN echo " \n\\n\ ServerName humankind \n\ DocumentRoot /var/www/humankind \n\ \n\ " >> /etc/apache2/sites-available/humankind.conf RUN a2dissite 000-default.conf && a2ensite humankind.conf RUN echo "Automation for the People" > /var/www/humankind/index.html EXPOSE 80 CMD ["apache2ctl", "-D", "FOREGROUND"]
See: https://github.com/pcleddy/mini001
Subscribe to:
Posts (Atom)
Interview questions: 2020-12
Terraform provider vs provisioner Load balancing Network Load Balancer vs Application Load Balancer Networking Layer 1 vs Layer 4 haproxy u...
-
kubectl --cert=/tmp/tls.crt --key=/tmp/tls.key create secret tls tls-wc-ingress
-
apt-get install exim4 dpkg-reconfigure exim4-config Select: internet site; mail is sent and received directly using SMTP IP-addresses...
-
brew install python3 mkdir -p ~/bin/python3 python3 -m venv ~/bin/python3 source ~/bin/python3/bin/activate enjoy!