Showing posts from 2011

erlang module load path how to ERL_LIBS

erl -env ERL_LIBS "/my/path/to/module"
export ERL_LIBS=/my/path/to/module
erl -pa /my/path/to/module

erlc -o /dir/to/save/compiled/file mymodule.erl

NOTE:Modules must reside in a file with the same name as the file.

NOTE:the lib path will not load if it doesn't contain a ebin dir

$ export ERL_LIBS=/Users/joe/mymodule; erl

You can test to see if the path loaded with

Bash has a Vi mode

Must be a very well kept secret "BASH HAS A VI MODE".

set -o vi
set -o emacs

How I have never come across this before is beyond me

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          log file to send write to instead of stdout - has to
                         be a file, not directory
  --logappend            append to logpath instead of over-writing
  --pidfilepath arg      full path to pidfile (if not set, no pidfile is
  --keyFile arg          private key for cluster authentication (only for

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       foo database on machine  foo database on machine on port 9999
  --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
  --eval arg            evaluate javascript
  -u [ --username ] arg username for authentication
  -p [ --password ] arg password for authentication
  -h [ --help ]         show this usage information
  --version             show version information
  --verbose             increase verbosity
  --ipv6                enable IPv6 support (disable…

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:
  -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           Output this help and exit
  --version        Output version and exit

  cat /etc/passwd | redis-cli -x set mypasswd
  redis-cli get mypasswd
  redis-cli -r 100 lpush mylist x

When no command is given, redis-cli starts in interacti…

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 typeC-k which is quite inconvenient as I have to use different commands for the same task: killing a line.

multi line string in bash

Multiline strings can be assigned in bash using one of these two examples.

$ String='foo1

STRING=$( cat <<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}"