Home Blog Page 2062

Provision a New Linux Dev Environment in Nothing Flat with Puppet

In this two-part series we’ll learn how to automate setting a up new development environment on Linux using Puppet and Vagrant.

Setting up a development environment for a web application can seem simple—just use SQLite and WEBrick or a similar development server—but taking shortcuts can quickly lead to problems. What happens when you need to onboard new team members? What if your team members are geographically distributed? How do you prevent bugs from creeping in when the production environment’s configuration drifts away from the development environment? Even if you’ve managed to set up a picture-perfect development environment, what happens when a developer inevitably breaks its configuration?

In the last few years a huge number of DevOps tools have sprung up to help teams automate the provisioning and configuration of their infrastructure. These include Puppet, a configuration management tool, and Vagrant, a tool to automate the management and provisioning of development environments. While these tools are often thought of as being most useful for Ops staff, this tutorial will show how they can be used to manage a development environment for a team working on a web application.

By taking advantage of the infrastructure-as-code approach of these tools, the configuration of environments can be version controlled along with the source code for the application itself. This allows developers to work in extremely realistic environments, often identical to those managing a production application, while reducing the overhead involved in managing the environment. It also significantly decreases the onboarding cost for a new developer: all they have to do is clone a repository, run a few simple commands, and they have their own copy of the environment up and running. Most importantly, it means that any changes to the setup to the environment can be immediately reflected across all copies of the environment through the use of version control systems.

In the first part of this tutorial, we’ll be examining how to use Vagrant to automate away the pain of managing VMs on your local system. The next part of the tutorial will show how to use Puppet’s powerful declarative language to simply describe the elements of your environment and their relations to each other. By the end of the series, you’ll be able to define a powerful, reusable development environment with just a few simple configuration files. This tutorial is oriented towards web application development, and will show how to configure a VM to run apache on code shared from your local machine.

Using Vagrant to Manage VMs

Vagrant is a configuration-centric tool for managing VMs on your local machine. Using Vagrant, you only need to write a simple file specifying certain attributes you want your system to have, and Vagrant takes care of provisioning and managing the VM for you. It also provides an elegant command line interface for interacting with the VMs.

In order to get started with Vagrant, you’ll need to download the appropriate version of VirtualBox for your system, since that’s what Vagrant uses on the backend. You’ll also need to grab the Vagrant package for your distro and add /opt/vagrant/bin to your PATH. In the examples we’ll be using Debian 6.0, but all you should need to change is which packages you grab and install.

$ wget http://download.virtualbox.org/virtualbox/4.2.6/virtualbox-4.2_4.2.6-82870~Debian~squeeze_i386.deb
$ sudo dpkg -i virtualbox-4.2_4.2.6-82870~Debian~squeeze_i386.deb
$ wget http://files.vagrantup.com/packages/476b19a9e5f499b5d0b9d4aba5c0b16ebe434311/vagrant_i686.deb
$ sudo dpkg -i vagrant_i686.deb

We’ll also need to grab a boxfile. Boxfiles are the base images Vagrant builds its VMs on, specifying things like disk capacity and the installed operating system. For our environment we’ll grab a simple boxfile for a Lucid 32-bit system:

$ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box

Creating our source controlled development environment

Now we can create a directory for our dev environment. We’ll also go ahead and initialize it as a git repository.

$ mkdir sample-dev-env
$ cd sample-dev-env 
$ touch Vagrantfile
$ git init
$ git add Vagrantfile 
$ git commit -m "Starting our new dev environment"

The Vagrantfile we’ve just created is the central configuration file that Vagrant uses to determine the configuration of the VMs it manages. You can automatically generate a sample Vagrantfile with lots of documentation in it by running vagrant init, but for now we’ll just set up our own Vagrantfile to configure one VM with the boxfile we’ve added, and set it up to forward port 80 on the VM to port 3000 on our local machine so we can access the webapp being run on the VM on our local machine:

Vagrant::Config.run do |config|
  config.vm.box = "lucid32"
  config.vm.forward_port 80, 3000
end

