Which automation tools/scripts do you use to save time and feel like a boss? - behnamoh
======
clarkenheim
A clipboard manager is an absolute have to have. Having the last 40 or so
clibboard items available to me instinctively has increased my productivity
and the speed at which i can do anything on a computer. I use the one that is
part of the Alfred power pack, but there are plenty of others out there.
[https://www.alfredapp.com/help/features/clipboard/](https://www.alfredapp.com/help/features/clipboard/)

~~~
sillysaurus3
This seems at odds with a password manager, though.

~~~
gargravarr
It's not about remembering passwords, it's for code snippets or URLs. I also
find these invaluable.

~~~
sillysaurus3
What I mean is, I'm constantly copying passwords to my clipboard, both to
generate them and to input them. This is an app which remembers clipboard
history. That means all my passwords will be stored in this history, which
makes it incompatible for my use case.

The documentation is less than clear about whether it can ignore apps:

 _By default, Alfred ignores popular password applications like the macOS
Keychain Access and 1Password, so that you don 't inadvertently copy a
password to your clipboard._

I don't want to prevent apps from copying to my clipboard. I want to prevent
Alfred from storing the history when I copy from a specific app (my password
manager).

I may as well just try it and find out, though.

~~~
gargravarr
My bad, sorry.

~~~
sillysaurus3
Oh, it's all good. I was mainly just wondering if anyone had any thoughts.

------
kodfodrasz
Whichever I have tried I always felt like a slave.

The ones with enough experience to hate thoroughly so far are:

\- bash

\- powershell

\- windows cmd/batch

\- ansible

\- terraform

\- azure clis, azure powershell api

\- aws python api, cli

\- Jenkins

\- MS Team Foundation Services

\- Docker (one of the nastiest ones)

\- Rancher

I always managed to solve the tasks with the tools at hand (one of these), but
all have so many weak points one must always work around, that I cannot say
any single one made me feel like a boss when I had to use them for any non-
trivial task.

If you want to feel like a boss, be a boss!

~~~
oneplane
Many tools are indeed not the 'feel like a boss' type, but the 'thoroughly
hate it' kind. Having tried plenty of tools for cfg mgmt for example, GPO,
Ansible and CFengine basically make you want to jump out of a window, as well
as diverse puppet versions. Same goes for SCM/VCS systems that can't even get
on Subversion-level, which by itself nowadays is a reason to not take a job.

------
valbaca
On a mac, so these are a must:

\- Workspaces! These help with focus and isolate the "blast radius" of getting
randomized

\- Spectacles: windows manager to assign windows to left/right side of
screeen, across monitors, or left, middle or right 1/3

\- CopyClip: I don't use this clipboard manager all the time, but when I do,
it SAVES MY BUTT

\- Sublime: speaking of saving my butt...Sublime has never once lost a single
file. I love Vim but Sublime has flawless reliability

\- Cmd+0: Global hotkey to "new browser window" If you do something 20+ times
a day, make it super stupid fast (I know it conflicts with "reset zoom" but I
can just manually adjust zoom back to 100%)

\- Shell scripts: If I'm typing more than 3+ commands over and over again,
just script it. Scripting isn't scary and more developers need to be doing it.
(I seem to be the only one on my team, which is why I say that)

------
natecavanaugh
For me, Keyboard Maestro[1], which is probably the one app I couldn't live
without. With it, I can do things like highlight any git sha (or any sha
range) in the terminal, press a keyboard command and it will launch my diff
tool with the diffs for just that commit. I also use it to do inline
transpiling of different code. I have keyboard commands for transpiling my
highlighted Sass or ES6 code and replacing it with the result.

It's so powerful, there's very little it can't do.

[1]: [https://www.keyboardmaestro.com](https://www.keyboardmaestro.com)

~~~
neurocroc
I too agree on usefulness of KM. Can you share that KM macro please?

~~~
natecavanaugh
Sure thing (I'm assuming you mean the git diff one):

[https://www.dropbox.com/s/3vrp9yk6d7d5f3j/Open%20Diff%20in%2...](https://www.dropbox.com/s/3vrp9yk6d7d5f3j/Open%20Diff%20in%20Kaleidoscope.kmmacros?dl=0)

I haven't gotten around to making it more generic (right now, it's really only
supporting iTerm, but it shouldn't be too hard to do the equivalent for
Terminal as well).

I'm using Kaleidoscope for my git diffs, but you can edit the first action to
being whatever command you want.

Hopefully that works for you, but let me know if you have any questions :)

------
gargravarr
Jenkins is fantastic because you can plug it into just about everything, and
trigger your job that does $whatever either on a timer, manually or with an
HTTP GET request. When I started at this company, Jenkins was nothing more
than a web server used to launch an all-encompassing build script on SVN
commit. Since then, I've redesigned all builds using plugins such that Jenkins
now manages the whole process (previous admins had reinvented so. f*cking.
much. stuff Jenkins does natively) and we're using Jenkins to automate just
about everything we can plug it into.

This and Powershell, which although its syntax is mind-bending and in some
cases just outright appalling, is a decent attempt at a scripting language
with exceptional power over Windows.

~~~
strictfp
Noo, builds shouldn't rely on Jenkins. I root for the previous admins.

~~~
gargravarr
By all means. Please picture the following:

-A folder full of batch files, each 2,000 lines long, that actually coordinate the builds

-A folder full of .exe's like 'findAndReplace.exe', 'EmailBuildBreakingAuthorsFromSVN.exe', replicating native Jenkins functionality, written in-house

-SVN.exe must be installed on the build node; if the build fails, the working copy is usually locked and must be manually Cleaned Up

-All build nodes run Windows XP Pro (including the Jenkins master)

This is what I had to deal with when I took over the cluster last year!!!

For the record, the whole cluster now runs on Win2012 with regular security
updates, and most builds use the .Net plugin to build the VS project using
msbuild. Those that can't, use Powershell scripts.

It has been a VERY long road...

~~~
strictfp
Ok, I wouldn't go that far. Also, windows builds are a pain :)

------
dangirsh
Emacs - even a novice elisp programmer has more power to automate their Emacs
environment than I've seen in any other tool. If you've ever wondered how a
small community managed to maintain near feature-parity with popular IDEs for
3 decades, this is it.

~~~
davelnewton
I'd disagree on "feature parity" for some usecases. For example, I used Emacs
as my Java IDE for some time, but it lost that race in a hurry as IDEs caught
up to JDEE. And it wasn't even close within a year or two after that.

I'm not even sure if Emacs will hold up to tools like IntelliJ for
Ruby/Rails/JavaScript development at this point, although in that space it's a
lot closer.

Overall, however, I agree: Emacs is freakin' awesome. Heck, I booted into it
as my shell for a few years. I keep meaning to get back into it but I rarely
have the time, and I need to learn more Vim as well. Time is the enemy.

------
falcolas
An automator script to gather AWS session credentials from a web-based
provider and paste them in '~/.aws/credentials' for local testing and
administration.

It's saved me an insane amount of time lately.

That said, my second biggest time saver has been saving language reference and
library docs to my local drive:

    
    
        #! /bin/bash
        wget --recursive --level=5 --convert-links --page-requisites --wait=1 --random-wait --timestamping --no-parent $@
    
        local_docs.sh http://docs.python.org/2.7/library/
    

Near-instant rendering, available anytime my computer is powered on, and they
still link to the external docs when I have to follow some esoteric link.

------
kemiller2002
I use a combination of F# scripts and PowerShell. Anytime I need to do data
manipulation, code generation, or anything hard core development related I use
F#. I could use PowerShell for this, but I'm more comfortable and feel I have
more control with fsx scripts. For all the server related tasks or automated
build tasks I use PowerShell. We're a heavy MS shop, and I get that it may not
work for everyone, but we leverage so many MS technologies that it just makes
sense to go with the flow.

------
viktorbenei
Bitrise! Both the open source CLI
([https://www.bitrise.io/cli](https://www.bitrise.io/cli)) and bitrise.io
(hosted service).

I'm obviously biased (CTO and Co-founder), but I love automation, that's why
I'm part of the bitrise team in the first place ;)

The CLI is similar to something like rake, but the config lives in a single
file which can be moved anywhere, and you can get a list of available "tasks"
(workflows in the bitrise terminology) by running `bitrise workflows` or
`bitrise run` without any parameter.

There's also an open source editor (UI) available for it
([https://discuss.bitrise.io/t/offline-workflow-editor-
workflo...](https://discuss.bitrise.io/t/offline-workflow-editor-workflow-
editor-v2/39)), which is now part of the "base plugins" which gets installed
by the Bitrise CLI. It's also really light weight, as the CLI is a single
binary distribution (written in Go).

------
tapoxi
My favorite tool this year has been SaltStack. It manages the entire lifecycle
of our VMs now (provisioning and state management) and it was very easy to
create a Slack bot with it that can update our production/dev environments.

Salt is a little confusing at first, since it's essentially just a framework
for systems management with Python + ZeroMQ, but you can do a _lot_ with it.

~~~
gouggoug
I've tried reading the saltstack doc many times, I still am very confused. To
the point that I've stuck to ansible, despite truly thinking saltstacks might
be better.

Is there any not confusing doc about saltstack available?

~~~
tapoxi
They recently rewrote the tutorial, which is available here:
[https://docs.saltstack.com/en/getstarted/](https://docs.saltstack.com/en/getstarted/)

The easiest way to learn Salt is by starting with execution modules
([https://docs.saltstack.com/en/latest/ref/modules/all/index.h...](https://docs.saltstack.com/en/latest/ref/modules/all/index.html)),
which are just Python modules that abstract the commands underneath and you
can blast to machines, such as salt 'web~' pkg.install httpd to install Apache
on all servers named _web_. You can send shell commands directly using cmd.run
- salt 'web~' cmd.run 'yum -y install httpd'

(Note: I replaced asterisks with tildes in the above example due to HN
formatting.)

On top of execution modules are state modules
([https://docs.saltstack.com/en/latest/ref/states/all/](https://docs.saltstack.com/en/latest/ref/states/all/)).
You define a state in YAML and tell a host to execute the state with the
_state.apply_ execution module. States consist of an id (a unique string
identifier), the state module to use, and arguments, like so:

    
    
      base.packages.stable.install:
        pkg.installed:
          - pkgs:
            - git
            - zsh
            - mosh
    

The other major components are _runners_
([https://docs.saltstack.com/en/latest/ref/runners/](https://docs.saltstack.com/en/latest/ref/runners/)),
which are scripts written against the salt API that perform actions on the
salt bus, and _engines_
([https://docs.saltstack.com/en/latest/topics/engines/index.ht...](https://docs.saltstack.com/en/latest/topics/engines/index.html)),
which are child processes spawned by the master that listen for and react to
events - like the Slack bot I use. One of the included engines is called
_reactor_ , which makes it easy to script events in YAML.

There are more moving parts I'm not covering here, but I hope this helps you
get started.

------
ivan_ah
For anyone using Mac OS X, I highly recommend setting up a keyboard shortcut
for the text-to-speech tool. See [1] for instructions and screenshots.

The computer voice is not too annoying, and it can read news articles and blog
posts to you, rather than wasting your eyes. I often do the dishes or exercise
while the computer reads hacker news to me.

The text-to-speech tool is also very useful to proofread any text you might be
writing—I catch a lot of typos this way.

[1]
[https://docs.google.com/document/d/1mApa60zJA8rgEm6T6GF0yIem...](https://docs.google.com/document/d/1mApa60zJA8rgEm6T6GF0yIem8qpMmnaBFYOgV32gdMc/edit)

------
mercwear
An answer for the less technical crowd: Zapier. It allows me to tie all of my
favorite tools together. Those that do not integrate natively can be accessed
via API if you want to put the time into it.

~~~
Xavdidtheshadow
Heck, this is great for technical people too. There's the public integrations,
but I use the dev platform for private things all the time. Takes some extra
coding, but once the interface is built everything else comes free. That plus
code steps and I'm set.

------
falsedan
The tab key.

------
outworlder
Terraform! Watching infrastructure being created and configured in seconds on
AWS (or even openstack) is amazing. Preferably paired with something like chef
or ansible.

------
hamilyon2
Vim, bash, sometimes python scripts

------
gouggoug
All of the automation tools out there always felt clunky to me. Ansible has
been working fairly OK so far for my usage, but I can't imagine using it if I
was managing hundreds of machines.

I considered using saltstack, but despite spending a few hours reading their
doc, I'm still very confused by all the lingo.

I recently started reading and considered using NixOS, but the still relative
newness (it's 14 years old!) makes me worry about missing packages and
updates.

~~~
djsumdog
I felt the same way about Saltstack. I've worked at shops that use Puppet
(with and without Hiera) and CFEngine. In my person projects I've used a lot
of Ansible.

Out of all the CM systems I've tried Ansible feels the most sane. It still has
a some things that annoy me, but overall I've found it the easiest to deal
with.

My current shop puts everything in Docker containers and runs them on DC/OS
scheduled via Marathon. I don't touch the CM parts anymore, but I think our
DC/OS team provisions the actual nodes via Puppet.

------
DanHulton
Ansible is basically my favourite automation tool, though I use it less to
"save time" and more for peace of mind. I can define how I want my servers set
up and ensure that every time I spin up a new one or make a deploy, all the
proper steps are followed automatically.

Though technically, this can save time in tracking down errors or weird state-
based bugs, I guess? So it even still qualifies under that.

------
cristobal23
Ansible is specifically geared for that boss like feel.

------
rdiddly
This might be a bit on the noob side but I always feel like a boss when I get
a complicated project set up to be built and deployed with one double-click or
keystroke. Even though it's just knowing how to use MSBUILD/NAnt/Ant/make and
robocopy/cp, it's still satisfying.

------
purple-dragon
I get a lot of lift out of ndjson-cli (though jq is a lot more popular) for
command-line JSON manipulation. I've found it incredibly powerful for
scripting and piping with web/RESTful services.

------
weitzj
Jenkins, Hammerspoon, Terraform,vim macros, FZF,bash-scripts (e.g. push this
branch to origin and open PR from this repo), fish-shell completions

------
oneplane
SaltStack, Preseed and Kickstart, Jenkins and GitLab CI, FreeIPA for proper
LDAP/Kerberos/Pubkeyauth.

------
sirolf
bash, tar, gzip, rsync, ssh, and perl.

------
neduma
Vim/Git/ITerm/Fish

------
rodjomatic
(Windows only) AutoHotkey!

------
mod
A mortising machine.

Craigslist searches.

------
0xdeadbeefbabe
Internet Explorer

------
thorat
Vim macros.

------
vgy7ujm
Perl

------
pragnesh
packer, fabric

