Home Blog Page 738

Howdy, Ubuntu on Windows! Write and Execute Your First Program

Microsoft’s addition of the Bash shell and Ubuntu user space in Windows 10 is a real win for developers working in dynamic, interpreted programming languages everywhere. Dozens of dynamic script interpreters are now immediately available on Windows desktops.

In this article, we’re going to write the classic “hello world” application in several different dynamically executed languages, install any necessary dependencies, and execute our interpreted code.

If you’d like to follow along this article and try out these examples, you can grab all of the source code from Git:

$ sudo apt update

$ sudo apt install -y git

$ git clone https://github.com/dustinkirkland/howdy-windows.git

$ cd howdy-windows

 

Now, let’s look at each language:

  1. Bash

  • Installation

    • None, bash is always installed in the default image, but just in case…

    • sudo apt install -y bash

  • Code: bash/howdy.sh

#!/bin/sh

echo ”    ====> Shell: Howdy, Windows!”

  • Compilation

    • None, bash is an interpreted language

  • Execution

        $ chmod +x ./bash/howdy.sh

$ ./bash/howdy.sh

   ====> Shell: Howdy, Windows!

  1. Python

  • Installation

    • None, python is always installed in the default image, but just in case…

$ sudo apt install -y python

  • Code: python/howdy.py

        #!/usr/bin/python

print(”    ====> Python: Howdy, Windows!”)

  • Compilation

    • None, python is an interpreted language

  • Execution

        $ chmod +x ./python/howdy.py

$ ./python/howdy.py

   ====> Python: Howdy, Windows!

  1. Perl

  • Installation

$ sudo apt install -y perl

  • Code: perl/howdy.pl

        #!/usr/bin/perl

print(”    ====> Perl: Howdy, Windows!n”);

  • Compilation

    • None, Perl is an interpreted language

  • Execution

        $ chmod +x ./perl/howdy.pl

$ ./perl/howdy.pl

   ====> Perl: Howdy, Windows!

  1. Ruby

  • Installation

$ sudo apt install -y ruby

  • Code: ruby/howdy.rb

        #!/usr/bin/ruby

puts ”    ====> Ruby: Howdy, Windows!”

  • Compilation

    • None, Ruby is an interpreted language

  • Execution

        $ chmod +x ./ruby/howdy.rb

$ ./ruby/howdy.rb

   ====> Ruby: Howdy, Windows!

  1. PHP

  • Installation

$ sudo apt install -y php5-cli

  • Code: php/howdy.php

        #!/usr/bin/php

<?php

 print(”    ===> PHP: Howdy, Windows!n”)

?>

  • Compilation

    • None, PHP is an interpreted language

  • Execution

        $ chmod +x ./php/howdy.php

$ ./php/howdy.php

   ===> PHP: Howdy, Windows!

  1. Node.js

  • Installation

$ sudo apt install -y nodejs

  • Code: nodejs/howdy.js

        console.log(‘    ====> NodeJS: Howdy, Windows!’);

  • Compilation

    • None, Node.js is an interpreted language

  • Execution

        $ nodejs nodejs//howdy.js

   ====> NodeJS: Howdy, Windows!

 

Cheers,

Dustin

Read the next article in the series: Howdy, Ubuntu on Windows! Writing for Compiled Languages

Read previous articles in the series:

Howdy, Ubuntu on Windows! An Intro From Canonical’s Dustin Kirkland

Howdy, Ubuntu on Windows! Getting Started

Howdy, Ubuntu on Windows! Ubuntu Commands Every Windows User Should Learn

Learn more about Running Linux Workloads on Microsoft Azure in this on-demand webinar with guest speaker Ian Philpot of Microsoft. Watch Now >> 

With ChakraCore on Linux, Microsoft Doesn’t Discriminate

At Node Summit this week, Microsoft announced the availability of ChakraCore for Linux. ChakraCore is the core part of the Chakra JavaScript engine that powers Microsoft Edge and Universal Windows Platform. 

With this move, Microsoft is putting one of its core technologies on a competing platform. This, more than any other Linux-friendly move the company has made, is a clear departure from the Microsoft of Gates and Ballmer that used its technologies to lock users into Windows.

Chakra engineers wrote in a blog post that there is no discrimination between Windows and Linux. “ChakraCore and by extension Node-ChakraCore, on other platforms have the same support for the broad set of JavaScript features as their Windows counterparts, …”

Read more at CIO

Scheduling Your Kubernetes Pods With Elixir

