Using the Numpad in vi over SSH

One of the things that kept on bothering me when SSH’ing is that the keys of the numpad would not work in vi: when pressing any key on the numpad, another key would be sent somehow.

Should’ve Google’d this a lot earlier because the fix is very simple: in the preferences of Terminal, go to Profiles → Your Profile → Advanced and uncheck the “Allow VT100 application keypad mode” option.

You can also tweak this setting from the CLI using PlistBuddy:

/usr/libexec/PlistBuddy -c "Delete 'Window Settings':Pro:StrictVTKeypad" ~/Library/Preferences/com.apple.Terminal.plist > /dev/null 2>&1
/usr/libexec/PlistBuddy -c "Set 'Window Settings':Pro:StrictVTKeypad bool true" ~/Library/Preferences/com.apple.Terminal.plist

There, much better 🙂

☝ I’ve also added this tweak to ./freshinstall, a tool which I built to automatically configure my MacBook (Preferences, Dotfiles, Installed Software, etc)

Did this help you out? Like what you see?
Thank me with a coffee.

I don't do this for profit but a small one-time donation would surely put a smile on my face. Thanks!

☕️ Buy me a Coffee (€3)

To stay in the loop you can follow @bramus or follow @bramusblog on Twitter.

Execute commands over SSH from PHP with spatie/ssh

A new PHP package released by the fine folks at Spatie is spatie/ssh. Leveraging Symfony\Component\Process\Process it allows you to execute commands over SSH from within your PHP code.

spatie/ssh is probably the easiest way to perform a quick SSH command. It doesn’t have a lot of features, but that’s ok. It’s intended as something very lightweight.

$process = Ssh::create('user', 'example.com')
  ->usePort(2222)
  ->usePrivateKey('/home/user/.ssh/id_rsa')
  ->execute('your favorite command');

Also comes with download and upload functions, using scp under the hood.

Installation per composer:

composer require spatie/ssh

spatie/ssh (GitHub) →
spatie/ssh Introductory Post →

Why aren’t we using SSH for everything?

If we can write a chatroom on top of SSH, why don’t we use it for more things? Interesting read packed with dozens of facts about the SSH protocol and why we should use it for more things.

Why aren’t we using SSH for everything? →

(via)

Commando.io – Manage servers easily online

Never type the same commands into multiple terminal windows again!

From a technological point of view I’m impressed by this I must say! Not sure if I’d use it though (the shell works fine for me). Could be handy if you want to give some people limited (or monitored) shell access to a certain server. Might also be handy if you’re on the road or are blocked behind a firewall which revokes outgoing connections to port 22.

Commando.io – Manage servers easily online →

(via teusje)