17 ms·
Things I found on GitHub: shell history
- wamatt 14y agoInteresting stats. I'd be wary however, of prematurely drawing any hard conclusions. For example comparing vim to emacs, one should rather look at whether the bash history indicates a predominantly emacs or vim user, then isolate or compartmentalize that as a single vote. Even then we can't be sure that it supports any grandiose claim, but it should in theory be a little more accurate.
- andrewvc 14y agoAgreed, also, for Vim vs. Emacs, most users of both probably use the GUI variants at this point, which leave no shell history. I still run emacs on remote terms, but then I don't make the mistake of uploading my bash history into a git repo.
- niggler 14y agoBoth can leave shell history. For example, on OSX I use MacVim with the mvim script to launch a new window. I use aquamacs with the eponymous command line tool as well
- jpiasetz 14y agoAny reason you would think more people use the GUI version? Although I obviously have a biases sample but everyone I know uses the shell version of both. The people I know who use the GUI use other editors.
- niggler 14y agoOS Integration -- copy-and-paste works better, scroll works predictably (there are quirks in OSX terminal using mouse mode in vim and in emacs), sensical full-screen mode Advanced features -- Certain things can't be done with the terminal. For example, Aquamacs lets you see inline latex previews: http://aquamacs.org/latex.shtml http://aquamacs.org/latex.shtml
- cheeseprocedure 14y agoI'm surprised to see ssh-keygen being called more often than ps. Perhaps this is skewed by history files being sourced from development boxes?
- deleted 14y ago[deleted]
- mtinkerhess 14y agoTogether, vim and vi have over four times as many invocations as emacs. I like to think it's beacuse vim is more popular, but it might also mean that vim users are more likely to pop in and out of vim while emacs users run emacs once and then never go back to bash-land.
- ripter 14y ago"vim users are more likely to pop in and out of vim" I suspect this is the case. I leave my emacs running for the entire work week. When I need to make a quick change and go back to the terminal I pop open vim.
- to3m 14y agoThis is what I do, too. I also load emacs by clicking an icon - I doubt I've run it from the terminal more than a handful of times. (I've never figured out how to make terminal emacs work properly anyway - half the keybindings don't work, and it's a different half in each terminal program.)
- pavel_lishin 14y agoDitto here. I've given up editing files remotely, except for trivial changes via vi/vim.
- thirsteh 14y agoIt might also mean that vim users are more likely to check their ~/.* files into a public Git repository. You really can't do that much with the information that vim was invoked more.
- merlincorey 14y agoIn addition to the fact that emacs is usually invoked once, and then operated from within, I think history deduplication could play a role as well. Essentially, the data is not so cut and dried.
- 14y ago
- IgorPartola 14y agoTip of the day: you can prevent embarrassing commits by using a global gitignore file: https://help.github.com/articles/ignoring-files https://help.github.com/articles/ignoring-files
- DaveInTucson 14y agoIf you also find little or no use for .bash_history, you can do this: rm ~/.bash_history ln -s ~/.bash_history /dev/null (There's probably some .bashrc setting that turns off history, but I'm making it a goal in my life to know as little about bash configuration as I possibly can.)
- niggler 14y ago$ unset HISTFILE The manpage for bash has many hidden gems
- IgorPartola 14y agoOne other cool thing: if your command starts with a space, it will not be logged to bash_history. For example: $ echo 'this is logged' $ echo 'this is not logged'
- Datsundere 14y agoGithub is amazing. But I don't like how it's exceptionally hard to delete history of commits. I've looked around for a long time to delete commits safely and people say things like "you shouldn't be doing it anyway." A free software should provide freedom to the user to do anything they wish. I fee like I'm chained down when I want to delete very old commits. I'm sure there are ways to delete commits, but it is just so complicated.
- tibbon 14y agoIt would be nice if there was a "delete all references to this file" button on Github. If suddenly a file is up there that was never supposed to be, a single click to purge it from all existence would be great.
- plorkyeran 14y agoDeleting commits in git is trivial compared to every other VCS I've used. Deleting the most recent commit is just 'git reset HEAD~1 --hard' and deleting an older commit is just 'git rebase -i commit-to-delete~1' and then remove the line for the appropriate commit. After deleting the commit locally, you then just have to push with -f to Github.
- sergiosgc 14y agoResetting the head to a previous commit will not delete the commit. It will be left dangling in the git the commit graph (it is not a head and has no children). Rebasing does delete the commit but can be done only on local commits (commits not yet pushed anywhere else). Never mess with the history of replicated repos!
- klodolph 14y ago"Never" is too strong here. There are plenty of legitimate reasons for messing with replicated history. For example, what if you have copyright violations (lifted code), personal details (SSNs), or child pornography in the repository's commit history. The advice is: "Messing with the history of replicated repos is a major undertaking and is not to be undertaken lightly." But I guess that doesn't roll of the tongue as well as "never".
- icambron 14y agoI suspect ln is at the top of the man list because no one can ever remember what order the arguments go in.
- pyre 14y agoln -s target link Easiest way to remember is that it's setup so that you can create multiple links to the same target. E.g.: ln -s /home/.bashrc {~user1,~user2,~user3}/.bashrc
- exit 14y agoi don't see what's impossible about parsing the arguments with target coming last, so i don't see how this works as a mnemonic
- icambron 14y agoThat is a good way to remember it, and also a feature of ln I didn't know. Thanks
- dsl 14y agoThis is bash specific and may not work in your shell. (fish for example)
- mitchty 14y agoWorks in zsh too, and you can tab auto-expand it to separate args if you like.
- tibbon 14y agoRubyist here; how does one install the BeautifulSoup module here (Macbook Pro with Mountain Lion)? ./ghrabber.py "path:.bash_history" File "./ghrabber.py", line 3, in <module> import BeautifulSoup ImportError: No module named BeautifulSoup I tried easy_install beautifulsoup but it gave a permissions error, so I ran it as sudo and that worked, but when I re-run the script it still throws the same error. Does python lack 'bundle install'-like functionality?
- alecdbrooks 14y agoTry using pip. You can install it with "easy_install pip" and then run "pip install beautifulsoup".
- kmfrk 14y agopip install beautifulsoup You might have to install pip with easy_install
- tibbon 14y agoThanks! With Python, do you have to manually install each module and keep track of the versions?
- pplante 14y agoIf you are using pip you can type "pip freeze" and it will spit out a list of all modules and the version currently installed. Most write this out to a file called "requirements.txt" in their project root. You can then use this list to install modules via "pip install -r requirements.txt" Same functionality as bundle install, just pythonic.
- kmfrk 14y agoWhat s/he said. Although keeping track of new updates is a bit of a pain, since there isn't a service like the one Rubyists have to get information about new gem versions. Pythonistas will have to use something like pip-tools < https://github.com/nvie/pip-tools https://github.com/nvie/pip-tools >, as far as I can tell.
- tibbon 14y agoAs always, I'm saddened to find how many people put their passwords out there in the plain... Searching for wp-config.php yields way too many results
- themgt 14y agoThis is arguably the fault of Wordpress developers for creating a config system which forces or at least encourages you to fork their code to set your database location. This is why configuration shouldn't go in code, ala 12factor: [1]: http://www.12factor.net/ http://www.12factor.net/
- tocomment 14y agoIs there any chance I could get a copy of your cleaned up data? I have an analysis I'd love to try running.
- songgao 14y agoThis might be a little off topic but I'm curious how could somebody accidentally (or why would somebody intentionally) push .bash_history to GitHub?
- gojomo 14y agoThere are some tasks I do infrequently enough I can't remember the paths, commands, and options... but my history always saves me. So when I know it's full of useful stuff, and especially when moving a bunch of files/functionality to a new place, I tend to create a copy of my .bash_history in another, non-hidden file. Of course such renamed files wouldn't have been part of this analysis, so it doesn't exactly explain why files exactly named .bash_history are in Github. (For that, I'd surmise many people make an entire project-specific login directory git-versioned.) But it does hint why someone might intentionally want to remember their history in version control. Done intentionally, it strikes me as a potentially valuable reproducibility, auditing, and training practice – documenting what was done around the time of other file evolution, making it easier for someone else to help out in a pinch with full context.
- damncabbage 14y agoVersioning their home directories to git, and doing it in-place instead of linking specific files from a ~/.dotfiles or similar. (See https://github.com/technicalpickles/homesick https://github.com/technicalpickles/homesick for an example of how to do it right.)
- tuananh 14y agoThis is why I push my .dotfiles to a private repo.
- Ologn 14y agoOn my Ubuntu, pico is a link to nano, and I usually type nano when I want to use it. I wonder what the editor results would show with nano thrown in. I'm surprised so many people use apt-get instead of aptitude - the only time I use apt-get is usually to install aptitude. Also surprised people use find so much. I use locate probably 80% of the time, find maybe 20% of the time or less. Operations like this are what caching was made for. I did not know tmux was a popular as it is. That's interesting. I am not surprised sublime is gaining in popularity...
- winter_blue 14y ago> I use locate probably 80% of the time, find maybe 20% of the time or less Absolutely true. find is way too slow. I was hacking on some AOSP code recently and finding a file took upwards of 1 minute. locate on the other indexes the files on your hard disk, so is generally much quicker.
- eik3_de 14y ago"exit" is at position 5 in the list -> there seem to be many console users that don't know CTRL-D