Skip to main content

Posts

Showing posts with the label ssh

TwitVim: Tweeting in the vim

很久没更新了,因为很久没折腾了。 昨晚火星地发现了一个好东西:twitvim,是个vim script。 试用了下,很不错,该有的功能都有了。这里做个笔记。 1、安装 从 vim script 下载twitvim的vba包。 用vim打开下载到的twitvim.vba,输入 :so % 回车完成安装。 安装curl,twitvim需要curl来fetching。 sudo apt-get install curl 2、配置 在.vimrc里添加 let twitvim_login = " user:pwd " 试用api,则添加 let twivim_api_root = " api_url " 使用代理,添加 let twitvim_proxy = " proxyhost:proxyport " 3、使用 进入vim (via http://www.vim.org/scripts/script.php?script_id=2204 ) :PosttoTwitter - This command will prompt you for a message to send to Twitter. :CPosttoTwitter - This command posts the current line in the current buffer to Twitter. :BPosttoTwitter - This command posts the current buffer to Twitter. Alt-T - In Visual select mode, the Alt-T key posts the selected text to Twitter.   (use Ctrl-T instead if menu bar is enabled) NOTE: The T mapping was changed to Alt-T to avoid overriding the T search command. Alt-R - Starts a @-reply. (from timeline buffer) Alt-D - Starts a direct...

auto input pwd while ssh

As ssh became my first choice for going over GFW, a auto connected ssh tunnel is badly required. what i did for a long time is adding a application launcher whose property is set as "ssh -D port usr@host" to the panel. the tunnel will be established with one click and some pwd typing. I googled and find EXPECT. Step One: $sudo apt-get install expect Step Two: $vim ssh //create a new script. Step Three: //Input in Vim #!/usr/bin/expect spwan ssh -D port usr@host; expect "*password:"; send "pwd\r"; interact; //{esc};:wq;{enter} to save the file. Step Four: $chmod +x ssh Step Five: ./ssh Now the script will connect to ssh server automatically without requiring the pwd.