Ask HN: How do you install developer tools on a fresh system?
I used to have a bash script I would run to install everything (libs/tools) you're average web developer would need (node, sublime, google chrome, , python libs etc etc). Unfortunately I lost it after some time. Does anyone use anything similar?
128 comments
[ 3.0 ms ] story [ 188 ms ] threadPackage customizations like a .vimrc is also handled by nix (I recently blogged about how I do this: https://www.mpscholten.de/nixos/2016/05/26/sharing-configura...).
The shell scripts together with the package customizations (e.g. my custom vimrc) are managed by git.
- System-wide packages, systemd services, users, cronjobs, etc. are managed by /etc/nixos/configuration.nix
- My user profile has one package installed, which depends on all of the tools I want to be generally available (emacs, firefox, etc.). By using a single meta-package like this, I can manage it using git and it makes updates/rollbacks easier
- Each project I work on maintains its own lists of dependencies (either directly in a .nix file, or converted automatically from other formats like .cabal), which are brought into scope by nix-shell
- I also have a bunch of scripts which use nix-shell shebangs, so their dependencies are fetched when invoked, and available for garbage collection once they're finished
Use VMs or containers for local simulation of your deployment targets.
http://pastebin.com/HmiqDDbi
Once you've set up a box-script, you may run it on a freshly installed windows, go to lunch, and when you return everything's set up.
There's a learning curve, and plenty of 'where did my afternoon go?' rabbit holes you can lose yourself in. But the upside is that you can have consistent, repeatable, and rapid builds, with modularity as a bonus.
Don't be afraid with any of these kinds of tools to brute force complex components if you're in a hurry - ie. ignore the pure / idiomatic way, and use the tool's primitives to dump a shell script on a remote box and then run it.
Also, +1 for using CM to set your workstation back up, I really need to get around to writing some Puppet manifests to do that for mine
For the development itself I'm either shipping my entire config (.vimrc for example) or use systems like spacemacs, sublimious or proton that only need 1 single file to re-install the entire state of the editor.
The install script itself [1] is then symlinking everyhing into place and executes stuff like pip install -r ~/.dotfiles/pip/packages.txt.
It takes a bit of effort to keep everything up to date but I'm never worried of loosing my "machine state". If I go to a new machine all I have to do is clone my dotfiles, execute install.sh and I have everything I need.
On servers I am using saltstack [2], a tool like puppet, ansible and friends, to ensure my machines are in the exact state I want them to be. I'm usually using the serverless version and push my states over SSH to them.
[0]: https://github.com/Homebrew/homebrew-bundle
[1]: https://github.com/dvcrn/dotfiles/blob/master/install.sh
[2]: https://saltstack.com
My head spins with these tools and every time I pick one I seem to eventually run into a road block that is a no-go. The most recent effort was ansible and the no-go was its strict dependency on python2.7.
The yaml makes it very easy to understand even if I come back to a state after months. It's just a list of things that should happen with a few template tags sprinkled in.
Not saying salt is better than puppet or friends. It's purely based on preference. I can't say anything to chef or ansible since I never tried them. Salt has a crazy active community and while there are things I don't like about it like the "name" of a state, it's still doing it's job just fine so I sticked with it.
(however, from my experience salt and ansible stay readable because they're yaml and not arbitrary code/DSL, whereas chef "recipes" are ruby and usually devolve into complex programs if you're not careful)
I have three exceptions to this: Vim (my editor of choice), dotfiles (which I store in a git repository and put in place using stow, installed via a simple bash script), and Vagrant, so I can do development testing against a VM.
As Docker matures, I may use it in place of Vagrant, but it's not ready to fill the same role quite yet.
Yes! A new machine is a great time to run a garbage collection cycle on my tools.
That said, I'm not a huge fan of Docker's feature churn; having to re-install, reconfigure, and re-learn tooling that is central to my workflow every other month gets old pretty quickly.
Right now I use a bash script I wrote to deploy my dotfiles into ~/, via symlink, including renaming existing files (after prompting the user).
I get what you mean about using that opportunity to do some spring cleaning. I find I need to do that to my Vim installation periodically too. I'll add a new plugin that looks like it will be useful, or add something for a new language or template system, then not use it enough to justify it.
Same. The core tools and libraries I use change more often than my development machine so when switching to a new machine it's a fun time to reassess what I need to install so I'm not carrying any baggage. I think the time automating the installation would be a net loss given how much I'd need it.
The setup required for building projects that I work on are automated using things like Vagrant so outside of that I only really need a few tools anyways.
/etc/popularity-contest.conf has the same timestamp, so I'm curious whether Ubuntu (or Debian) keep any statistics on the lifetime of a system.
Homebrew and Homebrew Cask on OS X handle at least 90% of what I want to install.
Unfortunately I don't have a public GH repo I can point at as I don't want to expose everything I use to the internet. However the principle is the same as provisioning servers with ansible.
The only thing different I do is I use GPG keys to decrypt and untar things like thunderbird profiles rather than using Ansible vault. I restore GPG keys + SHH keys from offline, encrypted USB backups.
Check it out if you haven't already.
On OSX, this is a no-brainer with brew[1] and brew cask[2]
# On my old mac
=> then I save relevant parts for future references [1] http://brew.sh/ [2] https://caskroom.github.io/Protip: "brew list" will list all installed packages, including dependencies, which you might not want. What you probably want is "brew leaves", where it lists all installed packages that are not dependencies of another installed package.
This makes a difference in cases where a dependency is no longer needed in the latest version.
On a related note, why does the majority of package managers make the common and simple task of "list all manually installed packages" so incredibly hard?
For a fun brain twister, try to list all the manually installed packages on your system by just reading the man pages and no internet. Ubuntu is nightmare mode for this challenge.
pacman -Qe
> brew
That right there is irony. You intended to give good advice about using reliable methods for installing software, then immediately recommend the Devils ass crack of package management tools.
In the future I'd like to try NixOS for managing OS X but it seems rather immature at this point for people that want stuff to Just Work primarily.
On OSX, this is a no-brainer with brew[1] and brew cask[2]
# On my old mac $ brew list $ brew cask list
=> save what I will need later as
``` brew install npm brew install zsh
brew cask install sublime-text brew cask install google-chrome brew cask install github brew cask install intellij-idea ```
[1] http://brew.sh/ [2] https://caskroom.github.io/
https://github.com/jwiegley/use-package
So my .emacs/init.el looks like
This has happened twice.
This upgrade cycle magit (my main reason for using emacs in the first place) broke all my muscle memory and added a ton of featurea I don't want or use.
I wish I could just freeze emacs development...without getting left behind when I want to install a new package... oh well...
See saltstack.
[0] https://github.com/michaelmior/dotfiles
Lazy comma usage. Come on!
This is my Ansible repo for reference: https://gitlab.com/edgard/ansible-ubuntu
And dotfiles: https://gitlab.com/edgard/dotfiles
I created a set of Debian packages that depend on suites of packages I need. I download and install "josh-apt-source", which installs the source in /etc/apt/sources.list.d and the key in /etc/apt/trusted.gpg.d/ , then "apt update" and "apt install josh-core josh-dev josh-gui ...". That same source package also builds configuration packages like "josh-config-sudoers".
You created a Debian installation of yourself. Simply run "apt install josh-core josh-dev...", and Josh will be ready to start developing on the system whenever he is connected.
Setting up conemu to autorun a script when opening a cmd, as well as configuring my bash profile. At work (more osx these days), I usually email myself the latest, and have a ~/.auth file thats 700 that I can source in to init my proxy settings (including ssh+corkscrew)... Allows me to only have to edit credentials in one location.
Or I have to install the PPAs before I can use the metapackage (which kind of defeats the idea of using a metapackage instead of a script)?