Posts

mongodb mongod command line args

smorin$ ./mongod --dbpath ../../mongodata/ --help Allowed options: General options:   -h [ --help ]          show this usage information   --version              show version information   -f [ --config ] arg    configuration file specifying additional options   -v [ --verbose ]       be more verbose (include multiple times for more                          verbosity e.g. -vvvvv)   --quiet                quieter output   --port arg             specify port number   --bind_ip arg          comma separated list of ip addresses to listen on -                          all local ips by default   --logpath arg        ...

mongodb mongo command line args

smorin$ ./bin/mongo --help MongoDB shell version: 1.8.1 usage: ./bin/mongo [options] [db address] [file names (ending in .js)] db address can be:   foo                   foo database on local machine   192.169.0.5/foo       foo database on 192.168.0.5 machine   192.169.0.5:9999/foo  foo database on 192.168.0.5 machine on port 9999 options:   --shell               run the shell after executing files   --nodb                don't connect to mongod on startup - no 'db address'                         arg expected   --quiet               be less chatty   --port arg            port to connect to   --host arg            server to connect to   --...

redis redis-cli command line options

There isn't official documentation for the command line arguments as of redis-cli.  If you type --help for the command line arguments you get the following smorin$ ./redis-2.2.4//src/redis-cli --help redis-cli 2.2.4 Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]   -h    Server hostname (default: 127.0.0.1)   -p        Server port (default: 6379)   -s      Server socket (overrides hostname and port)   -a    Password to use when connecting to the server   -r      Execute specified command N times   -n          Database number   -x               Read last argument from STDIN   -d   Multi-bulk delimiter in for raw formatting (default: \n)   --raw            Use raw formatting for replies (default when STDOUT is not a tty)   --help     ...

redis redis-server command line options

There is only one argument for redis-server.  It's the path to the redis.conf file.  There is a example of this file in the redis src base.  There isn't a official documentation page as of 6/2011 $redis-server /path/to/redis/config/redis.conf

sbcl access command line arguments

$ sbcl --eval '(progn (print *posix-argv*)(quit))' two three

git delete remote branch

This is a simple example where the branch has the same name locally and remotely To create a remote branch git push origin newbranchname To delete a remote branch git push origin :newbranchname

Bash script locate base dir

BASEDIR=$(cd $(dirname $0); cd ../ ;  pwd -P)

Bash script locate self

SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)

emacs emulating vi open line below

Quoted from Stackoverflow - Original Link Below ( love this post, these three are my biggest emacs annoyences) Hi there, I am currently playing around with emacs and happy with most of the concepts. But I really adored the convenience of the three vim commands: dd,o,O Hopefully you can tell me how to mirror them in emacs :) dd  - deletes whole line, including newline, no matter where the cursor is. I found something similar to do the trick: C-a C-k C-k While  C-a  moves the cursor to the beginning of the line, the first  C-k  kills the text, the second one kills the newline. The only problem is that this is not working on empty lines where I only need to type C-k  which is quite inconvenient as I have to use different commands for the same task: killing a line. o / O  - creates a new empty line below / above cursor and moves cursor to the new line, indented correctly Well,  C-a C-o  is nearly like  O , just the idention is missing....

multi line string in bash

Multiline strings can be assigned in bash using one of these two examples. $ String='foo1 foo2 foobar2' STRING=$( cat <<EOF foo1 foo2 foobar2 EOF )

How to change your password in oracle

once you are logged in to sql developer as your userid, just say "alter user {username} identified by {newpassword}"

pinboard.in with tag javascript for iPad browser Safari

Here is the javascript to add pinboard.in to safari in the iPad javascript:q=location.href;if(document.getSelection){d=document.getSelection();}else{d='';};p=document.title;void(open('http://pinboard.in/add?showtags=yes&url='+encodeURIComponent(q)+'&description='+encodeURIComponent(d)+'&title='+encodeURIComponent(p),'Pinboard',%20'toolbar=no,width=700,height=600'));

emacs goto line

Just type  'M-g-g' aka ESC+g g

Textmate Bundle Command - Convert Backslash to Comma in Document / Selection

Textmate Bundle Command - Convert Backslash to Comma in Document / Selection perl -pe 's/\\/,/g' #Set Save "Nothing" #Set Input "Selected Text" or "Document" # and #Set Output "Replace Selected Text"

Textmate Bundle Command - Convert Comma to Backslash in Document / Selection

Textmate Bundle Command - Convert Comma to Backslash in Document / Selection perl -pe 's/[,]/\\/g' #Set Save "Nothing" #Set Input "Selected Text" or "Document" # and #Set Output "Replace Selected Text"

Textmate Bundle Command - Transpose Comma Seperated Lines to Tab Separated

Textmate Bundle Command - Transpose Comma Seperated Lines to Tab Separated #!/usr/bin/env ruby -wKU aa = Array.new STDIN.readlines.each {|e| aa.push(e.split(","))} aa = aa.transpose aa.each { |e| ; e.collect!{|f| f.strip } ; puts e.join("\t") } #Input Selected Text #Output Replace Selected Text #Key Equivalent

Textmate Bundle Command - Remove Tabs

Textmate Bundle Command - Remove Tabs perl -pe 's/[\t]/ /g' #Set Save "Nothing" #Set Input "Selected Text" or "Document" # and #Set Output "Replace Selected Text"

Display hidden and control character in Vi / Vim

Turn on using  :set list Turn off using :set nolist

Oct Dec Hex Control Character Values

Oct Dec Hex Control Character Values Oct Dec Hex Name 000 0 0x00 NUL 001 1 0x01 SOH, Control-A 002 2 0x02 STX, Control-B 003 3 0x03 ETX, Control-C 004 4 0x04 EOT, Control-D 005 5 0x05 ENQ, Control-E 006 6 0x06 ACK, Control-F 007 7 0x07 BEL, Control-G 010 8 0x08 BS, backspace, Control-H 011 9 0x09 HT, tab, Control-I 012 10 0x0a LF, line feed, newline, Control-J 013 11 0x0b VT, Control-K 014 12 0x0c FF, form feed, NP, Control-L 015 13 0x0d CR, carriage return, Control-M 016 14 0x0e SO, Control-N 017 15 0x0f SI, Control-O 020 16 0x10 DLE, Control-P 021 17 0x11 DC1, XON, Control-Q 022 18 0x12 DC2, Control-R 023 19 0x13 DC3, XOFF, Control-S 024 20 0x14 DC4, Control-T 025 21 0x15 NAK, Control-U 026 22 0x16 SYN, Control-V 027 23 0x17 ETB, Control-W 030 24 0x18 CAN, Control-X 031 25 0x19 EM, Control-Y 032 26 0x1a SUB, Control-Z http://www.asciitable.com

How to edit hex values in Vi

Image
Editing binary files   Edit Use the  -b  option to set binary mode before editing a binary file, for example: vim -b myfile.bin If wanted, you can display nonprintable characters in hex, and you can wrap lines: :setlocal display=uhex :setlocal wrap In normal mode, type  g  then Ctrl-G to display the byte number at the cursor, or type a byte number then  go  to jump to that byte (for example,  123go  will jump to byte number 123). The first byte in the file has byte number 1. The following command replaces the buffer with a hex dump: :%!xxd You can edit the hex bytes, then convert the file back to binary with the command: :%!xxd -r The above command reverses the hex dump by converting the hex bytes to binary (the printable text in the right column is ignored). http://vim.wikia.com/wiki/Hex_dump