terminal

Export and Import Mongodb from Meteor APP

孤者浪人 提交于 2019-12-10 10:37:37
问题 How is it possible to Import and export the MongoDB from Meteor APP into .json or .csv file ? 回答1: You can use mongoexport utility to export into a .json or .csv file and mongoimport to import to your db. Detailed info is found here: http://docs.mongodb.org/v2.2/reference/mongoexport/ 回答2: If you intend to reimport into mongodb, mongodump might be a bit better since you won't be losing type information Try mongodump mongodump --host 127.0.0.1:3001 Here you get BSON, and separate key indexes

Use CMD-mappings in console Vim

谁都会走 提交于 2019-12-10 10:30:49
问题 Is there a way to use Cmd key for Vim in terminal? Something MacVim does. I have remapped Cmd+S in iTerm2 to send Esc:w!<CR> to save files in Vim, but this sounds a bit weak. With all the power of iTerm and Vim there should be some way to do this right? 回答1: It is possible, but it takes some doing and has some downsides. The first set of issues is that: although iTerm2 can accept the Command keys and pass them on to terminal programs, it can only do so by remapping them as something else, e.g

How to Show Build Results in OSX Terminal from Sublime Text 2

孤者浪人 提交于 2019-12-10 10:12:18
问题 I just switched to Sublime Text 2 from TextMate, and I absolutely like it a lot. One thing that bothers me is that the default Build Results shows in the bottom part of ST2. My program produces some very long results, and the ideal way to display it (like in TM2) is to see them side by side. How can I do the same thing with ST2 in Mac OS? I've found this article which talks about how this can be done in Linux. But still couldn't figure out how to adapt it to Mac OS. Thanks a lot! 回答1: You can

Kill rosbag gracefully via kill

一曲冷凌霜 提交于 2019-12-10 06:33:11
问题 I'd like to kill a rosbag instance gracefully via terminal. Gracefully means in that case, that the rosbag file doesn't have the suffix .active after kill. so I do the following from terminal to send the recommended SIGINT to rosbag: $ rosbag record /some/topic & $ RPID=$! $ # do some stuff $ kill -2 $RPID Unfortunately, the bag remains active and it can happen that not everything was stored to the disk. However, if I put rosbag into a launch file, it seems to work: $ roslaunch rosbag_record

Could someone please explain this bash command?

假装没事ソ 提交于 2019-12-10 04:26:56
问题 From the website for RVM: bash < <( curl https://rvm.io/releases/rvm-install-head ) What does that first less-than symbol do? What about the <( ? I know this is a stupid question, but I'd love to understand this. 回答1: Bash's process substitution replaces <( ... ) and >( ... ) with pipes from/to children. Hence the whole thing means "create a pipe from curl ... , and use it as stdin to bash". Rather pointless, it would be better written curl -L https://get.rvm.io | bash 回答2: It's called

Emacs/xterm color annoyance on Linux

一笑奈何 提交于 2019-12-10 02:54:30
问题 I'm using emacs in a console window both on my local Linux box and on the login node of a remote cluster. I use emacs regularly, and I've got the foreground color set to white in my .emacs file like so: (set-foreground-color "white") (set-background-color "black") However, when I run emacs, the foreground isn't white; it's grey and very hard to read. On my Mac, emacs in a console window with the same settings shows up as proper white. But on both linux boxes, in konsole and xterm, it's grey.

make GitX open via Terminal for the repo laying at the current path

自古美人都是妖i 提交于 2019-12-10 02:32:05
问题 I usually start gitx via the terminal command $ gitx Normally, when I'm at /path/to/repo as pwd in terminal, gitx was opening that repos log. I don't know if it was an update or if I changed some settings, but since some time, gitx opens blank, when i hit the command. I googled, and couldn't find. How do I get gitx to open the repo of the directory, I'm in at that moment? Thanks! 回答1: Open terminal, navigate to the site directory and type this at the prompt: $ open -a GitX . --- edit --- To

Issues in executing FFmpeg command in Java code in Linux

戏子无情 提交于 2019-12-10 02:14:08
问题 I have problems executing this ffmpeg command in my java code: ffmpeg -i sample.mp4 -i ad.mp4 -filter_complex "[0:v]trim=0:15,setpts=PTS-STARTPTS[v0]; [1:v]trim=0:5,setpts=PTS-STARTPTS[v1]; [0:v]trim=20:30,setpts=PTS-STARTPTS[v2]; [v0][v1][v2]concat=n=3:v=1:a=0[out]" -map "[out]" output.mp4 I used the getRuntime() method below, but that doesn't work for me. Even if I simply remove the " , still it doesn't work. When I simply copy-paste the equivalent string in terminal, it works. String c1="

How do I include --no-pager in a Git alias?

旧城冷巷雨未停 提交于 2019-12-10 01:44:46
问题 I created a Git alias based off of the Git Immersion tutorial by EdgeCase that looks like this: hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short But now it seems to be paging the results — Terminal shows (END) after the results are displayed, forcing me to hit Q to continue working. I read that by adding in the --no-pager tag, you can disable this feature; how do I incorporate it into the alias? I've tried it at the end, before the log , and right after, and none of

Vim Input is not from a terminal [duplicate]

断了今生、忘了曾经 提交于 2019-12-10 01:43:03
问题 This question already has answers here : Why doesn't “history | vim” work? (3 answers) Closed 5 years ago . which django-admin.py | vim Vim: Warning: Input is not from a terminal Vim: Error reading input, exiting... Vim: Finished. What is the easiest way to fix this? And actually make vim to open " /usr/local/bin/django-admin.py " Essentially I want to host an auto-install customized vim on my personal blog: http://wayneye.com/vim, you can see the shell script by navigating to it, it just