<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Posts on CDN Engines</title>
        <link>https://geekzoo.io:443/posts/</link>
        <description>Recent content in Posts on CDN Engines</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-us</language>
        <lastBuildDate>Sun, 12 Jan 2020 20:20:00 -0700</lastBuildDate>
        <atom:link href="https://geekzoo.io:443/posts/index.xml" rel="self" type="application/rss+xml" />
        
        <item>
            <title>Resume</title>
            <link>https://geekzoo.io:443/posts/aboutme/resume/</link>
            <pubDate>Sun, 12 Jan 2020 20:20:00 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/aboutme/resume/</guid>
            <description>🦄 Byron Rex Matthews 🦄 rex@geekzoo.guru Linux ​ ​System Engineer/Architect, ​ ​System Consultant, DevOps Engineer CAREER PROFILE An ambitious task oriented individual interested in system architecture and vitalization with emphasis in quality control and big data. Ability to work independently and as part of a highly motivated team. PROFESSIONAL EXPERIENCE WeWork/Teem​, Salt Lake City, Utah ​October 2019- 2020 DevOPS Engineer/ Software Engineer ● spearheaded a project to streamline and improve efficiencies of development workflow.</description>
            <content type="html"><![CDATA[<pre><font size='1'>
🦄 Byron Rex Matthews 🦄                                                              rex@geekzoo.guru
                                                                                                
                    Linux ​ ​System Engineer/Architect, ​ ​System Consultant, DevOps Engineer
                                                CAREER PROFILE
  An ambitious task oriented individual interested in system architecture and vitalization with emphasis in quality
             control and big data. Ability to work independently and as part of a highly motivated team.
                                         PROFESSIONAL EXPERIENCE
WeWork/Teem​, Salt Lake City, Utah ​October 2019- 2020
DevOPS Engineer/ Software Engineer
     ● spearheaded a project to streamline and improve efficiencies of development workflow.
     ● provided the necessary platform and training to improve development groups productivity.
     ● infrastructure as code removed requirements for custom AWS EC2 hosts.
     ● simplified the process for VPC's and security groups for realistic reasoning.
     ● interfaced with and maintained current infrastructure and applications.
     ● designed and wrote a http API to benchmark tool for cockroachdb "stress testing at rates above 78k tp/s
         380k qp/s".
     ● deployed thin ubuntu:18.04 and 19.04 host OS with minor configurations required.
     ● built container based host monitoring and logging to elasticsearch/cassandra and influxdb.
     ● designed process to include legacy applications, making them provider agnostic "local, metal or
         AWS/GOOGLE/digitalocean".
     ● operationalise docker-compose development files for dev/stage/production environments.
Teal Drones​, Murray, Utah ​October 2017- 2018
DevOPS Engineer
     ● Built docker for arm7 drones to be used as SAS devices.
     ● Designed and built multi tenancy SAS/PAAS platforms.
     ● Designed with open source AI Object recognition software.
     ● Put design concepts into drones application stack to measure success of message rates to 800Hz
     ● Designed Manufacturing process to flash production line hardware (TX1 Nvidia).
     ● Designed internal systems to protect data integrity between wireless transmissions and flight controllers.
     ● Put forth design concepts to simplify RESTful API’s software versioning
     ● Build Visual AI based on YOLO for object recognition for TX1 Nvidia
Rakuten/MediaForge​, Cottonwood Heights, Utah ​May 2011- 2017
Sr. Linux System Administrator, DevOps Director
     ● Designed SAS/PAAS Linux platforms greatly decreasing testing and production deployments time and
         costs.
     ● Designed and built multi tenancy SAS/PAAS platforms increasing service densities per server and greatly
         decreased infrastructure cost and service deployment time.
     ● Designed and built real time monitoring platform and infrastructure that is currently ingesting 2 billion
         http/https metrics per day delivering meaningful per transaction metrics to executive branch, management
         teams, support engineers, developers, operations teams, Q/A and security engineers. (real time feedback
         loop, high throughput platform, for very complex application stack in an open ecosystem) incorporating
         open source applications.
     ● Standardised CLF (Common Log Format) Across all front end servers and load balancers, enabling client
         connect time through last byte/”time done” exposing slow backend service response times.
     ● Designed and deployed standard core server operating system enabling rapid deployments and seamless
         large scale updates.
     ●   Management role DevOps, lead by example operational concepts, helping development team confidence
         with SAS platform to ensure project deadlines and company objectives were met.
     ●   Responsible for security audits and platform vulnerabilities including OS updates and patches.
     ●   Manage a highly motivated team of Operations System Administrators with responsibilities for platforms
         with request per second rates at 38,000 RP/s and 2 Billion requests per day with traffic spikes that can
         exceed 500 Million increase per day.
     ●   Designed and built DDOS and BOT protection techniques Integrated into custom Core OS and SAS front
         ends.
     ●   Designed Virus, Malware and Google Safe browsing scanner for local and remote content validation,
         remote crawler (BOT) to check client web sites and internal content.
     ●   Designed and built automated scalable deployment service for both content and configurations, platform
         performs md5 hashing per file, and directory reporting status via multiple channels; hipchat, gtalk, IRC,
         email, Elastic, Graphite, Jira/Confluence, and raw sockets.
     ●   Migration concepts: Engineered CORES OS removing AWS requirements enabling the use of other cloud
         providers, data centers or white box concepts.
     ●   Implemented Q/A Operation concepts concerning resources for any given server so at any point STATE is
         possible and clearly understood.
     ●   Built Design concepts for development and operational needs such as I/O, CPU pinning, Memory
         utilization, etc. Enabling our DevOps group to clearly understand core aspects of platforms and services.
     ●   Organized and facilitated Group and One on One advisory committees to address technical hurdles.
     ●   Architected Large in house CDN platforms out performing cloudfront, akamai, cloudflare, and others.
         Included self healing platforms at server, service, and content levels. Example: Cache layer Failover “active
         active” with direct failover (limp mode) these services would auto restart and or cache PURGE rebuild on
         their own and interact with an open loop feedback system.
     ●   Pushing C10K barrier: Commonly push well beyond 10,000 requests per second on each http service.
         54,000 Request per second via HAProxy and Apache/php is my current record for a single SAS server with
         one IP address.
     ●   DOCKER: Designed and built docker migration strategies for all services (Go-Lang, Python, C, PHP, Java,
         Ruby and CGI, and also maintaining backwards compatibility with ansible puppet and shell builds.
     ●   Designed in house DOCKER registry and ACL layers keeping ease of use while maintaining proprietary
         code bases and customer PI, PII
     ●   Architected and managed changes from a massive monolithic applications stack to a micro servicestack
         greatly reducing time to deploy and allowing for trivial roll outs and roll backs if unforeseen issues arise.
     ●   Custom Kernels commonly built kernels testing new features and regression testing keeping platforms
         ahead of the curve.
     ●   Migration: Moved all core platforms away from Cent/Red Hats to Ubuntu/Debian to meet the fast pace
         environment needs. (I’m not stuck on Debian/Ubuntu) Ask for explanation if required.
     ●   Impact study and migration plan for 1024 bit to 2048 bit certs and later sha1 to sha2 ssl termination and
         transport.
     ●   Designed and Built INSIGHT a real time platform for the ingestion of SAS/PAAS resource metrics.
         Collectd/StatsD, Shell and Graphite.
     ●   Designed and Built THING (INSIGHT Evolution) Graphite, InFlux and Elastic search and Grafana
         dashboard.
     ●   It’s required of me to perform many business functions (I wear many hats.)
Verio​, Orem, Utah “Contractor Through TEKsystems” ​February 2011- May 2011
Sr. Linux System Administrator, Software Engineer, Cloud environment Architect
     ● Design system performance models for large scale VPS systems
     ● Conceived and built system controls to prevent any run away process from holding large CPU
          times (Caged Applications) Based on CPU time % of each core
     ● Modified dm-io to allow disk IO bursting and hard set min max IOPs to lessen chances of IO
         binding.
     ●   Normal duties troubleshooting new software builds, kernels and drivers
     ●   Put forth test cases to determine the best IO scheduler NOOP CFQ or DEADLINE for SAN
        And Disk based devices
     ●   Designed control tool kit to allow SA and the system (HN) to limit high CPU usage, Liquid_SA
         is a sub set of tools that will allow SA or the system a more refined way to keep offensive
         programs or users from monopolizing a system.
     ●   Built a Verio style OpenVZ for Ubuntu and tested OpenVZ running inside KVM and VMWare.
     ●   Implemented test systems for load balancing via process grouping on virtual systems.
        Allowing for exacting control of Disk IO, Network, Memory and CPU removing schedule traps
        that most systems suffer from. Ask for more information.
     ●   Studied implementation of and virt API for customer reporting and live migration.
     ●   Evaluated KVM, Xen and Vmware in large scale deployment VPS and MPV systems.
Direct Broadband​, Riverdale, Utah ​July 2004- March 2013
Architect, Sr. Linux System Administrator
     ● Designed and developed advanced shell scripts allowing the interaction between Radius,
        MySQL, local Linux system accounts, BIND and PayPal.
     ● Wrote and debugged an real time Log parsing application with ability's such as sudo reboot
         kill HUP, init.d added highlight and color support for key phrases.
     ● Administration: Mandrake, Ubuntu, Mikrotik, Apache, BIND, Sendmail, IMAP, Windows 2000
         Advanced Server
     ● Developed PHP-G*D Allowing any ISP the ability to PNP IP networks directly into a large
        WLAN (WIFI) infrastructure with a complete end point customer delivery program.
     ● Scripted an advanced bash# script with the ability to arp telnet ssh to crashed routers and or
        APC Power switches and could fail over to Layer 1 in the likely case TCP/UDP layer fails,
        checking router timestamps via: routing tables to factor if a HARD reboot is necessary.
Digi-Telecom​, Roy, Utah ​February 2002 - September 2003
Sr. Network Consultant
Primary network computer technician for remote customer sites. Troubleshoot network
connectivity, T1, DSL, Routing, and Firewalls.
     ● Support Windows 98, 2000, and XP operating systems on client side, Administration of
        Windows 2000 Advance Server, Asterisk and Linux operating systems.
     ● Software Consultant: E-Trust, BIT Defender and Clamav solutions.
GeekZoo​, South Ogden, Utah ​August 2002 - Present
System Consultant
Oversee the company’s information systems reporting directly to the CEO.
     ● Support Linux platforms for employees and consultants including setup, upgrades,
         maintenance, and troubleshooting.
     ● Improved network and computer security infrastructure by adding intrusion detection, URL
        filtering, client-side antivirus, implementing NAT, and router configuration for port blocking.
     ● Improved web design with true php logging support and automated reporting.
Redglass​, Roy, Utah ​April 2001 - October 2003
System Administrator
Server Administration, Windows, Linux – Design & Test ISP software.
     ● Worked with training manager to develop new, in-house computer software training courses,
          saving $3,500 annually in outside training costs.
     ●   Responsible for all aspects of server cluster.
     ●   Design Load balance solution for web hosting infrastructure.
Iomega​, Roy, Utah ​June 2000 – July 2004
Advanced Support Group Supervisor
Third level support for the x86, Sun, and Macintosh hardware platforms. Provided support on
Microsoft Windows, Apple Macintosh, SUN and Linux operating systems. Advanced
troubleshooting on corporate network environment at customer sites related to enterprise network
storage products (NAS).
     ● Responsible for successful Problem to Solution program.
     ● Supervised 140 telephone support technicians and 20 e-mail support technicians,
          Consistently maintained best call resolution for enterprise network server products.
     ● Developed PHP Call classification tools with scales providing best call by agent ratings.
     ● Beta Testing new Optical drives and NAS products, Providing information for said devices.
     ● Specialized is Multi platform compatibility, Linux to Window. Samba to Windows File Sharing,
          Linux NFS to Windows Service to Unix
     ● Developed UDFS data recovery system allowing Iomega the ability to perform recovery on
          CD's and DVD's, software includes logs for FIFO and file structure this Linux based platform
         carries with it the ability to assemble data from large raw binary files seeking header, footer
         information, all done with Linux tools and bash scripts.
                                            EDUCATION AND TRAINING
A+ Certification, The Mind Center, Ogden, Utah, 2002
MCSA, The Mind Center, Ogden, Utah, 2001.
Linux Administration. 2002
Linux Networking. 2001
Linux Security. 2001
Linux Advanced Systems. 2002
Linux Programming C, Python, Shell Scripting. 2003
                                                ADDITIONAL SKILLS
Operating Systems: ​95, 98, NT 4.0, Windows 2000 & Windows XP Windows Vista, Windows7, Mac OS
8, 9, & 10, UNIX Services, Red Hat, Mandrake 8,9, 9.2, &10 Unix, Solaris 2.6. Debian, Suse, Ubuntu
Linux, CentOS and OpenVZ
Networking: ​LAN, WAN, TCP/IP, DHCP, DNS, SAMBA, NFS, SQUID, DSL, T1, 802.11a/b/g/n,
Programming Languages: ​PHP, HTML, C, SHELL, Python, Go.
Web: ​IIS, Apache, HAProxy, Nginx, CGI, WSCGI, Go, Unicorn, Python WebSock.
Desktop Application Software: ​Microsoft Word, Excel, PowerPoint, Project, Visio, and Outlook;
pcAnywhere, and Ghost., 3D Max2-4, Open Office Word, Math, and DD, tail, grc, gcc, emacs, vim and eclipse.
                                               AFFILIATIONS
SourceForge (open source customer quality project), 2003
Garage Games (Engine Design), 2001
CompT USA IT Professional Member
Linux Guru of Ogden (User Group) 2000-2010
</font></pre>
]]></content>
        </item>
        
        <item>
            <title>Boot Straping a Biz</title>
            <link>https://geekzoo.io:443/posts/boot-straping-a-biz/</link>
            <pubDate>Tue, 26 Nov 2019 08:12:46 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/boot-straping-a-biz/</guid>
            <description>#_bootstrap &amp;gt;Bring up basic infrastructure:
./env.sh ClusterName 4  #_treakik &amp;gt;Ingress router:
docker stack deploy --with-registry-auth --compose-file docker-compose.yml your-stack-name  </description>
            <content type="html"><![CDATA[<p>#_bootstrap
&gt;Bring up basic infrastructure:</p>

<pre><code class="language-bash">./env.sh ClusterName 4
</code></pre>

<p>#_treakik
&gt;Ingress router:</p>

<pre><code class="language-bash">docker stack deploy --with-registry-auth --compose-file docker-compose.yml your-stack-name
</code></pre>
]]></content>
        </item>
        
        <item>
            <title>Bash Read</title>
            <link>https://geekzoo.io:443/posts/bash-read/</link>
            <pubDate>Sat, 16 Nov 2019 11:43:16 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/bash-read/</guid>
            <description> read read -p &amp;quot;Enter some data: &amp;quot; echo $REPLY  read with var export while true; do read server_id &amp;amp;&amp;amp; echo &amp;quot;$REPLY $server_id&amp;quot;; break ;done &amp;lt;&amp;lt;&amp;lt; $(echo &amp;quot;docker service ls&amp;quot;) &amp;amp;&amp;amp; $server_id  </description>
            <content type="html"><![CDATA[

<h1 id="read">read</h1>

<pre><code class="language-bash">read -p &quot;Enter some data: &quot;
echo $REPLY
</code></pre>

<h1 id="read-with-var-export">read with var export</h1>

<pre><code class="language-bash">while true; do read server_id &amp;&amp; echo &quot;$REPLY $server_id&quot;; break ;done &lt;&lt;&lt; $(echo &quot;docker service ls&quot;) &amp;&amp; $server_id 
</code></pre>
]]></content>
        </item>
        
        <item>
            <title>Go Qrcode</title>
            <link>https://geekzoo.io:443/posts/go-qrcode/</link>
            <pubDate>Tue, 12 Nov 2019 20:21:02 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/go-qrcode/</guid>
            <description>Step one: go get github.com/Pallinder/go-randomdata go get github.com/boombuler/barcode go get github.com/boombuler/barcode/qr go get github.com/gorilla/mux  Step two go run main.go  //go-qr.go package main import ( &amp;quot;image/png&amp;quot; &amp;quot;os&amp;quot; &amp;quot;log&amp;quot; &amp;quot;net/http&amp;quot; &amp;quot;net&amp;quot; &amp;quot;fmt&amp;quot; &amp;quot;time&amp;quot; &amp;quot;io/ioutil&amp;quot; &amp;quot;github.com/Pallinder/go-randomdata&amp;quot; &amp;quot;github.com/boombuler/barcode&amp;quot; &amp;quot;github.com/boombuler/barcode/qr&amp;quot; &amp;quot;github.com/gorilla/mux&amp;quot; ) //var code *qrCode func main() { r:= mux.NewRouter() srv := &amp;amp;http.Server { Addr: &amp;quot;0.0.0.0:8000&amp;quot;, WriteTimeout: time.Second * 10, ReadTimeout: time.Second * 15, IdleTimeout: time.Second * 60, Handler: r, } r.HandleFunc(&amp;quot;/qr&amp;quot;, record).</description>
            <content type="html"><![CDATA[

<h1 id="step-one">Step one:</h1>

<pre><code class="language-bash">go get github.com/Pallinder/go-randomdata
go get github.com/boombuler/barcode
go get github.com/boombuler/barcode/qr
go get github.com/gorilla/mux
</code></pre>

<h1 id="step-two">Step two</h1>

<pre><code class="language-bash">go run main.go
</code></pre>

<pre><code class="language-go">//go-qr.go
package main

import (
        &quot;image/png&quot;
        &quot;os&quot;
        &quot;log&quot;
        &quot;net/http&quot;
        &quot;net&quot;
        &quot;fmt&quot;
        &quot;time&quot;
        &quot;io/ioutil&quot;

        &quot;github.com/Pallinder/go-randomdata&quot;
        &quot;github.com/boombuler/barcode&quot;
        &quot;github.com/boombuler/barcode/qr&quot;
        &quot;github.com/gorilla/mux&quot;
)
//var code *qrCode
func main() {

        r:= mux.NewRouter()
        srv := &amp;http.Server {
                Addr:           &quot;0.0.0.0:8000&quot;,
                WriteTimeout:   time.Second * 10,
                ReadTimeout:    time.Second * 15,
                IdleTimeout:    time.Second * 60,
                Handler: r,
        }

        r.HandleFunc(&quot;/qr&quot;, record).Methods(&quot;GET&quot;)

        log.Fatal(srv.ListenAndServe())
}

func record(w http.ResponseWriter, r *http.Request) {
        start_time := time.Now()
        host, _, _ := net.SplitHostPort(r.RemoteAddr)
        code, _ := qr.Encode(fmt.Sprintf(&quot;Stream:&lt;%v&gt; \033[36m%v &lt;%v&gt;\033[0m&quot;,  randomdata.Paragraph(), host, start_time), qr.M, qr.Auto)
        code, _ =  barcode.Scale(code, 200, 200)
        bin, _ := os.Create(&quot;tmp/bin.png&quot;)
        defer bin.Close() 

        png.Encode(bin, code)
        r_bin, _ := ioutil.ReadFile(&quot;tmp/bin.png&quot;)
        w.Write([]byte(r_bin))
        stop_time := time.Since(start_time)
        os.Remove(&quot;tmp/bin.png&quot;)
        fmt.Printf(&quot;\t\033[90mDONE %v \033[35mTook: %v\033[0m %v\n&quot;, time.Now(), stop_time, host)
}
</code></pre>

<p><img src="https://qr.geekzoo.io/qr" alt="alt randomQR" title="Idea's" /></p>
]]></content>
        </item>
        
        <item>
            <title>Be Brave</title>
            <link>https://geekzoo.io:443/posts/be-brave-1573366788/</link>
            <pubDate>Sat, 09 Nov 2019 23:19:49 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/be-brave-1573366788/</guid>
            <description></description>
            <content type="html"><![CDATA[<p><img src="/img/be.jpg" alt="alt text" title="Be Sasquash" /></p>
]]></content>
        </item>
        
        <item>
            <title>Traefikv2 01 epoc 1573354057</title>
            <link>https://geekzoo.io:443/posts/traefikv2-01-1573354057/</link>
            <pubDate>Sat, 09 Nov 2019 19:47:37 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/traefikv2-01-1573354057/</guid>
            <description>Traefik V2  I have been really thinking about moving v8 edge &amp;ldquo;ingress&amp;rdquo;! Traefik has been a great addition and if currently doing all our JWT and legecy tokens.  Recently ran 10% of v8&amp;rsquo;s cookie traffic uuid magic with amazing success: &amp;ldquo;Sorry HaProxy&amp;ldquo;
#docker-compose-traefik-v2.yml version: &amp;quot;3.7&amp;quot; services: traefik: networks: - backend image: &amp;quot;traefik:v2.0.4&amp;quot; container_name: &amp;quot;traefik&amp;quot; command: - &amp;quot;--log.level=ERROR&amp;quot; #${LOG_LEVEL} shell LOG_LEVEL=DEBUG, LOG_LEVEL=ERROR - &amp;quot;--accesslog=true&amp;quot; - &amp;quot;--accesslog.fields.headers.defaultmode=keep&amp;quot; - &amp;quot;--providers.file.filename=/dynamic_conf.toml&amp;quot; - &amp;quot;--global.</description>
            <content type="html"><![CDATA[

<h1 id="traefik-v2">Traefik V2</h1>

<blockquote>
<p>I have been really thinking about moving v8 edge &ldquo;ingress&rdquo;! <br></p>

<h2 id="traefik-has-been-a-great-addition-and-if-currently-doing-all-our-jwt-and-legecy-tokens-br">Traefik has been a great addition and if currently doing all our JWT and legecy tokens. <br></h2>

<p>Recently ran 10% of v8&rsquo;s cookie traffic uuid magic with amazing success: &ldquo;<b>Sorry HaProxy</b>&ldquo;<br></p>

<pre><code class="language-yaml">#docker-compose-traefik-v2.yml
version: &quot;3.7&quot;

services:
  traefik:
    networks: 
      - backend
    image: &quot;traefik:v2.0.4&quot;
    container_name: &quot;traefik&quot;
    command:
      - &quot;--log.level=ERROR&quot; #${LOG_LEVEL} shell LOG_LEVEL=DEBUG, LOG_LEVEL=ERROR
      - &quot;--accesslog=true&quot;
      - &quot;--accesslog.fields.headers.defaultmode=keep&quot;
      - &quot;--providers.file.filename=/dynamic_conf.toml&quot;
      - &quot;--global.sendAnonymousUsage=false&quot;
      - &quot;--api=true&quot;
      - &quot;--api.insecure=true&quot;
      - &quot;--providers.docker=true&quot;
      - &quot;--providers.docker.exposedbydefault=false&quot;
      - &quot;--entrypoints.web.address=:80&quot;
      - &quot;--entrypoints.websecure.address=:443&quot;
      - &quot;--certificatesresolvers.mydnschallenge.acme.dnschallenge=true&quot;
      - &quot;--certificatesResolvers.mydnschallenge.acme.dnsChallenge.delayBeforeCheck=90&quot;
      - &quot;--certificatesresolvers.mydnschallenge.acme.dnschallenge.provider=godaddy&quot;
#      - &quot;--certificatesresolvers.mydnschallenge.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory&quot;
      - &quot;--certificatesresolvers.mydnschallenge.acme.caserver=https://acme-v02.api.letsencrypt.org/directory&quot;
      - &quot;--certificatesresolvers.mydnschallenge.acme.email=emailAdd@example.com&quot;
      - &quot;--certificatesresolvers.mydnschallenge.acme.storage=/letsencrypt/acme.json&quot;
      - &quot;--metrics.influxDB&quot;
      - &quot;--metrics.influxdb=true&quot;
      - &quot;--metrics.influxdb.database=metrics&quot;
      - &quot;--metrics.influxdb.address=influx:8086&quot;
      - &quot;--metrics.influxdb.protocol=http&quot;
      - &quot;--metrics.influxdb.pushInterval=1s&quot;
      - &quot;--metrics.influxdb.addEntryPointsLabels=true&quot;
      - &quot;--metrics.influxdb.addServicesLabels=true&quot;
    # HAck for Global routers to provide the client IP
    ports:
      - mode: host
        protocol: tcp
        published: 80
        target: 80
      - mode: host
        protocol: tcp
        published: 443
        target: 443
      - mode: host
        protocol: tcp
        published: 8080
        target: 8080

    environment:
      - &quot;GODADDY_API_SECRET=ADD Secret&quot;
      - &quot;GODADDY_API_KEY=API KEY&quot;
    volumes:
      - &quot;letsencrypt:/letsencrypt&quot;
      - &quot;/var/run/docker.sock:/var/run/docker.sock:ro&quot;
    #deploy:
    #configs:
      #- source: traefik1
      #- source: traefik2
      #  target: /dynamic_conf.toml
volumes:
  letsencrypt:
    driver: local

networks:
  backend:
    external: false
    name: custom_backend
    driver: overlay
</code></pre>

<hr />

<h1 id="influxdb">influxdb</h1>

<pre><code class="language-yaml">#docker-compose-influx.yml
version: &quot;3.7&quot;

services:
  influx:
    networks: 
      - backend
    image: &quot;influxdb&quot;
    container_name: &quot;influx&quot;
    environment:
      - INFLUXDB_DB=metrics
      - INFLUXDB_GRAPHITE_ENABLED=true
      - INFLUXDB_GRAPHITE_0_ENABLED=true
      - INFLUXDB_GRAPHITE_0_DATABASE=graphite
      - INFLUXDB_GRAPHITE_0_BIND_ADDRESS=0.0.0.0:2003
      - INFLUXDB_GRAPHITE_PROTOCOL=tcp
      - INFLUXDB_ADMIN_ENABLED=true
      - INFLUXDB_HTTP_ENABLED=true
      - INFLUXDB_HTTP_BIND_ADDRESS=0.0.0.0:8086
    volumes:
      - &quot;influx:/var/lib/influxdb&quot;
    deploy:
      placement:
        constraints:
          - node.role == manager
volumes:
  influx:
    driver: local

networks:
  backend:
    external: true
    name: custom_backend
    driver: overlay
</code></pre>

<hr />

<h1 id="deploy">deploy</h1>

<pre><code class="language-bash">docker swarm init # Run if your docker daemon is not already a member of a cluster.
docker stack deploy --with-registry-auth --compose-file docker-compose-traefik-v2.yml --prune ROUTER
docker stack deploy --with-registry-auth --compose-file docker-compose-influx.yml --prune INFLUX
# Or under one stack
docker stack deploy --with-registry-auth --compose-file docker-compose-traefik-v2.yml --compose-file docker-compose-influx.yml --prune ALL
</code></pre>

<hr />

<h1 id="confirm-traefik-is-running">Confirm traefik is running</h1>

<pre><code class="language-bash">curl -sv http://127.0.0.1:8080/
</code></pre>
</blockquote>
]]></content>
        </item>
        
        <item>
            <title>Docker sshfs volume</title>
            <link>https://geekzoo.io:443/posts/docker-sshfs-volume/</link>
            <pubDate>Tue, 05 Nov 2019 17:55:03 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/docker-sshfs-volume/</guid>
            <description>docker plugins docker plugin install --grant-all-permissions vieux/sshfs  docker-compose.yml version: &#39;3.7&#39; services: CDN: build: ../CDN image: v8.geekzoo.guru/cdn:dev hostname: v8 networks: - ingres volumes: - cache:/usr/local/var/cache/squid - sshfs:/shared_data deploy: replicas: 1 endpoint_mode: dnsrr labels: - &amp;quot;traefik.enable=true&amp;quot; - &amp;quot;sub=cdn&amp;quot; - &amp;quot;traefik.http.services.cdn.loadbalancer.server.port=80&amp;quot; - &amp;quot;traefik.docker.network=custom_backend&amp;quot; placement: constraints: - node.role == manager - node.hostname != aws-builder-1 configs: - source: cdn_one target: /usr/local/etc/squid.conf uid: &#39;0&#39; gid: &#39;0&#39; mode: 0640 volumes: cache: driver: local sshfs: driver: vieux/sshfs driver_opts: sshcmd: &amp;quot;user@yourHost:/home/user&amp;quot; password: &amp;quot;passwd&amp;quot; configs: cdn_one: file: .</description>
            <content type="html"><![CDATA[

<h1 id="docker-plugins">docker plugins</h1>

<pre><code class="language-bash">docker plugin install --grant-all-permissions vieux/sshfs
</code></pre>

<hr />

<h1 id="docker-compose-yml">docker-compose.yml</h1>

<pre><code class="language-yaml">version: '3.7'
  
services:
  CDN:
    build: ../CDN
    image: v8.geekzoo.guru/cdn:dev
    hostname: v8
    networks: 
      - ingres
    volumes:
      - cache:/usr/local/var/cache/squid
      - sshfs:/shared_data
    deploy:
      replicas: 1
      endpoint_mode: dnsrr
      labels: 
        - &quot;traefik.enable=true&quot;
        - &quot;sub=cdn&quot;
        - &quot;traefik.http.services.cdn.loadbalancer.server.port=80&quot;
        - &quot;traefik.docker.network=custom_backend&quot;
      placement:
        constraints:
          - node.role == manager
          - node.hostname != aws-builder-1
    configs:
      - source: cdn_one
        target: /usr/local/etc/squid.conf
        uid: '0'
        gid: '0'
        mode: 0640
volumes:
  cache:
    driver: local
  sshfs:
    driver: vieux/sshfs
    driver_opts:
       sshcmd: &quot;user@yourHost:/home/user&quot;
       password: &quot;passwd&quot;
configs:
  cdn_one:
    file: ./squid.conf
networks:
  ingres:
    external: false
    name: custom_ingres
    driver: overlay
</code></pre>
]]></content>
        </item>
        
        <item>
            <title>Gawk Json</title>
            <link>https://geekzoo.io:443/posts/gawk-json/</link>
            <pubDate>Mon, 04 Nov 2019 20:45:51 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/gawk-json/</guid>
            <description> gawk -f clf2json.awk haproxy.log example BEGIN { ORS = &amp;quot; &amp;quot;; print &amp;quot; [ &amp;quot;} { printf &amp;quot;%s{\&amp;quot;One\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Two\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Three\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Four\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Five\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Six\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Seven\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Eight\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Nine\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Ten\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Eleven\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Twelve\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Therteen\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;FourTe\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Fifteen\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Sixteen\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;SevenTeen\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;EightT\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;NineT\&amp;quot;: \&amp;quot;%s\&amp;quot;, \&amp;quot;Twenty\&amp;quot;: \&amp;quot;%s\&amp;quot;}&amp;quot;, separator, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20 separator = &amp;quot;, &amp;quot; } END { print &amp;quot; ] &amp;quot; }  </description>
            <content type="html"><![CDATA[

<h1 id="gawk-f-clf2json-awk-haproxy-log-example">gawk -f clf2json.awk haproxy.log example</h1>

<pre><code class="language-awk">BEGIN { ORS = &quot; &quot;; print &quot; [ &quot;}

    { printf &quot;%s{\&quot;One\&quot;: \&quot;%s\&quot;, \&quot;Two\&quot;: \&quot;%s\&quot;, \&quot;Three\&quot;: \&quot;%s\&quot;, \&quot;Four\&quot;: \&quot;%s\&quot;, \&quot;Five\&quot;: \&quot;%s\&quot;, \&quot;Six\&quot;: \&quot;%s\&quot;, \&quot;Seven\&quot;: \&quot;%s\&quot;, \&quot;Eight\&quot;: \&quot;%s\&quot;, \&quot;Nine\&quot;: \&quot;%s\&quot;, \&quot;Ten\&quot;: \&quot;%s\&quot;, \&quot;Eleven\&quot;: \&quot;%s\&quot;, \&quot;Twelve\&quot;: \&quot;%s\&quot;, \&quot;Therteen\&quot;: \&quot;%s\&quot;, \&quot;FourTe\&quot;: \&quot;%s\&quot;, \&quot;Fifteen\&quot;: \&quot;%s\&quot;, \&quot;Sixteen\&quot;: \&quot;%s\&quot;, \&quot;SevenTeen\&quot;: \&quot;%s\&quot;, \&quot;EightT\&quot;: \&quot;%s\&quot;, \&quot;NineT\&quot;: \&quot;%s\&quot;, \&quot;Twenty\&quot;: \&quot;%s\&quot;}&quot;,

    separator, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20
    separator = &quot;, &quot;
    }
    END { print &quot; ] &quot; }
</code></pre>
]]></content>
        </item>
        
        <item>
            <title>Go Cockroach</title>
            <link>https://geekzoo.io:443/posts/go-cockroach/</link>
            <pubDate>Mon, 04 Nov 2019 20:25:54 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/go-cockroach/</guid>
            <description>https://github.com/geekzoo/go-cockroach.git
go-cockroach.go /* * Heavy run load 11K INSERTS 100K SELECTS per second (Stability / Schema run). * curl -s http://ipORdomain:8000/cal_prep #creates db and table * Scraper v_2 go-bench-cal_insert * ab -c 100 -n 1000 -k http://domain.com/cal_insert * ab -c 100 -n 1000 -k http://domain.com/cal_all * in a web browser goto * http://domain.com/cal_prep * http://domain.com/cal_insert * http://domain.com/cal_all */ package main import ( &amp;quot;fmt&amp;quot; &amp;quot;math&amp;quot; &amp;quot;math/rand&amp;quot; &amp;quot;time&amp;quot; &amp;quot;database/sql&amp;quot; _ &amp;quot;github.com/lib/pq&amp;quot; &amp;quot;github.</description>
            <content type="html"><![CDATA[

<p><a href="https://github.com/geekzoo/go-cockroach.git">https://github.com/geekzoo/go-cockroach.git</a></p>

<h1 id="go-cockroach-go">go-cockroach.go</h1>

<pre><code class="language-go">/*
 * Heavy run load 11K INSERTS 100K SELECTS per second (Stability / Schema run).
 * curl -s http://ipORdomain:8000/cal_prep #creates db and table
 * Scraper v_2 go-bench-cal_insert 
 * ab -c 100 -n 1000 -k http://domain.com/cal_insert
 * ab -c 100 -n 1000 -k http://domain.com/cal_all
 * in a web browser goto 
 * http://domain.com/cal_prep
 * http://domain.com/cal_insert
 * http://domain.com/cal_all
*/
package main

import (
    &quot;fmt&quot;
    &quot;math&quot;
    &quot;math/rand&quot;
    &quot;time&quot;
    &quot;database/sql&quot;
    _ &quot;github.com/lib/pq&quot;
    &quot;github.com/gorilla/mux&quot;
    &quot;net/http&quot;
    _ &quot;net/http/pprof&quot;
    &quot;log&quot;
    crand  &quot;crypto/rand&quot;
    &quot;io&quot;
    &quot;os&quot;
    &quot;sync/atomic&quot;
    &quot;github.com/Pallinder/go-randomdata&quot;
)


const (
    host            = &quot;127.0.0.1&quot;		//PG HOST &lt;GEO DNS round robbin to HAProxy&gt; -&gt; HAProxy -&gt; LRU/RR cockroachdb nodes
    port            = 26258			//PG PORT
    user            = &quot;root&quot;			//DB USER NAME
    password        = &quot;&quot;			//DB PASSWORD
    dbname          = &quot;uuid&quot;			//Database Name
    fallback_application_name = &quot;🦄Te🦄st🦄&quot;	//Work around for db reported Application_name
    connect_timeout = 10				//DB Time out
    influxdb_host   = &quot;insight.domain.com&quot;	//TODO
    influxdb_port   = 6669			//TODO
    carbon_host     = &quot;127.0.0.1&quot;		//Carbon IP/Hostname &lt;Graphite&gt;
    carbon_port     = &quot;2000&quot;			//Carbon port
    carbon_link     = &quot;US.GF.TESTING.TEST.&quot;	//TODO
    carbon_enabled  = false			//Enable=true Disable=false
    irc_host        = &quot;irc.domain.com&quot;		//TODO
    irc_port        = 6666			//TODO
    elastic_host    = &quot;insight.domain.com&quot;	//TODO
    elastic_port    = 8888			//TODO
    srv_host        = &quot;0.0.0.0&quot;			//IP/HostName for HTTP service
    srv_port        = 8000			//HTTP Port
    srv_w_timeout   = 15			//Seconds &lt;Write Timeout&gt;
    srv_r_timeout   = 15			//Seconds &lt;Read Timeout&gt;
    srv_idle_timeout    = 60			//Seconds &lt;Idle Timeout&gt;
)

var letterRunes = []rune(&quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;)
var ops, rps uint64 				//ops sql operations // rps http operations
var s_insert, s_select, s_update, s_delete uint64 //TODO count each type per ops breal down
var blow_out bool 				// circute for extermal stats
var lat, old_lat time.Duration 			//test to zero stats in no new data

func main() {

  if carbon_enabled == true {
    blow_out = true 				//circut breaker
  }
//s_sys()
//time.Sleep(1*time.Second)

fmt.Printf(&quot;\033c&quot;)

go func() {
    for {
      opsFinal := atomic.LoadUint64(&amp;ops)
      if opsFinal == 18446744073709551615 { 
          fmt.Printf(&quot;\033[0;0H\033[2K\rOP/s: \033[33m%d\033[0m&quot;, 0)
          time.Sleep(time.Second)
      }else{
	fmt.Printf(&quot;\033[0;0H\033[2K\rOP/s:\033[32m %v\033[0m\033[C&quot;, opsFinal)
	atomic.AddUint64(&amp;ops, ^opsFinal)
	time.Sleep(time.Second)
     }
    }
}()

go func() {
    for {
      rpsFinal := atomic.LoadUint64(&amp;rps)
      if rpsFinal == 18446744073709551615 {
	  fmt.Printf(&quot;\033[2;0H\033[2K\rRP/s: \033[33m%d\033[0m&quot;, 0)
	  time.Sleep(time.Second)
      }else{
	  fmt.Printf(&quot;\033[2;0H\033[2K\rRP/s:\033[32m %v\033[0m\033[C&quot;, rpsFinal)
	  atomic.AddUint64(&amp;rps, ^rpsFinal)
	  time.Sleep(time.Second)
      }
    }
}()

go func() {

    for {
        if blow_out == true {
	  fmt.Printf(&quot;\033[3;0H\033[2K\rStats Active:\033[32m %v\033[0m\033[C&quot;, blow_out)
	  time.Sleep(time.Second)
        }else{
	  fmt.Printf(&quot;\033[3;0H\033[2K\rStats Active:\033[93m %v\033[0m\033[C&quot;, blow_out)
	  time.Sleep(time.Second)
        }
    }
}()

go func() {

    for {
        if blow_out == true {
	  fmt.Printf(&quot;\033[4;0H\033[2K\rHealthy:\033[32m %v\033[0m\033[C&quot;, blow_out)
	  time.Sleep(time.Second)
        }else{
	  fmt.Printf(&quot;\033[4;0H\033[2K\rHealthy:\033[93m %v\033[0m\033[C&quot;, blow_out)
	  time.Sleep(time.Second)
        }
    }
}()

go func() {

    for {
        old_lat = lat
        if lat &lt; 30000000 {
//		 23317344
	  fmt.Printf(&quot;\033[5;0H\033[2K\rLat:\033[32m %v\033[0m\033[C&quot;, lat)
	  fmt.Printf(&quot;\033[6;0H\033[2K\rLat RAW:\033[32m %d\033[0m\033[C&quot;, lat)
fmt.Printf(&quot;\033[14;0H\033[2K\rRAW:\033[95m %v, %v\033[0m\033[C&quot;, lat, old_lat)
	  time.Sleep(time.Second)
        }else{
	  fmt.Printf(&quot;\033[5;0H\033[2K\rLat:\033[93m %v\033[0m\033[C&quot;, lat)
	  fmt.Printf(&quot;\033[6;0H\033[2K\rLat RAW:\033[91m %d\033[0m\033[C&quot;, lat)
fmt.Printf(&quot;\033[14;0H\033[2K\rRAW:\033[91m %v, %v\033[0m\033[C&quot;, lat, old_lat)
	  time.Sleep(time.Second)
        }
    }
}()

go func() {
    for {
      s_selectFinal := atomic.LoadUint64(&amp;s_select)
      if s_selectFinal == 18446744073709551615 { 
          fmt.Printf(&quot;\033[9;0H\033[2K\rSELECTS/s: \033[33m%d\033[0m&quot;, 0)
          time.Sleep(time.Second)
      }else{
	fmt.Printf(&quot;\033[9;0H\033[2K\rSELECTS/s:\033[32m %v\033[0m\033[C&quot;, s_selectFinal)
	atomic.AddUint64(&amp;s_select, ^s_selectFinal)
	time.Sleep(time.Second)
     }
    }
}()

go func() {
    for {
      s_updateFinal := atomic.LoadUint64(&amp;s_update)
      if s_updateFinal == 18446744073709551615 { 
          fmt.Printf(&quot;\033[10;0H\033[2K\rUPDATES/s: \033[33m%d\033[0m&quot;, 0)
          time.Sleep(time.Second)
      }else{
	fmt.Printf(&quot;\033[10;0H\033[2K\rUPDATES/s:\033[32m %v\033[0m\033[C&quot;, s_updateFinal)
	atomic.AddUint64(&amp;s_update, ^s_updateFinal)
	time.Sleep(time.Second)
     }
    }
}()

go func() {
    for {
      s_insertFinal := atomic.LoadUint64(&amp;s_insert)
      if s_insertFinal == 18446744073709551615 { 
          fmt.Printf(&quot;\033[11;0H\033[2K\rINSERTS/s: \033[33m%d\033[0m&quot;, 0)
          time.Sleep(time.Second)
      }else{
	fmt.Printf(&quot;\033[11;0H\033[2K\rINSERTS/s:\033[32m %v\033[0m\033[C&quot;, s_insertFinal)
	atomic.AddUint64(&amp;s_insert, ^s_insertFinal)
	time.Sleep(time.Second)
     }
    }
}()

go func() {
    for {
      s_deleteFinal := atomic.LoadUint64(&amp;s_delete)
      if s_deleteFinal == 18446744073709551615 { 
          fmt.Printf(&quot;\033[12;0H\033[2K\rDELETES/s: \033[33m%d\033[0m&quot;, 0)
          time.Sleep(time.Second)
      }else{
	fmt.Printf(&quot;\033[12;0H\033[2K\rDELETES/s:\033[32m %v\033[0m\033[C&quot;, s_deleteFinal)
	atomic.AddUint64(&amp;s_delete, ^s_deleteFinal)
	time.Sleep(time.Second)
     }
    }
}()

/* Reset blow_out */
go func() {
    for {
      if carbon_enabled == true {
        blow_out = true
      }
        time.Sleep(10*time.Second)
     }
}()
  
    r := mux.NewRouter()
    srv := &amp;http.Server{
        Addr:           fmt.Sprintf(&quot;%v:%v&quot;,srv_host,srv_port),
        WriteTimeout:   time.Second * srv_w_timeout,
        ReadTimeout:    time.Second * srv_r_timeout,
        IdleTimeout:    time.Second * srv_idle_timeout,
        Handler: r,
    }
    

    r.HandleFunc(&quot;/cal_insert&quot;, cal_insert).Methods(&quot;GET&quot;)
    r.HandleFunc(&quot;/cal_all&quot;, cal_all).Methods(&quot;GET&quot;)
    r.HandleFunc(&quot;/cal_prep&quot;, cal_prep).Methods(&quot;GET&quot;)
    r.HandleFunc(&quot;/cal_truncate&quot;, cal_truncate).Methods(&quot;GET&quot;)
    r.HandleFunc(&quot;/show_sessions&quot;, show_sessions).Methods(&quot;GET&quot;)
    
    log.Fatal(srv.ListenAndServe())
}
// END MAIN

        func cal_insert(w http.ResponseWriter, r *http.Request) {
            start_init := time.Now()
            w.Header().Set(&quot;X-ENGINE&quot;, &quot;V2&quot;)
            w.Header().Set(&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;)
            w.Header().Set(&quot;X-TEST&quot;, &quot;cal_insert&quot;)
            
            psqlInfo := fmt.Sprintf(&quot;host=%s port=%d user=%s password=%s dbname=%s fallback_application_name=%s connect_timeout=%d sslmode=disable&quot;, host, port, user, password, dbname, fallback_application_name, connect_timeout)
            db, err := sql.Open(&quot;postgres&quot;, psqlInfo)
                if err != nil {
            panic(err)
                }
            defer db.Close()
            err = db.Ping()
                if err != nil {
            panic(err)
                }

            w.Write([]byte(&quot;&lt;body style=background-color:grey;&gt;&quot;))
            w.Write([]byte(&quot;&lt;h1&gt; cal_insert &lt;/h1&gt;&quot;))

            w.Write([]byte(&quot;&lt;svg width=35 height=35&gt; &lt;circle cx=20 cy=20 r=10 stroke=green stroke-width=4 fill=yellow /&gt; &lt;/svg&gt; &lt;font size=1px&gt;Warm up.&lt;/font&gt;&quot;))
            w.Write([]byte(&quot;&lt;svg width=35 height=35&gt; &lt;circle cx=20 cy=20 r=10 stroke=green stroke-width=4 fill=green /&gt; &lt;/svg&gt; &lt;font size=1px&gt;Done. &lt;/font&gt;&quot;))

	for run_c := 1; run_c &lt;= 10; run_c++ {
            res_id, err := newUUID()
            calendar_id, err := newUUID()
            reservation_id, err := newUUID()
            company_id := rand.Intn(1156)
            title := randomdata.Paragraph()
            location := randomdata.ProvinceForCountry(&quot;US&quot;)
            organizer_email := randomdata.Email()
            reservation_begin, reservation_end := gen_meeting()
            t1 := time.Unix(reservation_begin, 0).UTC()
            t2 := time.Unix(reservation_end, 0).UTC()
            
            start2 := time.Now()
            err = db.QueryRow(&quot;INSERT INTO uuid.cal_insert (calendar_id, reservation_id, company_id, title, location, organizer_email, reservation_begin, reservation_end) VALUES($1, $2, $3, $4, $5, $6, $7, $8) RETURNING reservation_id&quot;, calendar_id, res_id, company_id, title, location, organizer_email, t1, t2).Scan(&amp;reservation_id)
// OP/S counter
atomic.AddUint64(&amp;ops, 1)
atomic.AddUint64(&amp;s_insert, 1)
            elapsed2 := time.Since(start2)
            tt2 := fmt.Sprintf(&quot;Time SQL:= %s&quot;, elapsed2)
            w.Write([]byte(&quot;&lt;b&gt;&lt;pre&gt;MULTIUUID &quot; + &quot; &quot; + calendar_id + &quot; &lt;font color=green&gt;&quot; + reservation_id + &quot;&lt;/font&gt; &quot; + fmt.Sprintf(&quot; co:[%d] &quot;,company_id) + &quot;&lt;font size=0.01px&gt;&lt;p&gt;&quot; + title + &quot;&lt;/font&gt;&lt;/p&gt;&quot; + &quot;&lt;font color=yellow&gt; &quot; + tt2 + &quot;&lt;/font&gt;&lt;/b&gt;&lt;/pre&gt;&quot;))

            //Carbon Format
            now := time.Now()
            epoc_now := now.Unix()
            hostname, err := os.Hostname()
lat = elapsed2


	    if carbon_enabled == true &amp;&amp; blow_out == true {
	    Tcc(fmt.Sprintf(&quot;GF.TEST.%s.CAL-INSERT.SQL-FUNC %d %d&quot;, hostname, elapsed2, epoc_now))
//	    Tcc(fmt.Sprintf(&quot;GF.TEST.%s.CAL-INSERT.OPS %d %d&quot;, hostname, s_insertFinal, epoc_now))
	    }
            
            if err != nil {}

        }
        
    db.Close()
    w.Write([]byte(&quot;DONE&quot;))
    now := time.Now()
    epoc_now := now.Unix()
    hostname, err := os.Hostname()
    elapsed := time.Since(start_init)
    
    if carbon_enabled == true &amp;&amp; blow_out == true {
    Tcc(fmt.Sprintf(&quot;GF.TEST.%s.CAL-BLK.INSERT.SQL-FUNC %d %d&quot;, hostname, elapsed, epoc_now))
    }
    
// RP/S counter 
atomic.AddUint64(&amp;rps, 1)
    return 
    }
    
    /*
     */
    
        func cal_all(w http.ResponseWriter, r *http.Request) {
            start_init := time.Now()     
            w.Header().Set(&quot;X-ENGINE&quot;, &quot;V2&quot;)
            w.Header().Set(&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;)
            w.Header().Set(&quot;X-TEST&quot;, &quot;cal_all&quot;)
            
            psqlInfo := fmt.Sprintf(&quot;host=%s port=%d user=%s password=%s dbname=%s fallback_application_name=%s connect_timeout=%d sslmode=disable&quot;, host, port, user, password, dbname, fallback_application_name, connect_timeout)
            db, err := sql.Open(&quot;postgres&quot;, psqlInfo)
                if err != nil {
                panic(err)
                }
            defer db.Close()
            err = db.Ping()
                if err != nil {
                panic(err)
                }
                    
            w.Write([]byte(&quot;&lt;body style=background-color:grey;&gt;&quot;))
            ti := time.Now()
            w.Write([]byte(&quot;&lt;h1&gt; cal_all &lt;/h1&gt;&quot; + &quot;&lt;h2&gt;&quot; + fmt.Sprintf(&quot;%v&quot;, ti) + &quot;&lt;/h2&gt;&quot; ))
            if err != nil {
                log.Fatal(err)
            }
            if err != nil {
                panic(err)
            }

            w.Write([]byte(&quot;&lt;svg width=35 height=35&gt; &lt;circle cx=20 cy=20 r=10 stroke=green stroke-width=4 fill=yellow /&gt; &lt;/svg&gt; &lt;font size=1px&gt;Warm up.&lt;/font&gt;&quot;))
            w.Write([]byte(&quot;&lt;svg width=35 height=35&gt; &lt;circle cx=20 cy=20 r=10 stroke=green stroke-width=4 fill=green /&gt; &lt;/svg&gt; &lt;font size=1px&gt;Done. &lt;/font&gt;&quot;))
        
        for run_c := 1; run_c &lt;= 1; run_c++ {
            reservation_id := &quot;&quot;
            calendar_id := &quot;&quot;
            title := &quot;&quot;
            company_id := 0
            rand_0 := rand.Intn(1156)
            start2 := time.Now()
            err = db.QueryRow(&quot;SELECT calendar_id, reservation_id, title, company_id FROM uuid.cal_insert WHERE company_id = $1 LIMIT 1&quot;, rand_0).Scan(&amp;calendar_id, &amp;reservation_id, &amp;title, &amp;company_id)

atomic.AddUint64(&amp;ops, 1)
atomic.AddUint64(&amp;s_select, 1)

            elapsed2 := time.Since(start2)
lat = elapsed2	    
            tt2 := fmt.Sprintf(&quot;Time SQL:= %s&quot;, elapsed2)
            w.Write([]byte(&quot;&lt;b&gt;&lt;pre&gt;cal_select &quot; + fmt.Sprintf(&quot;%v&quot;, company_id) + &quot; &quot; + title + &quot;&lt;font color=yellow&gt; &quot; + tt2 + &quot;&lt;/font&gt;&lt;/b&gt;&lt;/pre&gt;&quot;))
            now := time.Now()
            epoc_now := now.Unix()
            hostname, err := os.Hostname()
	    
	    if carbon_enabled == true {
	    Tcc(fmt.Sprintf(&quot;GF.TEST.%s.CAL-SELECT.SQL-FUNC %d %d&quot;, hostname, elapsed2, epoc_now))
	    }
            
            title = randomdata.Paragraph()
            start3 := time.Now()
            err = db.QueryRow(&quot;UPDATE uuid.cal_insert SET title=$4 WHERE company_id=$1 AND calendar_id=$2 AND reservation_id=$3 RETURNING title&quot;, company_id, calendar_id, reservation_id, title).Scan(&amp;title)
atomic.AddUint64(&amp;ops, 1)
atomic.AddUint64(&amp;s_update, 1)
            elapsed3 := time.Since(start3)
lat = elapsed3	    
            tt3 := fmt.Sprintf(&quot;Time SQL:= %s&quot;, elapsed3)
            
            w.Write([]byte(&quot;&lt;b&gt;&lt;pre&gt;cal_update &quot; + fmt.Sprintf(&quot;%v&quot;, company_id) + &quot; &quot; + title + &quot;&lt;font color=yellow&gt; &quot; + tt3 + &quot;&lt;/font&gt;&lt;/b&gt;&lt;/pre&gt;&quot;))
            //Carbon Format
            now = time.Now()
            epoc_now = now.Unix()
            hostname, err = os.Hostname()
	    
	    if carbon_enabled == true {
	    Tcc(fmt.Sprintf(&quot;GF.TEST.%s.CAL-UPDATE.SQL-FUNC %d %d&quot;, hostname, elapsed3, epoc_now))
	    }
/*
 */
            rand_1 := rand.Intn(1156)
            start4 := time.Now()
	    err = db.QueryRow(&quot;SELECT calendar_id, reservation_id, title, company_id FROM uuid.cal_insert WHERE company_id = $1 LIMIT 1&quot;, rand_1).Scan(&amp;calendar_id, &amp;reservation_id, &amp;title, &amp;company_id)
atomic.AddUint64(&amp;s_select, 1)	    
atomic.AddUint64(&amp;ops, 1)	    
            elapsed4 := time.Since(start4)
lat = elapsed4	    
            tt4 := fmt.Sprintf(&quot;Time SQL:= %s&quot;, elapsed4)
            w.Write([]byte(&quot;&lt;b&gt;&lt;pre&gt;cal_select &quot; + fmt.Sprintf(&quot;%v&quot;, company_id) + &quot; &quot; + title + &quot;&lt;font color=yellow&gt; &quot; + tt4 + &quot;&lt;/font&gt;&lt;/b&gt;&lt;/pre&gt;&quot;)) 
            now = time.Now()
            epoc_now = now.Unix()
            hostname, err = os.Hostname()

	    if carbon_enabled == true {
	    Tcc(fmt.Sprintf(&quot;GF.TEST.%s.CAL-INSERT.SQL-FUNC %d %d&quot;, hostname, elapsed2, epoc_now))
	    }
            //fmt.Printf(&quot;GF.TEST.%s.CAL-SELECT %d %d\n&quot;, hostname, elapsed4, epoc_now) 
/*
 */
            rand_2 := rand.Intn(1156)
            start5 := time.Now()
            err = db.QueryRow(&quot;SELECT calendar_id, reservation_id, company_id FROM uuid.cal_insert WHERE company_id = $1 LIMIT 1&quot;, rand_2).Scan(&amp;calendar_id, &amp;reservation_id, &amp;company_id)
atomic.AddUint64(&amp;s_select, 1)	    
atomic.AddUint64(&amp;ops, 1)	    
            elapsed5 := time.Since(start5)
lat = elapsed5	    
            tt5 := fmt.Sprintf(&quot;Time SQL:= %s&quot;, elapsed5)
            w.Write([]byte(&quot;&lt;b&gt;&lt;pre&gt;cal_select &quot; + fmt.Sprintf(&quot;%v&quot;, company_id) + &quot; &quot; + reservation_id + &quot;&lt;font color=yellow&gt; &quot; + tt5 + &quot;&lt;/font&gt;&lt;/b&gt;&lt;/pre&gt;&quot;)) 
            now = time.Now()
            epoc_now = now.Unix()
            hostname, err = os.Hostname()
            
	    if carbon_enabled == true {
	    Tcc(fmt.Sprintf(&quot;GF.TEST.%s.CAL-SELECT.SQL-FUNC %d %d&quot;, hostname, elapsed5, epoc_now))
	    }
	    //fmt.Printf(&quot;GF.TEST.%s.CAL-SELECT %d %d\n&quot;, hostname, elapsed5, epoc_now) 

            start6 := time.Now()
            db.Exec(`DELETE FROM uuid.cal_insert WHERE company_id=$1 AND reservation_id=$2 AND calendar_id=$3;`, company_id, reservation_id, calendar_id)
atomic.AddUint64(&amp;ops, 1)
atomic.AddUint64(&amp;s_delete, 1)
            elapsed6 := time.Since(start6)
lat = elapsed6	    
            tt6 := fmt.Sprintf(&quot;Time SQL:= %s&quot;, elapsed6)
            w.Write([]byte(&quot;&lt;b&gt;&lt;pre&gt;cal_delete &quot; + fmt.Sprintf(&quot;%v&quot;, company_id) + &quot; &quot; + reservation_id + &quot;&lt;font color=yellow&gt; &quot; + tt6 + &quot;&lt;/font&gt;&lt;/b&gt;&lt;/pre&gt;&quot;)) 
            now = time.Now()
            epoc_now = now.Unix()
            hostname, err = os.Hostname()
	    
	    if carbon_enabled == true {
	    Tcc(fmt.Sprintf(&quot;GF.TEST.%s.CAL-DELETE.SQL-FUNC %d %d&quot;, hostname, elapsed6, epoc_now))
	    }
            //fmt.Printf(&quot;GF.TEST.%s.CAL-DELETE %d %d\n&quot;, hostname, elapsed6, epoc_now)
            
            
            rand_3 := rand.Intn(1156)
            res_id, err := newUUID()
            calendar_id, err = newUUID()
            reservation_id, err = newUUID()
            company_id = rand_3
            title = randomdata.Paragraph()
            location := randomdata.ProvinceForCountry(&quot;US&quot;)
            organizer_email := randomdata.Email()
            reservation_begin, reservation_end := gen_meeting()
            t1 := time.Unix(reservation_begin, 0).UTC()
            t2 := time.Unix(reservation_end, 0).UTC()
            
            start7 := time.Now()
            err = db.QueryRow(&quot;INSERT INTO uuid.cal_insert (calendar_id, reservation_id, company_id, title, location, organizer_email, reservation_begin, reservation_end) VALUES($1, $2, $3, $4, $5, $6, $7, $8) RETURNING reservation_id&quot;, calendar_id, res_id, company_id, title, location, organizer_email, t1, t2).Scan(&amp;reservation_id)

atomic.AddUint64(&amp;ops, 1)
atomic.AddUint64(&amp;s_insert, 1)

            elapsed7 := time.Since(start7)
lat = elapsed7	    
            tt7 := fmt.Sprintf(&quot;Time SQL:= %s&quot;, elapsed7)
            w.Write([]byte(&quot;&lt;b&gt;&lt;pre&gt;cal_insert &quot; + fmt.Sprintf(&quot;%v&quot;, company_id) + &quot; &quot; + reservation_id + &quot;&lt;font color=yellow&gt; &quot; + tt7 + &quot;&lt;/font&gt;&lt;/b&gt;&lt;/pre&gt;&quot;))
            now = time.Now()
            epoc_now = now.Unix()
            hostname, err = os.Hostname()
	    
	    if carbon_enabled == true {
	    Tcc(fmt.Sprintf(&quot;GF.TEST.%s.CAL-INSERT.SQL-FUNC %d %d&quot;, hostname, elapsed7, epoc_now))
	    }
            //fmt.Printf(&quot;GF.TEST.%s.CAL-INSERT %d %d\n&quot;, hostname, elapsed7, epoc_now) //Write Carbon

            
    for sel_c := 1; sel_c &lt;= 40; sel_c++ {
            rand_0 := rand.Intn(1156)
            start := time.Now()
            err = db.QueryRow(&quot;SELECT calendar_id, reservation_id, company_id FROM uuid.cal_insert WHERE company_id = $1 LIMIT 1&quot;, rand_0).Scan(&amp;calendar_id, &amp;reservation_id, &amp;company_id)
atomic.AddUint64(&amp;s_select, 1)
atomic.AddUint64(&amp;ops, 1)
            elapsed := time.Since(start)
            tt1 := fmt.Sprintf(&quot;Time SQL:= %s&quot;, elapsed)
            w.Write([]byte(&quot;&lt;b&gt;&lt;pre&gt;cal_select_loop &quot; + fmt.Sprintf(&quot;%v&quot;, company_id) + &quot; &quot; + reservation_id + &quot;&lt;font color=yellow&gt; &quot; + tt1 + &quot;&lt;/font&gt;&lt;/b&gt;&lt;/pre&gt;&quot;))
            now = time.Now()
            epoc_now = now.Unix()
            hostname, err = os.Hostname()
	    
	    if carbon_enabled == true {
	    Tcc(fmt.Sprintf(&quot;GF.TEST.%s.CAL-SELECT.SQL-FUNC %d %d&quot;, hostname, elapsed, epoc_now))
	    }
            //fmt.Printf(&quot;GF.TEST.%s.CAL-SELECT %d %d\n&quot;, hostname, elapsed, epoc_now)
    }
            
            run_c++
            if err != nil {}

        }
    db.Close()
    w.Write([]byte(&quot;DONE WHHEEEEE!&quot;))
    now := time.Now()
    epoc_now := now.Unix()
    hostname, err := os.Hostname()
    elapsed := time.Since(start_init)

atomic.AddUint64(&amp;rps, 1)

    if carbon_enabled == true {
    Tcc(fmt.Sprintf(&quot;GF.TEST.%s.CAL-BLK.SQL-FUNC %d %d&quot;, hostname, elapsed, epoc_now))
    }
    //fmt.Printf(&quot;GF.TEST.%s.CAL-BLK.SQL-FUNC %d %d\n&quot;, hostname, elapsed, epoc_now) //Write Carbon
    
    }
    
    
func cal_prep(w http.ResponseWriter, r *http.Request) {
        
            w.Header().Set(&quot;X-ENGINE&quot;, &quot;V2&quot;)
            w.Header().Set(&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;)
            w.Header().Set(&quot;X-TEST&quot;, &quot;cal_prep&quot;)
            w.Header().Set(&quot;Content-Type&quot;, &quot;text/html&quot;)
            
            psqlInfo := fmt.Sprintf(&quot;host=%s port=%d user=%s password=%s dbname=%s fallback_application_name=%s connect_timeout=%d sslmode=disable&quot;, host, port, user, password, dbname, fallback_application_name, connect_timeout)
            db, err := sql.Open(&quot;postgres&quot;, psqlInfo)
                if err != nil {
            panic(err)
                }
            defer db.Close()
            err = db.Ping()
                if err != nil {
            panic(err)
                }

		fmt.Fprintf(w, &quot;&lt;pre&gt;CREATE DATABASE uuid&lt;br&gt;&quot;)
		db.Exec(`CREATE DATABASE uuid;`)
		fmt.Fprintf(w, &quot;CREATE TABLE IF NOT EXISTS uuid.cal_insert&lt;br&gt;&quot;)
                db.Exec(`CREATE TABLE IF NOT EXISTS uuid.cal_insert (
                    calendar_id                              UUID NOT NULL,
                    reservation_id                           UUID NOT NULL,
                    company_id                               INT NOT NULL,
                    title                                    STRING NOT NULL,
                    location                                 STRING NOT NULL,
                    organizer_email                          STRING NOT NULL,
                    time_now                                 TIMESTAMPTZ NOT NULL DEFAULT now(),
                    reservation_begin                        TIMESTAMP WITHOUT TIME ZONE NOT NULL,
                    reservation_end                          TIMESTAMP WITHOUT TIME ZONE NOT NULL,
                    PRIMARY KEY                              (calendar_id, reservation_id),
                    INDEX company_id_idx                     (company_id),
                    INDEX reservation_begin_idx              (reservation_begin),
                    INDEX reservation_end_idx                (reservation_end)
                );`)
		fmt.Fprintf(w, &quot;DONE&quot;)
		
}


func cal_truncate(w http.ResponseWriter, r *http.Request) {
        
            w.Header().Set(&quot;X-ENGINE&quot;, &quot;V2&quot;)
            w.Header().Set(&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;)
            w.Header().Set(&quot;X-TEST&quot;, &quot;cal_truncate&quot;)
            w.Header().Set(&quot;Content-Type&quot;, &quot;text/html&quot;)
            
            psqlInfo := fmt.Sprintf(&quot;host=%s port=%d user=%s password=%s dbname=%s fallback_application_name=%s connect_timeout=%d sslmode=disable&quot;, host, port, user, password, dbname, fallback_application_name, connect_timeout)
            db, err := sql.Open(&quot;postgres&quot;, psqlInfo)
                if err != nil {
            panic(err)
                }
            defer db.Close()
            err = db.Ping()
                if err != nil {
            panic(err)
                }
		fmt.Fprintf(w, &quot;&lt;pre&gt;TRUNCATE uuid.cal_insert&lt;br&gt;&quot;)
		db.Exec(`TRUNCATE TABLE uuid.cal_insert;`)
		fmt.Fprintf(w, &quot;DONE&quot;)
}


 func show_sessions(w http.ResponseWriter, r *http.Request) {
            w.Header().Set(&quot;X-ENGINE&quot;, &quot;V8&quot;)
            w.Header().Set(&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;)
            w.Header().Set(&quot;X-NIKI&quot;, &quot;FOREST GODES&quot;)
            psqlInfo := fmt.Sprintf(&quot;host=%s port=%d user=%s password=%s dbname=%s fallback_application_name=%s connect_timeout=%d sslmode=disable&quot;, host, port, user, password, dbname, fallback_application_name, connect_timeout)
            db, err := sql.Open(&quot;postgres&quot;, psqlInfo)
                if err != nil {
            panic(err)
                }
            defer db.Close()
            err = db.Ping()
                if err != nil {
            panic(err)
                }
//            fmt.Printf(&quot;\033[92mSuccessfully connected!\033[0m\n&quot;)
            w.Write([]byte(&quot;&lt;body style=background-color:grey;&gt;&quot;))
            w.Write([]byte(&quot;&lt;h1&gt; DB SESSIONS &lt;/h1&gt;&quot;))
            
            node_id := &quot;&quot;
            session_id := &quot;&quot;
            user_name := &quot;&quot;
            client_address := &quot;&quot;
            application_name := &quot;&quot;
            active_queries := &quot;&quot;
            last_active_query := &quot;&quot;
            session_start := &quot;&quot;
            oldest_query_start := &quot;&quot;
            
        rows, err := db.Query(&quot;SELECT * FROM [SHOW CLUSTER SESSIONS]&quot;) //.Scan( &amp;node_id, &amp;session_id, &amp;user_name, &amp;client_address, &amp;application_name, &amp;active_queries, &amp;last_active_query, &amp;session_start, &amp;oldest_query_start)
                if err != nil {
                    panic(err)
                }
            defer rows.Close()
        for rows.Next() {
            //var node_id string
            //NEED to ADD condition for nil when a cockroach node is down!!!
            var oldest_query_start sql.NullString
            err = rows.Scan(&amp;node_id, &amp;session_id, &amp;user_name, &amp;client_address, &amp;application_name, &amp;active_queries, &amp;last_active_query, &amp;session_start, &amp;oldest_query_start)
                if err != nil {
                    panic(err)
                }
            w.Write([]byte(&quot;&lt;b&gt;&lt;pre&gt;&lt;font color=cyan&gt; &quot; + &quot;|&quot; + node_id + &quot;|&quot; + session_id + &quot;|&quot; + user_name + &quot;|&quot; + client_address + &quot;|&quot; + application_name + &quot;|&quot; + active_queries + &quot;|&quot; + last_active_query + &quot;|&quot; + session_start + &quot;|&quot; + fmt.Sprintf( &quot;%v&quot;, oldest_query_start ) + &quot;&lt;/b&gt;&lt;/pre&gt;&lt;/font&gt;&quot;))
//            fmt.Println(&quot;\033[91m&quot; + node_id, session_id, user_name, client_address, application_name, active_queries, last_active_query, session_start, oldest_query_start)
        }
            w.Write([]byte(&quot;&lt;b&gt;&lt;pre&gt;&lt;font color=yellow&gt; &quot; + &quot;|&quot; + node_id + &quot;|&quot; + session_id + &quot;|&quot; + user_name + &quot;|&quot; + client_address + &quot;|&quot; + application_name + &quot;|&quot; + active_queries + &quot;|&quot; + last_active_query + &quot;|&quot; + session_start + &quot;|&quot; + fmt.Sprintf( &quot;%v&quot;, oldest_query_start ) + &quot;&lt;/b&gt;&lt;/pre&gt;&lt;/font&gt;&quot;))
//            fmt.Println(node_id, session_id, user_name, client_address, application_name, active_queries, last_active_query, session_start, oldest_query_start)
   }

    func newUUID() (string, error) {
        uuid := make([]byte, 16)
        n, err := io.ReadFull(crand.Reader, uuid)
        if n != len(uuid) || err != nil {
                return &quot;&quot;, err
        }
        // variant bits; see section 4.1.1
        uuid[8] = uuid[8]&amp;^0xc0 | 0x80
        // version 4 (pseudo-random); see section 4.1.3
        uuid[6] = uuid[6]&amp;^0xf0 | 0x40
        return fmt.Sprintf(&quot;%x-%x-%x-%x-%x&quot;, uuid[0:4], uuid[4:6], uuid[6:8], uuid[8:10], uuid[10:]), nil 
    }

func gen_meeting() (int64, int64) {

        var log_max float64
        var random float64
        var log_random float64
        var six_months float64 = 15768000
        var one_day float64 = 86400
        var min_meeting float64 = 300
    rand.Seed(time.Now().UnixNano())
    rand_s1 := rand.Intn(32768)
    log_max = math.Log(32768)
    random = float64(rand_s1)
    log_random = math.Log(random)
    random_ratio := log_random / log_max
    random_future := random_ratio * six_months
    random_time := random_ratio * one_day
    date_epoc := time.Now().Unix()
    fdate_epoc := float64(date_epoc)
    real_future := fdate_epoc + six_months - random_future / 1
    real_apt := real_future + one_day - random_time + min_meeting //HAck job min_meeting
    scale_m := int64(real_future)
    scale_d := int64(real_apt)
        return scale_m, scale_d

}

func RandStringRunes(n int) string {
    b := make([]rune, n)
    for i := range b {
        b[i] = letterRunes[rand.Intn(len(letterRunes))]
    }
    return string(b)
}
</code></pre>

<hr />

<h1 id="tcp-go">tcp.go</h1>

<pre><code class="language-go">package main
import (
  &quot;fmt&quot;
  &quot;net&quot;
  &quot;time&quot;
)

func Tcc(metric string) {
    
        t_conn, err := net.DialTimeout(&quot;tcp&quot;, carbon_host + &quot;:&quot; + carbon_port , 60*time.Second) //Spawns a new connection each call //Need to find a clean way of doing this
        
go func() {
  if err != nil {
        blow_out = false
    return
  }
  defer t_conn.Close()
  for metric != &quot;&quot; {
    fmt.Fprintf(t_conn, &quot;%v\n&quot;, metric)
    metric = &quot;&quot;
    break
  }
  t_conn.Close()
}()  
}
</code></pre>
]]></content>
        </item>
        
        <item>
            <title>StarwarsAPI</title>
            <link>https://geekzoo.io:443/posts/starwarsapi/</link>
            <pubDate>Mon, 04 Nov 2019 18:39:45 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/starwarsapi/</guid>
            <description>./star_Wars.sh #!/bin/bash which jq pv gawk base64 zcat gzip 1&amp;gt;/dev/null if [ $? -eq 1 ]; then echo &amp;quot;$? Missing LIBS&amp;quot; exit fi # TODO ADD CHECKS for required Apps # TODO ADD Error checks for curl and jq # TODO ADD Lookup for ship ART NOW=$(date +%s) #START TIME URL=&amp;quot;https://swapi.co/api/starships/&amp;quot; #ENTRY URL NEXT=$(curl -s $URL |jq -r -c .next) #NEXT URL . data.sh echo -e &amp;quot;\n\n\n\n\e[1;34m\t[ $(echo $cont | base64 -d | zcat) ] \a\n\n\t[ STARWARS STATIC API ] \n\n\t[ The playback has been slowed down for your viewing enjoyment!</description>
            <content type="html"><![CDATA[

<h1 id="star-wars-sh">./star_Wars.sh</h1>

<pre><code class="language-bash">#!/bin/bash

which jq pv gawk base64 zcat gzip 1&gt;/dev/null
if [ $? -eq 1 ];
    then
      echo &quot;$? Missing LIBS&quot;
      exit
fi
# TODO ADD CHECKS for required Apps
# TODO ADD Error checks for curl and jq
# TODO ADD Lookup for ship ART

NOW=$(date +%s) #START TIME
URL=&quot;https://swapi.co/api/starships/&quot; #ENTRY URL
NEXT=$(curl -s $URL |jq -r -c .next) #NEXT URL
. data.sh

echo -e &quot;\n\n\n\n\e[1;34m\t[ $(echo $cont | base64 -d | zcat) ] \a\n\n\t[ STARWARS STATIC API ] \n\n\t[ The playback has been slowed down for your viewing enjoyment! ]\e[0m&quot; | pv -L10 2&gt;/dev/null
## LOGO for added cinematic output
echo -e &quot;\e[2m&quot; #SET TEXT COLOR
echo $logo | base64 -d | zcat |pv -L800 2&gt;/dev/null #READ LOGO at bytes/s
echo -e &quot;\e[0m&quot; #RESET TERM COLOR
printf &quot;\n\t\e[1;31m [ Initializing; Subspace transceiver.. ]\n\n\t [ Transceiver: [\e[1;5;32mREADY\e[0m\e[1;31m] ]\n\n\t [ Receiving long range transmission.. ]\n\n\n\e[0m&quot; | pv -L12 2&gt;/dev/null

processing() #processing function; slow character for added cinematic effect 15/20 bytes/s
{
    curl -s $1 |jq -r -c '.results[] | select((.name) and .pilots!=[]) | {name, pilots}'\
    |while read line; 
        do 
            echo -e &quot;\e[33mStarship: $(echo $line | jq -c '.name')\e[0m&quot;\
            |pv -L15 2&gt;/dev/null
            echo -e &quot;\e[178mPilots: \t\t\n$(echo $line | jq -c '.pilots' \
            |while read url; do curl -s $(echo $url |tr -d '[&quot;]' | tr ',' '\n')\
            |jq '.name' ;done) \e[0m&quot;\
            |pv -L20 2&gt;/dev/null
    done
}

while true
    do
    
if [[ &quot;$NEXT&quot; =~ ^https://*/ ]] &amp;&amp; [[ &quot;$NEXT&quot; != null ]]; #if next has https and is not null then run processing function and set NEXT to NEXT url
    then
            #echo &quot;NEXT-&gt; $NEXT&quot;
            processing $NEXT
            NEXT=$(curl -s $NEXT |jq '.next | @text' | tr -d '&quot;')
            
    else
            #echo DONE
            processing $URL # Process first URL ENTRY Page
            break
            
fi
done

DONE=$(date +%s)
echo -e &quot;\a\n\t[ TRANSMISSION TIME: $(expr $DONE - $NOW)/seconds]\n&quot; #Time ship/pilots api with out effect 22 seconds with effects 90 seconds
read -p &quot;Press Return/Enter for extra content&quot; #If interactive docker run -it NAME

#added cinematic effect 300 bytes/s and just for fun because I want you to remember me =) Rex
echo -e &quot;\e[178m&quot;
echo $intro |base64 -d |zcat |pv -L 300 2&gt;/dev/null 
echo -e &quot;\e[0m&quot;
</code></pre>

<hr />

<h1 id="data-sh">data.sh</h1>

<pre><code class="language-bash">#!/bin/bash
logo='H4sIAMYJqFsCA31Uy27EIAy88xUoqOqB4NzpZhWp1956RUrUXiv1B/zx9YsQstl6k4ANHsaDtc6fbbIRuqEz6Gd1pzsnTcMyTn6Dp+ner2Y6tYC7SBBa2xUbWZ+8ZSNPffHoeTgjvbXpJRYdfpdkSlcIjyilPLDKXSVbgrWvDqWuiUakGH/ppadwGF2/WXnd5nH9hnGF3zl99XKt9TnI5M9yQeVF9j6Xubwtt2E4S0VEJl+4xKNSIBLuxAyHea3frz/Lzed7WR4FQzsWT2KxitIRSkrCBdY5EZ+ybMN1PxTSq5hmB7VIRnc80G9f//Tkg+OqG55nXHf2eXVnEWwPW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2S7JHVuk2O86E12ut5W4G5DOb80BNp4TwZkdsnDxwMq81z4UCnfyofAAgJrVprbB2ChhTTc92E7OFuZC9tGpnzrh1NwK4ePE8Dv1//L7J9UfmS/pOELXy37578RSyeq0GoAAA=='
cont='H4sIAM+XY1wAA1NwqizKz1MISq1Q8E0sKclILS9WiFWIVrAwMNQ1NTTQNTEwNgELBOcH5+SX67mnpmZXObjnJmbm6Dnn5ypwAQAb2zQ9QQAAAA=='
</code></pre>

<hr />

<h1 id="dockerfile">Dockerfile</h1>

<pre><code class="language-docker">FROM ubuntu:18.04
RUN apt-get update
RUN apt -y install curl jq bash grep pv gzip gawk
COPY star_Wars.sh /
COPY data.sh /
RUN chmod +x star_Wars.sh
ENTRYPOINT ./star_Wars.sh
</code></pre>

<hr />
]]></content>
        </item>
        
        <item>
            <title>Docker bash completion Linux</title>
            <link>https://geekzoo.io:443/posts/dockerautocomplt/</link>
            <pubDate>Sun, 03 Nov 2019 20:41:36 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/dockerautocomplt/</guid>
            <description> tab compltetion sudo curl -Ls https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/bash/docker -o /etc/bash_completion.d/docker.sh &amp;lt;br&amp;gt; sudo curl -Ls https://raw.githubusercontent.com/docker/compose/1.24.1/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose&amp;lt;br&amp;gt; sudo curl -Ls https://raw.githubusercontent.com/docker/machine/v0.16.0/contrib/completion/bash/docker-machine.bash -o /etc/bash_completion.d/docker-machine&amp;lt;br&amp;gt;  </description>
            <content type="html"><![CDATA[

<h1 id="tab-compltetion">tab compltetion</h1>

<pre><code class="language-bash">sudo curl -Ls https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/bash/docker -o /etc/bash_completion.d/docker.sh &lt;br&gt;
sudo curl -Ls https://raw.githubusercontent.com/docker/compose/1.24.1/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose&lt;br&gt;
sudo curl -Ls https://raw.githubusercontent.com/docker/machine/v0.16.0/contrib/completion/bash/docker-machine.bash -o /etc/bash_completion.d/docker-machine&lt;br&gt;
</code></pre>
]]></content>
        </item>
        
        <item>
            <title>Docker Stacks: Part #3</title>
            <link>https://geekzoo.io:443/posts/easyswarm_prt2/</link>
            <pubDate>Sun, 03 Nov 2019 19:03:34 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/easyswarm_prt2/</guid>
            <description>Easy Swarm ./env.sh cluster 4  Out put: This will create a swarm master and n number of worker Need to INIT Running pre-create checks... Creating machine...  docker-machine ls  NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS cluster-1 - virtualbox Running tcp://192.168.99.102:2376 v19.03.4 cluster-2 - virtualbox Running tcp://192.168.99.103:2376 v19.03.4 cluster-3 - virtualbox Running tcp://192.168.99.104:2376 v19.03.4 cluster-4 - virtualbox Running tcp://192.168.99.105:2376 v19.03.4  Connecting to your cluster eval $(docker-machine env cluster-1)  Node Status docker node ls  ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION vewzxrvrw6ek9ru7qvy8kq22m * cluster-1 Ready Active Leader 19.</description>
            <content type="html"><![CDATA[

<h1 id="easy-swarm">Easy Swarm</h1>

<pre><code class="language-bash">./env.sh cluster  4
</code></pre>

<pre><code>Out put:
This will create a swarm master and n number of worker
Need to INIT 
Running pre-create checks...
Creating machine...
</code></pre>

<pre><code class="language-bash">docker-machine ls
</code></pre>

<pre><code class="language-bash">NAME             ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER     ERRORS
cluster-1        -        virtualbox   Running   tcp://192.168.99.102:2376           v19.03.4   
cluster-2        -        virtualbox   Running   tcp://192.168.99.103:2376           v19.03.4   
cluster-3        -        virtualbox   Running   tcp://192.168.99.104:2376           v19.03.4   
cluster-4        -        virtualbox   Running   tcp://192.168.99.105:2376           v19.03.4 
</code></pre>

<h1 id="connecting-to-your-cluster">Connecting to your cluster</h1>

<pre><code class="language-bash">eval $(docker-machine env cluster-1)
</code></pre>

<h1 id="node-status">Node Status</h1>

<pre><code class="language-bash">docker node ls
</code></pre>

<pre><code class="language-bash">ID                            HOSTNAME    STATUS  AVAILABILITY        MANAGER STATUS      ENGINE VERSION
vewzxrvrw6ek9ru7qvy8kq22m *   cluster-1   Ready   Active              Leader              19.03.4 
5d90hgsbab78w25jvlrljj3xo     cluster-2   Ready   Active                                  19.03.4 
wb6dkn078hn2wmggcmi7m8ckx     cluster-3   Ready   Active                                  19.03.4 
2pclynemm9cs7dtcgtejbbtxb     cluster-4   Ready   Active                                  19.03.4 
</code></pre>
]]></content>
        </item>
        
        <item>
            <title>EasySwarm</title>
            <link>https://geekzoo.io:443/posts/easyswarm/</link>
            <pubDate>Sun, 03 Nov 2019 18:49:37 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/easyswarm/</guid>
            <description>env.sh ClusterName 4  #!/bin/bash virt_cpus=$3 virt_memory=8196 stack_name=$1 stack_size=$2 swarm_master=$4 echo &amp;quot;This will create a swarm master and n number of worker&amp;quot; if [ -z &amp;quot;$virt_cpus&amp;quot; ] then virt_cpus=4 fi join_token=$(docker-machine ls \ |grep &amp;quot;Running&amp;quot; |awk &#39;{print $1}&#39; \ |while read line; do eval $(docker-machine env &amp;quot;$line&amp;quot;) &amp;amp;&amp;amp; docker swarm join-token worker 2&amp;gt;/dev/null |grep &amp;quot;docker swarm join&amp;quot;; done) if [ -z &amp;quot;$join_token&amp;quot; ] then echo &amp;quot;Need to INIT $join_token&amp;quot; fi if [ -z $1 ] then echo &amp;quot;Example: .</description>
            <content type="html"><![CDATA[<pre><code class="language-bash">env.sh ClusterName 4
</code></pre>

<pre><code class="language-bash">#!/bin/bash

virt_cpus=$3
virt_memory=8196
stack_name=$1
stack_size=$2
swarm_master=$4
echo &quot;This will create a swarm master and n number of worker&quot;
if [ -z &quot;$virt_cpus&quot; ]
then 
    virt_cpus=4
fi

join_token=$(docker-machine ls \
|grep &quot;Running&quot; |awk '{print $1}' \
|while read line; do eval $(docker-machine env &quot;$line&quot;) &amp;&amp; docker swarm join-token worker 2&gt;/dev/null |grep &quot;docker swarm join&quot;; done) 


if [ -z &quot;$join_token&quot; ]
then 
    echo &quot;Need to INIT $join_token&quot;
fi

if [ -z $1 ]
then
    echo &quot;Example: ./$(basename $0) SomeName NumberOfServers&quot;
    exit 1
    else

    for i in $(seq $stack_size)
        do
join_token=$(docker-machine ls \
|grep &quot;Running&quot; |awk '{print $1}' \
|while read line; do eval $(docker-machine env &quot;$line&quot;) &amp;&amp; docker swarm join-token worker 2&gt;/dev/null |grep &quot;docker swarm join&quot;; done | tail -1) 

            docker-machine create $stack_name-$i --virtualbox-cpu-count $virt_cpus --virtualbox-memory $virt_memory
            if [ -z &quot;$join_token&quot; ]
                then
                    eval $(docker-machine env $stack_name-$i)
                    docker swarm init --advertise-addr eth1
                else
                    eval $(docker-machine env $stack_name-$i)
                    $join_token
            fi
    done
fi
#Will error of not a manager node.
#eval $(docker-machine env $stack_name-1)
#docker stack deploy --with-registry-auth --compose-file docker-compose.yml your-stack-name
</code></pre>
]]></content>
        </item>
        
        <item>
            <title>Docker Stacks: Part #2</title>
            <link>https://geekzoo.io:443/posts/docker-machine/</link>
            <pubDate>Sun, 03 Nov 2019 12:28:17 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/docker-machine/</guid>
            <description> docker-machine create Starting a single docker host using Boot2Docker ubuntu image is quite easy.
docker-machine create standAloneHost --virtualbox-cpu-count 2 --virtualbox-memory 1024   This will automaticly start a VM and install the release version of docker, The new machine standAloneHost runs like the version installed locally.
 sudo docker run -it v8geekzoo/starwars  sudo docker-machine rm standAloneHost  </description>
            <content type="html"><![CDATA[

<h1 id="docker-machine-create">docker-machine create</h1>

<p>Starting a single docker host using Boot2Docker ubuntu image is quite easy.</p>

<pre><code class="language-bash">docker-machine create standAloneHost --virtualbox-cpu-count 2 --virtualbox-memory 1024
</code></pre>

<blockquote>
<p>This will automaticly start a VM and install the release version of docker, The new machine standAloneHost runs like the version installed locally.</p>
</blockquote>

<pre><code class="language-bash">sudo docker run -it v8geekzoo/starwars
</code></pre>

<pre><code class="language-bash">sudo docker-machine rm standAloneHost
</code></pre>
]]></content>
        </item>
        
        <item>
            <title>docker-machine -d drivers</title>
            <link>https://geekzoo.io:443/posts/docker-machine-create-driver/</link>
            <pubDate>Sun, 03 Nov 2019 12:28:17 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/docker-machine-create-driver/</guid>
            <description>Usage: docker-machine create [OPTIONS] [arg...] Create a machine Description: Run &#39;docker-machine create --driver name --help&#39; to include the create flags for that driver in the help text. Options: --amazonec2-access-key AWS Access Key [$AWS_ACCESS_KEY_ID] --amazonec2-ami AWS machine image [$AWS_AMI] --amazonec2-block-duration-minutes &#34;0&#34; AWS spot instance duration in minutes (60, 120, 180, 240, 300, or 360) --amazonec2-device-name &#34;/dev/sda1&#34; AWS root device name [$AWS_DEVICE_NAME] --amazonec2-endpoint Optional endpoint URL (hostname only or fully qualified URI) [$AWS_ENDPOINT] --amazonec2-iam-instance-profile AWS IAM Instance Profile [$AWS_INSTANCE_PROFILE] --amazonec2-insecure-transport Disable SSL when sending requests [$AWS_INSECURE_TRANSPORT] --amazonec2-instance-type &#34;</description>
            <content type="html"><![CDATA[<pre><h6>
Usage: docker-machine create [OPTIONS] [arg...]

Create a machine

Description:
   Run 'docker-machine create --driver name --help' to include the create flags for that driver in the help text.

Options:
   
   --amazonec2-access-key                                       AWS Access Key [$AWS_ACCESS_KEY_ID]
   --amazonec2-ami                                          AWS machine image [$AWS_AMI]
   --amazonec2-block-duration-minutes "0"                               AWS spot instance duration in minutes (60, 120, 180, 240, 300, or 360)
   --amazonec2-device-name "/dev/sda1"                                  AWS root device name [$AWS_DEVICE_NAME]
   --amazonec2-endpoint                                         Optional endpoint URL (hostname only or fully qualified URI) [$AWS_ENDPOINT]
   --amazonec2-iam-instance-profile                                     AWS IAM Instance Profile [$AWS_INSTANCE_PROFILE]
   --amazonec2-insecure-transport                                   Disable SSL when sending requests [$AWS_INSECURE_TRANSPORT]
   --amazonec2-instance-type "t2.micro"                                 AWS instance type [$AWS_INSTANCE_TYPE]
   --amazonec2-keypair-name                                         AWS keypair to use; requires --amazonec2-ssh-keypath [$AWS_KEYPAIR_NAME]
   --amazonec2-monitoring                                       Set this flag to enable CloudWatch monitoring
   --amazonec2-open-port [--amazonec2-open-port option --amazonec2-open-port option]            Make the specified port number accessible from the Internet
   --amazonec2-private-address-only                                 Only use a private IP address
   --amazonec2-region "us-east-1"                                   AWS region [$AWS_DEFAULT_REGION]
   --amazonec2-request-spot-instance                                    Set this flag to request spot instance
   --amazonec2-retries "5"                                      Set retry count for recoverable failures (use -1 to disable)
   --amazonec2-root-size "16"                                       AWS root disk size (in GB) [$AWS_ROOT_SIZE]
   --amazonec2-secret-key                                       AWS Secret Key [$AWS_SECRET_ACCESS_KEY]
   --amazonec2-security-group [--amazonec2-security-group option --amazonec2-security-group option] AWS VPC security group [$AWS_SECURITY_GROUP]
   --amazonec2-security-group-readonly                                  Skip adding default rules to security groups [$AWS_SECURITY_GROUP_READONLY]
   --amazonec2-session-token                                        AWS Session Token [$AWS_SESSION_TOKEN]
   --amazonec2-spot-price "0.50"                                    AWS spot instance bid price (in dollar)
   --amazonec2-ssh-keypath                                      SSH Key for Instance [$AWS_SSH_KEYPATH]
   --amazonec2-ssh-port "22"                                        SSH port [$AWS_SSH_PORT]
   --amazonec2-ssh-user "ubuntu"                                    SSH username [$AWS_SSH_USER]
   --amazonec2-subnet-id                                        AWS VPC subnet id [$AWS_SUBNET_ID]
   --amazonec2-tags                                             AWS Tags (e.g. key1,value1,key2,value2) [$AWS_TAGS]
   --amazonec2-use-ebs-optimized-instance                               Create an EBS optimized instance
   --amazonec2-use-private-address                                  Force the usage of private IP address
   --amazonec2-userdata                                         path to file with cloud-init user data [$AWS_USERDATA]
   --amazonec2-volume-type "gp2"                                    Amazon EBS volume type [$AWS_VOLUME_TYPE]
   --amazonec2-vpc-id                                           AWS VPC id [$AWS_VPC_ID]
   --amazonec2-zone "a"                                         AWS zone for instance (i.e. a,b,c,d,e) [$AWS_ZONE]
   --driver, -d "virtualbox"                                        Driver to create machine with. [$MACHINE_DRIVER]
   --engine-env [--engine-env option --engine-env option]                       Specify environment variables to set in the engine
   --engine-insecure-registry [--engine-insecure-registry option --engine-insecure-registry option] Specify insecure registries to allow with the created engine
   --engine-install-url "https://get.docker.com"                            Custom URL to use for engine installation [$MACHINE_DOCKER_INSTALL_URL]
   --engine-label [--engine-label option --engine-label option]                     Specify labels for the created engine
   --engine-opt [--engine-opt option --engine-opt option]                       Specify arbitrary flags to include with the created engine in the form flag=value
   --engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option]       Specify registry mirrors to use [$ENGINE_REGISTRY_MIRROR]
   --engine-storage-driver                                      Specify a storage driver to use with the engine
   --swarm                                              Configure Machine to join a Swarm cluster
   --swarm-addr                                             addr to advertise for Swarm (default: detect and use the machine IP)
   --swarm-discovery                                            Discovery service to use with Swarm
   --swarm-experimental                                         Enable Swarm experimental features
   --swarm-host "tcp://0.0.0.0:3376"                                    ip/socket to listen on for Swarm master
   --swarm-image "swarm:latest"                                     Specify Docker image to use for Swarm [$MACHINE_SWARM_IMAGE]
   --swarm-join-opt [--swarm-join-opt option --swarm-join-opt option]                   Define arbitrary flags for Swarm join
   --swarm-master                                           Configure Machine to be a Swarm master
   --swarm-opt [--swarm-opt option --swarm-opt option]                          Define arbitrary flags for Swarm master
   --swarm-strategy "spread"                                        Define a default scheduling strategy for Swarm
   --tls-san [--tls-san option --tls-san option]                            Support extra SANs for TLS certs
</pre>
]]></content>
        </item>
        
        <item>
            <title>Docker Stacks: Part #1</title>
            <link>https://geekzoo.io:443/posts/dockerstacks_prt1/</link>
            <pubDate>Sun, 03 Nov 2019 12:00:50 -0700</pubDate>
            
            <guid>https://geekzoo.io:443/posts/dockerstacks_prt1/</guid>
            <description>Install docker curl -sL https://get.docker.com/ | sudo sh -c sudo usermod -aG docker userName #may want to log out and back in.  Install virtualbox sudo apt install virtualbox sudo reboot  Install docker-machine curl -sL https://github.com/docker/machine/releases/download/v0.16.2/docker-machine-$(uname -s)-$(uname -m) &amp;gt;/tmp/docker-machine &amp;amp;&amp;amp; \ chmod +x /tmp/docker-machine &amp;amp;&amp;amp; \``` sudo cp /tmp/docker-machine /usr/local/bin/docker-machine  Install docker-compose $ sudo curl -sL &amp;quot;https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)&amp;quot; -o /usr/local/bin/docker-compose &amp;amp;&amp;amp; \ sudo chmod +x /usr/local/bin/docker-compose  Install All &amp;ldquo;One liner&amp;rdquo; $ curl -sL https://get.</description>
            <content type="html"><![CDATA[

<h1 id="install-docker">Install docker</h1>

<pre><code class="language-bash">curl -sL https://get.docker.com/ | sudo sh -c
sudo usermod -aG docker userName #may want to log out and back in.
</code></pre>

<hr />

<h1 id="install-virtualbox">Install virtualbox</h1>

<pre><code class="language-bash">sudo apt install virtualbox
sudo reboot
</code></pre>

<hr />

<h1 id="install-docker-machine">Install docker-machine</h1>

<pre><code class="language-bash">curl -sL https://github.com/docker/machine/releases/download/v0.16.2/docker-machine-$(uname -s)-$(uname -m) &gt;/tmp/docker-machine &amp;&amp; \
chmod +x /tmp/docker-machine &amp;&amp; \```
sudo cp /tmp/docker-machine /usr/local/bin/docker-machine
</code></pre>

<hr />

<h1 id="install-docker-compose">Install docker-compose</h1>

<pre><code class="language-bash">$ sudo curl -sL &quot;https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)&quot; -o /usr/local/bin/docker-compose &amp;&amp; \
sudo chmod +x /usr/local/bin/docker-compose
</code></pre>

<hr />

<h1 id="install-all-one-liner">Install All &ldquo;One liner&rdquo;</h1>

<pre><code class="language-bash">$ curl -sL https://get.docker.com/ | sudo sh -c &amp;&amp; \
sudo apt install virtualbox &amp;&amp; \
curl -sL https://github.com/docker/machine/releases/download/v0.16.2/docker-machine-$(uname -s)-$(uname -m) &gt;/tmp/docker-machine &amp;&amp; \
chmod +x /tmp/docker-machine &amp;&amp; \
sudo cp /tmp/docker-machine /usr/local/bin/docker-machine &amp;&amp; \
sudo curl -sL &quot;https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)&quot; -o /usr/local/bin/docker-compose &amp;&amp; \
sudo chmod +x /usr/local/bin/docker-compose
</code></pre>

<hr />
]]></content>
        </item>
        
    </channel>
</rss>
