Your Latest Workflow Improvement - Desktop Customization & Workflow
Users browsing this thread: 16 Guest(s)
|
|||
(28-10-2015, 02:36 PM)xero Wrote: # cat - with syntax highlighting! AAAAAARGH !! You're killing me bro! "$1" !!! By using only one argument, you destroy the ONLY purpose of cat! I'm particularly proud of my "ssh" workflow at work. I connect to many servers quite a lot, and thus optimized this process to make it simpler. I did 3 major things:
The first part is easy. I maintain a /etc/hosts file to map "decent" names to IPs on the network (the original names as provided by the DNS are pretty odd, and the DNS doesn't work well anyway. I know it 'cause it's part of my job to maintain it :P Sadly, I'm not the one who choose the servers names...). thanks to vim/curl and some shell glue, I now have a ~500 lines hosts file, meaning I can just run "ssh <hostname>" to connect to any host, using a name of MY invention, that I can easily recover from memory. The second part is the ssh config file. This one is the simplest part, I defined my "default" parameters, and specific ones: Code: host * You get the idea... The last part is actually the most interresting. My work terminal of choice is "rxvt-unicode", mostly because I know how it works in-depth, and something like "st" would make my productivity drop too much (for now...). It also let you bind keys to actions, and particularly the "string" actions which will input a string when you press a key. I created a script based on slmenu (beware, bitbucket link), which is basically a dmenu, but for the terminal. I then feed it with the hostnames from my /etc/hosts, and upon pressing <ENTER>, it connects to the chosen host. I then used the directive: "URxvt.keysym.F1: string:sshmenu\n" to have it started everytime I press F10 in a terminal. Simple, efficient! EDIT: here is video showing (at home) how it works: http://raw.z3bra.org/dev/random/ssh-menu.webm The difference here is that I need to run "sshmenu" by hand because I'm not using urxvt. At work, I only need to press F10 :) |
|||