Posts

Yet another NodeJS chat prototype

Image
Technologies used : Nodejs Socket.IO Express Framework for Node MongoDb Disclaimer : The code / concept here is pretty novice, good for people just starting with nodejs but needs a  lot of refinement. Installation  : You can download nodejs installer according to your OS from nodejs.org or use your OS repositories for a copy of nodejs supported by your OS. The rest of your packages viz socket.io and express are stored in the nodejs repositories and can installed using the following commands: > npm install socket.io  > npm install express MongoDb can be downloaded from the mongodb.org website and you just have to run mongod daemon to ensure the database service is running. The code for the chat server is available  HERE . Set the mongodb host and port settings on db_ops.js and on the parent folder run: > node server.js You would see something like the following image on the server log: Open up browsers, connect to the server ...

Python-C-Extension

Skeletal code to create exposed C, C++ Extensions for Python Just wrote some generic handy code which I thought I'd upload. Performance boost of using C, C++ extensions in some operations is quite significant and proven. Use this code to add pre-written C, C++ code and build it in a way that it's functions are exposed as python packages. The code has been hosted on github HERE . Build to a shared object to access the c library as a python package. usage: > import helloworld >helloworld.printhelloworld() Θ Ω Sushant ♂

NPM / NODEJS installation issues [RESOLVED]

Yesterday I decided to give node.js and socket.io a shot and make something good out of it. The first thing that we do is install stuff right.. So I thought I'd go the easy way, wget all the installable packages from nodejs.org for the mac and I was hoping things would be stable. But 'not' to my surprise (as this keeps on happening), when I started out using npm (the package manager or let's just say the easy_install python alias) that comes with the latest installer started giving me issues like the following whenever I typed npm install socket.io or even npm -v(to check the version) for that matter - node.js:201         throw e; // process.nextTick error, or 'error' event on first tick               ^ Error: No such module     at Object. (/usr/lib/node_modules/npm/lib/utils/config-defs.js:5:21)     at Module._compile (module.js:441:26)     at Object..js (module.js:459:10) ...

Just launched two new business web portals

Just created two new business websites : Synergy Real Estate Services An initial initiative for the firm Sukh Promoters Pvt Ltd, for Real Estate Consulting Joy Guest House, Goa Did most of the photography for this shack and guest house in Goa and built this website for them. Pretty much financed my trip last weekend. Θ Ω Sushant ♂

C++ Guru Mantra

Whenever in pain while compiling through g++ blindly use the following: 1. -undefined dynamic_lookup : every other library not found, x86_64 errors are fixed. 2. locate your paths for shared libraries and use -L or -I to point to this location. 3. Read about shared and static libraries here [Edit] Dynamic lookup findings: You have to run the output in and around the files that have to be used as it looks up dynamically for it's dependencies and symbols. Θ Ω Sushant ♂

ClamAV - One of the 'good' open source command line antivirus solution

This really makes my life easy if I want to deploy an upload server, or a mail server in UNIX and the files would be downloaded in WINDOWS or similar virus-prone operating systems. You can read more about it on the official website . A C-extension for python is available HERE to programmatically scan files and open pyclamd (daemon) socket. Θ Ω Sushant ♂

Git observation

Just incase you have cloned your repository using passwords and have setup the ssh keys with the remote server later, you would be facing issues with asking for passwords again and again even though the key mappings exists on the server. Your best bet is to push everything and re-clone the repository and voila! no passwords now. Θ Ω Sushant ♂