Over on the VSCodeVim chatroom a bloke called Chris pointed me to the ‘Whichwrap’ setting for Vim mode in VSCode. In VSCode click File -> Preferences -> Settings; then in the Extensions / Vim settings search for ‘Whichwrap’ and enter: l,h
Tag Archives: line
Making SSH client use line buffered stream
So I found out about stdbuf. To get it:
# apt-get install coreutils
If you want your ssh client to use line-buffered streams use -t -t.
So I ended up with:
# su -c "stdbuf -oL ssh -t -t /usr/bin/tail -f /var/input.log | stdbuf -oL tr -c '\\11\\12\\15\\40-\\176" myuser \ | tee -a /tmp/input.log \ | grep --line-buffered -v "...ignore..." \ >> /tmp/output.log
Holy command-line Batman!
Trimming new line in bash
To trim new lines in bash:
tr -d '\r\n'
Creating a MySQL database from the command-line, and snipplr
Today I was looking up the syntax to create a MySQL database from the command-line and found instructions on Snipplr. I haven’t seen snipplr before. I guess I’ll have to spend some time one day browsing the popular snippets.
Starting a PuTTY session from the command-line
I think I’ve probably done this before (the links in my browser were marked as visited), but today I wanted to create a desktop/toolbar shortcut icon (with shortcut key) to a saved PuTTY session called “peace tunnel”. The “peace tunnel” opens an SSH session to a development server called “peace” and automatically configures a tunnel from port 80 on the localhost to port 80 on the server, so I can check on the progress of a web application under development.
Anyway, I found the documentation for Starting a session from the command line and basically to load my saved session called “peace tunnel” I had to run the command:
putty.exe -load "peace tunnel"