That’s it! Vagrant automatically shares any files in the project directory to a shared folder located at /vagrant on the VM, so if we just put our web app folder into the dev env directory and execute vagrant up, vagrant will bring up a virtual machine with our code on it. Accessing that virtual machine is simplified by the use of vagrant ssh, the ssh wrapper Vagrant provides for accessing your VMs.

$ vagrant up
$ vagrant ssh
$ ls /vagrant
 Vagrantfile your_webapp_here

Now that we have a Vagrantfile that defines our basic configuration, we can commit our changes to our dev env git repo:

$ git add Vagrantfile
$ git commit -m "Basic Vagrantfile"

Of course, that still leaves us with a lot of work to do: how do we make sure the necessary libraries and packages are installed? How do we ensure the webapp is running? How do we configure the system so that Apache can find our web application? In the next part of this tutorial, we’ll learn how to use Puppet to provision our Vagrant-managed virtual machines, so that developers can go from scratch to having a working VM serving your app just by cloning your repository and running vagrant up.

Continue the tutorial with part 2: How to Jumpstart Linux Development with Puppet and Vagrant.

 

The H Roundup – Microsoft study, Firefox 18.0.1 and Mega security

 

The H Roundup logoThis week, Mozilla has released an update to Firefox 18 that fixes stability issues and the developers of the unofficial Waterfox fork have delivered a version for Windows users who want a 64-bit version of the browser. In the meantime, a controversial and unpublished study from Microsoft and HP claimed that the City of Munich’s migration to Linux had cost the taxpayer a lot more money than officially announced.

 

 

Read more at The H

A Philosophy To Suck Less

dwm-20100318sAt times, I feel like I’m a bit on my own in my opinions of software. Most of it is too big, too bloated, and tries to do too many things while doing none of them well. I like to keep a minimalist approach to the servers I maintain, running only the software that I absolutely need, and nothing more. So, it feels like a breath of fresh air to find suckless.org, “software that sucks less”.

While most of my ideas about server setup and design are from a sysadmin’s level, the members of the suckless.org community are focused on far deeper problems, citing issues with core libraries and programming languages. For example, under their Stuff that sucks page:

These libraries are broken/considered harmful and should not be used if it’s possible to avoid them. If you use them, consider looking for alternatives.

Poettering: The Biggest Myths

LWN.net LogoLennart Poettering decided to refute a few systemd myths on his blog, where “a few” means “30”. “There’s certainly some truth in that. systemd’s sources do not contain a single line of code originating from original UNIX. However, we drive inspiration from UNIX, and thus there’s a ton of UNIX in systemd. For example, the UNIX idea of ‘everything is a file’ finds reflection in that in systemd all services are exposed at runtime in a kernel file system, the cgroupfs. Then, one of the original features of UNIX was multi-seat support, based on built-in terminal support. Text terminals are hardly the state of the art how you interface with your computer these days however. With systemd we brought native multi-seat support back, but this time with full support for today’s hardware, covering graphics, mice, audio, webcams and more, and all that fully automatic, hotplug-capable and without configuration.

Read more at LWN

Linux 3.2 To 3.8 Kernels With Intel Ivy Bridge Graphics

With the Intel Haswell product launch coming up soon, here’s a look at how the Intel “Ivy Bridge” HD 4000 graphics support has matured on the seven most recent Linux kernel releases. This benchmarking shows how the performance of the Intel DRM driver has changed between the Linux 3.2 kernel and the Linux 3.8 kernel that’s presently under development when using the integrated graphics found on the latest-generation Core i7 CPU.

Read more at Phoronix

openSUSE Hiring Artist, Graphic Designer

Suse, the company behind openSUSE, has a job opening for artist/graphical designer. The candidate will focus on the openSUSE distribution and help the team in creating different artwork needed for the project like merchandising, banners, etc.

Since openSUSE is a community driven project the candidate will have to work with the openSUSE community prior experience with FLOSS communities will be a plus. The candidate will work with several senior graphical designers at SUSE.

According to the posting:

The openSUSE Team, together with the openSUSE community develop a wide variety of activities that requires design skills, such as the distribution itself, tools interfaces….Read more at Muktware

Development Release: Elive 2.1.27 (Unstable)

A new public development release of Elive, a Debian-based distribution featuring a highly customised Enlightenment 0.17 desktop, is out and ready for testing: “The Elive team is proud to announce the release of development version 2.1.27. This version includes some miscellaneous features like: multiple improvements in Enlightenment 0.17….Read more at DistroWatch

