2014-05-22

Hackpad cli

In Faria we use hackpad a lot, it’s pretty useful. Mose made a command line interface so he can download all the pads locally and grep them all in one go. It also transforms the markdown much better than the original hackpad markdown export, which totally sucks (as for now). So pads can be recycled easily in github wiki pages.

2014-05-01

SSH to socket

I use a special trick because he’s often ssh’ing all over the place. Add in your .ssh/config

Host *
  ControlMaster auto
  ControlPath /tmp/%r@%h:%p

It will save your first connection to a host as a socket in /tmp and then all subsequent ssh connections to the same host are open instantly because there is no key renegotiation on the way. The side effect is that the child-connections cannot be closed until the first one closes, but I find it convenient because it tells me that I still have a console open on the server that I should close.

2012-10-28

Sublimetext2, plugins, sshfs

For 15 years I have been using vim and I don’t like IDEs. Of course I had to use eclipse and netbeans sometimes when coding in java. Java probably can’t be really well handled without a full-blown IDE anyways.But I didn’t like it, you get distance from your code, stuff happens behind the scene and I like to keep visibility on everything that happens.

But since I went into rails, I tried what was out there and there is a popular editor for the few rails coder that use Linux and not mac, called sublimetext2. And I have to say it just works fine for me (even if I will always keep my Vim not far). And I don’t feel any loss in control !

Here are a few tuning that I made or got from friends that I want to keep in memory, so I figured I should post about it.

Enable plugins manager

It’s not on by default and can be enable by copy-pasting this line into the console (view / console in the menu)

import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not  os.path.exists(ipp) else None;  urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print   'Please restart Sublime Text to finish installation'

Then just relaunch sublimetext and you can access the plugin manager using shift-ctrl-P and type ‘install’.

There is a damn long list of plugins you can add there (a list is on http://wbond.net/sublime_packages/community) and a few of them were advised to me that I should use: brackethighliter, docblockr, sublimecodeintel, sublimelinter, vintageex, git

sublimecodeintel seems to be the one that really does a lot of magic in there. The rest is for convenience and display of blocks in a more visual way,

Use sshfs for remote editing

Well this is not related to sublimetext but makes it easy to remote edit a dir when you have an ssh access. On Ubuntu you can just

apt-get install sshfs

and then

mkdir workdir && sshfs you@server:/path/to/dir workdir

so the remote dir pretends to be local now and can be opened by sublimetext easily. It’s of course adding some response time as the editor refreshes the file you browse each time you focus on it, but it works pretty fine for me.

Special thanks to beve that provided me those nice tricks.