Kelsey Hightower gave a really interesting talk at ContainerSched about how to create your own scheduler using the Kubernetes HTTP API. The talk was awesome. It’s incredible to see what kind of things you can do with a base system as good as Kubernetes.

However, I missed one thing. The example provided by Kelsey was a Go application. Which is the main language used with Kubernetes. So, if check that code without any context, you might think it’s using some kind of Kubernetes internal packages. But it’s not! It’s a standalone piece of code that happens to make some HTTP calls.

To illustrate this point, I decided to write my own scheduler, in a different language. In my case,Elixir, because that’s the language I happen to be learning at the moment.

Read more at DEIS

Docker 1.12 Debuts, Bringing Windows, Mac Desktop Editions

Desktop development environments for Mac and Windows use native virtualization for speed and boost Docker’s out-of-the-box cluster management and scheduling system.

Docker unveiled version 1.12 of its core software-containerization system today, along with the first full desktop editions of the software for development on Mac and Windows machines. Docker for Mac and Docker for Windows, which debuted as beta products earlier this year,  provide developers on those platforms with something that had always seemed out of reach: the ability to do container work with Docker as a native application.

Read more at InfoWorld

Stable Mitaka HA instack-virt-setup on CentOS 7.2 VIRTHOST

Following is step by step self sufficient instruction performing Mitaka HA instack-virt-setup on CentOS 7.2 VIRTHOST based on delorean repos  :-

http://trunk.rdoproject.org/centos7-mitaka/current/delorean.repo
http://trunk.rdoproject.org/centos7-mitaka/delorean-deps.repo

It follows official guide lines and updates undercloud with OVSIntPort vlan10 for br-ctlplane OVS bridge making posible HA and/or Ceph overcloud deployments with “Network Isolation” enabled. See also upstream commit https://review.openstack.org/#/c/329438/  been done by Marios Andreou on 06/14/2016

Complete text may be seen at http://bderzhavets.blogspot.com/2016/07/stable-mitaka-ha-instack-virt-setup.html

How to Set Up a UFW firewall on Ubuntu 16.04 LTS Server

Firewalls screen data coming in and out of computer networks, blocking unauthorized access and halting traffic from unsafe Internet sources. A firewall is a barrier between you and the internet. UFW is is uncomplicated firewall for Ubuntu and Debian based server. It is used for managing a Linux firewall and aims to provide an easy to use interface for the user.

In this tutorial you will learn how to use UFW a front end to iptables for managing firewall on Ubuntu Linux 16.04 LTS server to restrict traffic on my personal web-server that hosts my pictures and blogs for my family members.

Read full article

 

XenServer 7 – Pool Upgrade via CLI and XenCenter Web Interface

The first article in this XenServer 7 Series covered how to install/upgrade a single XenServer host. Most XenServer installs are likely to be in a pool of many XenServer hosts.

This article will cover the process of an entire XenServer pool upgrade. The final component will cover some house keeping with the guests running on the XenServer hosts.

[[ This is a content summary only. Visit my website for full links, other content, and more! ]]

Read full article

Selling Open Source the Smart Way

Open source software is experiencing huge growth, with a staggering 64% of companies currently participating in open source projects. But you probably know that already. What’s more interesting to look at is how to sell it, and with a little luck, make some money to help support the people who develop your software and sustain your project.

Why we love open source software

Having a deep understanding of why so many organizations use and trust open source is key when it comes to selling it. As one of our own GitLab colleagues explains, it “allows for a level of transparency which closed sourced products do not have; …”

Read more at OpenSource.com

Facebook Tries a New Way to Release Open-Source Projects

Last week, Facebook launched Create React App, a new project that helps React developers get started with their new projects. Turns out, that was only part of the story. Create React App was also the first project to enter the Facebook Incubator on GitHub.

The Facebook Incubator is the company’s new process for releasing open-source projects and ensuring that they do well in the long run. The best way to think of it is as a beta stage or proving ground for new open source projects from Facebook.

As Facebook’s head of open source James Pearce told me, the idea here is to better manage the life cycle of these projects.

Read more at TechCrunch

5 Best Calendar Apps for Linux Desktop

Time is money, as goes an old saying, therefore you need to manage it very well. This then calls for proper planning of your daily schedule, future events, appointments and several other daily activities…

You can only achieve this efficiently and flexibly by using a calendar application especially on your Linux desktop. In this article, we shall walk through a brief review of some of the best calendar applications that can help us plan and manage our daily lives.

[[ This is a content summary only. Visit my website for full links, other content, and more! ]]