Google Is One Of The Biggest Backers Of Coreboot

Last week I pointed out how Google is contributing a lot to Coreboot since they are enjoying this open-source BIOS/UEFI because they can ship it on Chrome OS devices for allowing very fast boot times, great customization possibilities, and good security with having full source access. In this article are some development statistics surrounding Coreboot to show the most prolific contributors, the pace of development, and other traits for this open-source project formerly known as LinuxBIOS…

Read more at Phoronix

Top 3 Linux Video Editors

 Linux gets my pick as the best multi-media production platform because it is flexible, efficient, and secure. Your system resources are going to your work, rather than in supporting a bloaty operating system further bogged down by marginally-effective anti-malware software. In our previous installment we covered a range of excellent drawing and painting, photography, 3D rendering, and desktop publishing applications for Linux. And my favorite Linux distros for serious multi-media production.

Today we’re going to enjoy a tasty sampling of the high-quality video creation and editing software for Linux. You oldtimers are probably familiar with these, but there are more Linux newcomers than ever, so let’s start with…

OpenShot

I really really really like OpenShot. It probably won’t impress professional videographers who like having a million bells and whistles (or maybe it will), but it impresses me for its useful feature set and excellent user interface. This is my #1 choice for beginning video editors because of its ease-of-use, and its well-chosen feature set.

https://www.youtube.com/watch?v=fvfLwj4PAhM?feature=player_embedded” scrolling=”yes” frameborder=”0″ allowtransparency=”no” width=”500px” height=”281px

The Power of Love, Gabrielle Aplin, created with OpenShot and Ardour

It supports high-definition video, Blu-Ray, 3D, tethered shooting, integration of video, audio, and still images, all the usual effects such as scrolling titles, pans, and fades, animations, speed changes, audio mixing, export to multiple formats and quality levels including YouTube and Vimeo, and tons more. It is under active development and has great community support. This may be the only video program you’ll ever need.

Blender

Blender is a fabulously sophisticated 3D computer graphics and animation creator. Check out the Blender gallery for a sampling of movies created with Blender. It supports a large range of high-end abilities such as ray-tracing, key-frame animation tools, object tracking, super nice character modeling, realistic physics for great liquid and smoke/mist/gas effects, and realistic movements of objects and characters, and excellent realistic light effects.

blender-gallery

The main learning curve with Blender is developing a grasp of all of these concepts; once you get that part down it’s like a light goes on and everything makes sense. It also has a nice game-creation module, and superior compositing.

Cinelarra

Cinelarra is for video producers who need more than OpenShot, and who want a native Linux professional-quality video editor that supports high-resolution audio and video, and advanced features such as hue and saturation, overlays, denoising, compression, normalization, time stretching, realtime effects, nested sequences, color balance, image flipping, text-to-movie, batch render and batch capture, compositing, and much more. Cinelarra has nice integration between audio and video, and makes it easy to control synchronization. Blender and Cinelarra work well together; create your splendid animations in Blender and then integrate them into a movie in Cinelarra.cinelarra

Cinelarra has two versions: the unsupported community version and a commercial edition. Every six months the nice Cinelarra developers release the latest source code. It’s not widely available in the usual distro repositories, but the good Cinelerra-CV folks bundle it up into Arch, Debian, Fedora, Ubuntu, and other distro packages. There is a Cinelarra PPA— Personal Package Archive– for Ubuntu users. PPAs are user-supported repositories for specific applications, like Cinelarra. They’re not official repos, but they allow you to use your normal Ubuntu package manager to install and remove third-party software.

Of course there are many more good video editors for Linux such as Kdenlive, PiTiVi, Avidemux, and Lightworks for Linux keeps getting a lot of attention even though it’s still vapor. It is a feast of riches, so enjoy!

Three great years of sharing the open source story

the seeds of open source

Three years ago today we flipped the switch on at opensource.com. Technically, we removed the htaccess file to allow anyone to access the site. Since that point, we’ve been steadily providing stories that highlight how open source is having a positive impact on the world and building a community around that mission…Read more at OpenSource.com