I'm using nix as a package manager on OSX. I've installed postgres. Now I'd like to start and stop the postgres server (and other related utilities). I can write a script to do this manually, and edit my config. But, is there a "best practice" way to do this on OSX? E.g. I found postgres configs under ~/.nix-profile/share, are there startup scrips for OSX somewhere?
I've not come across anything related to the nix project for running services in the nixpkgs repo directly on OS X.
If you just have a few services you want to run I believe you'd have to put the scripts together yourself as you suggest.
Alternatively disnix should do what you're after but it might be a bit overkill just for one machine.
Another option would be to deploy a nixos configuration into a (optionally headless) virtualbox instance with nixops.
I'm using this setup myself for a different use case, but it should certainly also support yours.
disnix, nixos and nixops are documented together with nix/nixpkgs on the nixos.org page.
Related
I'm starting to manage my dotfiles in my linux mint(ubuntu system). So, here I am writing a bash script automating the installation of my preferred apps. But I want that script to be system independent. Suppose when I become a mature user in linux system, I might want to switch to arch or something that's why I want to make dynamic scripting file which doesn't throw an error because my script says to download apps using apt or apt-get package manager and my system has pacman or dnf package manager.
How can I find out the system package manager?
If you want to manage systems on multiple distributions I recommend to look at a configuration management tool instead of writing something yourself.
The skills learned will be valuable in other situations as well.
Configuration management tools like ansible, chef or puppet have already solved the problem of determining the package manager of a specific distribution. (And will often hide the details in a more generic module.)
Also keep in mind that even with this information you will have to take into consideration that distributions can and do use different names for the same package.
E.g. Red Hat based distributions have a package called httpd for the apache web server. Debian based distributions will use apache2 packages instead.
Again configuration management tools allow you to define variables for each distribution family.
From what I understand, Ansible is agentless and can connect using OpenSSH. I believe that Ansible requires Python. We currently do not have Python available (Jython is available) on this mainframe, and I'm not sure that a reliable port exists, although I have found some possibilities (e.g. http://www.rocketsoftware.com/zos-open-source/python?ver=2.7.6).
Is Python, or anything else, required on the target server/mainframe to use Ansible to deploy files?
According to
the install docs,
the target machine should only need a functioning sshd and a pretty
old Python version.
You may be somewhat limited on the
modules
you can use with ZOS, but some will work, and you could probably write
more yourself.
I am using boot2docker which creates a VM of linux on OSX and allows you to use regular docker.
I am following thistutorial to try and use google's recent "deep dreams" image software. There is a python implementation on github that was released and become very popular. Not knowing python or the frameworks it comes with I decided to look for a simpler way to run it. So this guy made a container in docker to run it and explains how to set it up in that link. Unfortunately I am running into a bug where it denies the IP certificate. AS you can see..
As recommended by Sabin, this is what i get when i run the curl command.
I tried to adopt Vagrant in our team. I created a Vagrantfile and make provisioning in some way. Everything works as charm, but ...
It's unclear for me how I can automate some routine tasks like:
running django(I use django, but it's framework agnostic problem) dev server on 0.0.0.0
running grunt watcher
providing a separate console for django-specific commands
It is looks like vagrant not intended to help with this kind of automation and I look for some community adopted way to do that. I goggled and found nothing.
I see a few way to that:
bootstrap.sh script but messy and hard to mantain
something like tmuxinator -- requires tmux on host machine and now it's impossible to put tmuxconfig in project repo
etc
What is the 'canonical' way to resolve this problem?
P.S.: Please, think about designers, manual testers and other guys which like to use tools as is
In general you are best off using a provisioner. To be honest, a bootstrap.sh file is a good place to start unless you want to learn the ins and outs of something like chef / ansible / salt / puppet. If you do you might want to start at salt (SaltStack) because it is written in python which I'm guessing you use given the django angle.
For your specific questions:
Part of the point of vagrant is it lets you develop against real stacks and real web servers so you can avoid the "oh, that don't quite work the same on apache" moment that often comes in projects. So for your first question I would look at how to provision the app behind apache / nginx or whatever you are using for the production web servers.
Because of the shared file systems users can just run grunt locally on the host machine. This also lets grunt do things like hook into OSX notifications.
I'm not familiar with tmuxinator so I'm not sure how to start here. But if it is a service that the server really runs then you should figure out a way to package the install and deploy it to the provisioned VM. As for configuration, is it possible to get a dev config in the repo?
Same as #Wyatt, I recommend use Vagrant with provision tools, such as puppet, saltstack, chef, anisble, etc. These tools are created for the requirements you ask for, and most are open source. Choice is no wrong, you can start learning from any one, they are similar.
With that, you can quickly and easily run several VM servers with all applications installed automatically. With the customised Puppet codes or chef cookbooks, you can update them any time and provision to VM easily, you can re-use them for your PROD environment as well.
Take some times to learn one of these automation tools first, you will get benefit to save a lot of time.
I use Puppet, and recommend the best puppet book PRO PUPPET to you. It has all you need.
For the life of me I can't find the tool I ran across yesterday. It's not Homebrew (I already use Homebrew) what I found was a tool that I think was built in Ruby that allowed for installing regular .app applications and otherwise scripting most of an OS X config (I assume preferences and other things). I already have a script based on the Thoughtbot Ruby environment that I'm able to run successfully but I'd love the ability to script installing the other 20-30 apps that I use so that it would make reformatting a little easier.
Thanks!
You might be thinking of a configuration management tool like Chef. You can use this to bring up a system from a bare OS to the configured state defined in your recipes.
Personally I've only used it for setting up linux servers, but I think it would work just as well for launching installers and running configuration scripts on a Mac.
This is the tool I was looking for.
https://github.com/benhoskings/babushka