Joined May 2013
·

Pierre-François CLEMENT

System engineer at Mediamath
·
·
·

I like the "read-into-vim" trick, but you should note that netcat transmits whatever you're sending in cleartext, so better not use this method with sensitive data. You can add a security layer by tunnelling this through SSH, but generally you might want to consider using the scp command instead as it is secure and has bash-completion enabled for both your locally configured SSH hosts AND remote paths.

Posted to High-Value Shell Aliasing over 1 year ago

Thanks for this reminder. You may also want to check fasd for "frecency-based" file/path searching, which is an absolute time saver for me.

Here's my protip about it, for that matter :)

You may also want to use the --oneline and the --decorate native options, in case you need to use git-log on a machine where you don't have your own aliases.

You don't need that condition:

if [ "$NEEDS_STASH" -eq "1" ] ; then
   git stash;
else
   echo "Nothing to stash.";
fi;

If there's nothing to stash, git-stash will tell you.

Posted to Learning Python? Use Vim + dotfiles over 1 year ago

@vogelar I guess you could've just ignored me if it was just for your own reference. Anyway, it's much nicer to read now, thanks :) +1 for the effort.

Posted to Learning Python? Use Vim + dotfiles over 1 year ago

@vogelar I got that... What I meant is that I would have expected you to digest it and sum the key parts for me. I may read your link, but I won't upvote your protip. In fact, I would downvote it if I could, cuz' a lazy copy-paste with no explanations is not a protip.

Posted to Learning Python? Use Vim + dotfiles over 1 year ago

TS;DU (Too Short, Didn't Understand)
I have no clue what your 'code' does, what it's for, if it can be useful to me or not.

Posted to Easy Focus Mode in Vim over 1 year ago

A screenshot would be great.

EDIT: Much better, thanks. I might give it a try :)

Nice one. You can also use SSHFS if you don't need the whole performance stuff, cannot setup new services or are concerned about encryption if you cannot install NFS 4 (providing that SSH is already set up on the remote of course).

Posted to bash_profile backup over 1 year ago

Ha, I know that feel too; I used to save mine on Dropbox as well but I've recently switched to using gists for that kind of things, I find it more flexible. Here's mine, for that matter.

Seeing your folder / files aliases, you might want to have a look at fasd (and / or my protip about it in the meantime), it's a real time saver.

You might also want to check the pgrep and pkill commands, not that much of an improvement but it's just good to know they exist :)

I personally prefer to use git's --no-pager option with a good ol' alias (alias gp='git --no-pager') whenever I need it.

Nice tips. Thanks for sharing !

Interesting trick. Thanks for sharing

Breaking stuff remotely just became a lot easier. Thanks for sharing :)

Nice list that can come in handy. You can also use atool for managing file archives of various types with a single command (see atool's man page for usage information).

Posted to Git with intent to add! over 1 year ago

Interesting use of the --intent-to-add option. I personally prefer the interactive mode, but this is worth knowing. Cheers

I like the idea. Very nice! Thanks for sharing

Posted to Generate random ASCII from the shell over 1 year ago

That's not shell, that's ruby. Here's the shell-only equivalent to this; for those who, like me, don't have ruby and thought this protip was about shell:

$ cat /dev/urandom | tr -dc '0-9a-zA-Z!@#$%^&*_+-' | head -c 15
Posted to Open shell from vim over 1 year ago

Cool tip. Cheers

Posted to Managing letter case in vim over 1 year ago

Nice tips ! Cheers

Nice option, thanks for sharing. Note that you can disable the pager using the --no-pager option: $ git --no-pager diff --word-diff

Posted to WTF did I do?! over 1 year ago

I think you might have different commit and author dates. Git-log by default shows the author date and so does your log format; whereas --since and --until seem to filter by commit date.

Posted to WTF did I do?! over 1 year ago

You don't have to specify the entire date. Haver you tried with --since=2.days.ago --until=yesterday ?

Posted to WTF did I do?! over 1 year ago

Or, juste use the --since and --until options.

Posted to 'git pull' is evil! over 1 year ago

Even if you're an advanced git user, git-pull is perfectly safe whereas git-rebase is not. If you're updating a branch you're working on, you'll most likely want to fetch and check the changes before merging. But even if you don't, you can undo a blind git-pull with no harm to your repository nor your history by doing a simple git-reset (--hard or whatever option you need).

@cassianoleal @jwebcat I apologize for being a bit aggressive. All I wanted to say is that git-pull is absolutely not evil, nor dangerous, nor dead; and git-rebase is a nice tool for special cases but I can't see any reason why it should be a better approach than git-pull / git-merge.

Posted to 'git pull' is evil! over 1 year ago

@cassianoleal Ha, yeah thanks for pointing out that commit parents mistake. Edited :)

A spaghetti graph is perfectly bisectable, and does not lie about when you've committed changes or merges. I don't see the problem with using git-pull blindly; that's the safest way to go if you're a begitnner or don't get or don't need to get (yet) what git is all about.

The only drawback that seems to be valid is that git-pull does not produce a "linear" history graph but hey, that's exactly what Git wasn't made for. Git tries very hard not to mess up with your history and therefore has made merging changes easy; if you do rebase your upstream branches it seems to me you'd better use SVN instead as it's exactly the way SVN works and what Git is trying to avoid IMHO.

Posted to 'git pull' is evil! over 1 year ago

@cassianoleal @jwebcat This is bullshit. Git-pull is not evil at all, nor it is dead. All it does is a fetch and a merge in one go. If you find yourself fetching and merging often without changing anything in the process (and this WILL happen, if you update repos or branches you've not worked on for example), why not using git-pull ?

Also, merge commits aren't meaningless, even when merging your upstream branches. They're still commits and as such, they have all the informations normal commits usually have: parents (2 or more for a merge) so that you have a track of what was the repo's state when the merge has been done, a commit message, an author and commiter date / name / email, a reflog identity, they can provide you with stats and diff (and therefore patches) and, most importantly, they're bisectables.

@manuite I use git-flow on a daily basis and it's really a good model. Don't get too excited about hotfixes though, they should be used only rarely ;)

Posted to Some cool aliases for your computer over 1 year ago

What you need is "fasd". Check https://coderwall.com/p/k0wzwq .
Also, I personally prefer http://alias.sh/go-back-n-directories more than the "..." aliases.

Posted to Shell jobs in a pill <3 over 1 year ago

Basics, but still a good reminder.

Posted to Force SSH session exit over 1 year ago

Nice one! Quick and easy, thanks

Posted to git log following file rename over 1 year ago

Hm, good to know! Thanks

Posted to Git interactive add over 1 year ago

This only the patch mode. The interactive add is -i, --interactive.
Still, good tip : )

Posted to MySQL Pretty Print over 1 year ago

Nice tip, thanks!

Nice tip, thanks. You might want to symlink git-punchcard into /usr/local/bin instead of copying it.

Achievements
159 Karma
12,762 Total ProTip Views