Setup Linux Your Way

· falasi.net


One Command to Set Up Any Linux Machine Your Way #

Every time I get a new machine or SSH into a fresh server, I end up doing the same thing: installing the same tools, setting the same aliases, fixing the same annoyances. So I wrote a script to do it for me.

The Problem #

Setting up a new Linux machine is tedious. Not hard just tedious. You forget something, you install it wrong, or you spend 20 minutes figuring out why sudo nano ignores your alias (spoiler: sudo doesn't inherit your shell aliases).

The Script #

The script is structured in sections so it's easy to add or remove things:

The symlink approach for the editor deserves a mention. Aliases don't work with sudo, and they don't survive SSH sessions on remote machines. A symlink does:

1sudo ln -sf $(which nvim) /usr/local/bin/nano

Now nano, vi, and nvim all open neovim for every user, every sudo command, every SSH session. No shell config needed.

Hosting It on pico.sh #

I host the script on pico.sh using their pastes service. Just signup with your terminal, no browser.

1# Upload
2scp setup.sh pastes.sh:/
3
4# Run on any new machine
5bash <(curl -fsSL https://youruser.pastes.sh/setup.sh/raw)

The /raw suffix gives you the plain text file, perfect for piping into bash. That one line is now all I need to go from a fresh install to a machine that feels like home.

Why pico.sh Over a GitHub Gist? #

Both work fine. But pico.sh fits the workflow better, you're already on the terminal, you deploy with scp or rsync, and there's no context switching to a browser. It also lets you update the script the same way:

1scp setup.sh pastes.sh:/

Done.

The Takeaway #

The script itself isn't special. What matters is having one — something you can run on any machine and trust that your environment will be exactly how you like it. Start simple, add to it over time, and host it somewhere you can always reach it.


Full script available at pico.sh pastes — upload your own with scp setup.sh pastes.sh:/

last updated: