Building a Single Page Application with AngularJS and Neo4J – Setup

a thousand lines of code

This is a cross-post from the digitalian

Setting up the environment

In this section I will list all the steps that I had to go through to get my Mac ready for coding with the stack I picked. Hopefully this will be a useful timesaver for anyone who decided to do the same. If you found this page first, you won’t have to do any research. Just follow my footsteps and within minutes (not including the hefty download of Apple’s Xcode) you will be up and running, ready for action 🙂

Setting up Localhost

I still use OS X 10.7 (Lion), therefore this might not be applicable to your environment if you are using a newer version of OS X. First, I deleted the ~/Sites folder inside my personal folder, then I created a linked folder with the same name pointing to the /Library/WebServer/Documents folder using the following command from…

View original post 1,452 more words

Recent Works [PHP Redis] Migrating SQL SERVER 2008 to Redis

Redis logo

I really interested in this project, I bet You know how much cost of sql server, and it can be migrate to redis (thanks antirez). I really don’t know if my way is accepted by the creator itself or by community, but in my opinion, it really solve all my problem.
Continue Reading

Redis [Snippet] Redis 32bit compiling problem on ubuntu 13.04

Redis logo

root@ubuntu-1303-amd64:/home/adminuser/redis-2.6.7# make 32bit
cd src && make 32bit
make[1]: Entering directory `/home/adminuser/redis-2.6.7/src’

WARNING: if it fails under Linux you probably need to install libc6-dev-i386

make CFLAGS=”-m32″ LDFLAGS=”-m32″
make[2]: Entering directory `/home/adminuser/redis-2.6.7/src’
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-dump redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
make[3]: Entering directory `/home/adminuser/redis-2.6.7/deps’
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[3]: Leaving directory `/home/adminuser/redis-2.6.7/deps’
(rm -f .make-*)
echo STD=-std=c99 -pedantic >> .make-settings
echo WARN=-Wall >> .make-settings
echo OPT=-O2 >> .make-settings
echo MALLOC=jemalloc >> .make-settings
echo CFLAGS=-m32 >> .make-settings
echo LDFLAGS=-m32 >> .make-settings
echo REDIS_CFLAGS= >> .make-settings
echo REDIS_LDFLAGS= >> .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -Wall -O2 -g -rdynamic -ggdb -m32 -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE_JEMALLOC -I../deps/jemalloc/include >> .make-settings
echo PREV_FINAL_LDFLAGS=-m32 -g -rdynamic -ggdb >> .make-settings
(cd ../deps && make hiredis linenoise lua jemalloc)
make[3]: Entering directory `/home/adminuser/redis-2.6.7/deps’
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo “-m32” > .make-ldflags)
(echo “-m32” > .make-cflags)
MAKE hiredis
cd hiredis && make static
make[4]: Entering directory `/home/adminuser/redis-2.6.7/deps/hiredis’
cc -std=c99 -pedantic -c -O3 -fPIC -m32 -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
net.c:34:23: fatal error: sys/types.h: No such file or directory
compilation terminated.
make[4]: *** [net.o] Error 1
make[4]: Leaving directory `/home/adminuser/redis-2.6.7/deps/hiredis’
make[3]: *** [hiredis] Error 2
make[3]: Leaving directory `/home/adminuser/redis-2.6.7/deps’
make[2]: [persist-settings] Error 2 (ignored)
CC adlist.o
In file included from /usr/include/features.h:341:0,
from /usr/include/stdlib.h:24,
from adlist.c:32:
/usr/include/stdc-predef.h:30:26: fatal error: bits/predefs.h: No such file or directory
compilation terminated.
make[2]: *** [adlist.o] Error 1
make[2]: Leaving directory `/home/adminuser/redis-2.6.7/src’
make[1]: *** [32bit] Error 2
make[1]: Leaving directory `/home/adminuser/redis-2.6.7/src’
make: *** [32bit] Error 2
root@ubuntu-1303-amd64:/home/adminuser/redis-2.6.7# make
cd src && make all
make[1]: Entering directory `/home/adminuser/redis-2.6.7/src’
CC adlist.o
In file included from /usr/include/features.h:341:0,
from /usr/include/stdlib.h:24,
from adlist.c:32:
/usr/include/stdc-predef.h:30:26: fatal error: bits/predefs.h: No such file or directory
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/home/adminuser/redis-2.6.7/src’
make: *** [all] Error 2

If got error like me, just type this command, apt-get install libc6-dev-i386 . And now redis ready to use.

Redis Persistence

Brijesh Mishra

Redis provides a different range of persistence options:

  • The RDB persistence performs point-in-time snapshots of your dataset at specified intervals.
  • the AOF persistence logs every write operation received by the server, that will be played again at server startup, reconstructing the original dataset. Commands are logged using the same format as the Redis protocol itself, in an append-only fashion. Redis is able to rewrite the log on background when it gets too big.
  • If you wish, you can disable persistence at all, if you want your data to just exist as long as the server is running.
  • It is possible to combine both AOF and RDB in the same instance. Notice that, in this case, when Redis restarts the AOF file will be used to reconstruct the original dataset since it is guaranteed to be the most complete.

The most important thing to understand is the different trade-offs between the…

View original post 2,681 more words