Category: general

cardinal rule of setting the .htaccess

my sample url => http://localhost/emp/api/v1/hello.json folder(emp) -> folder(api) -> folder(v1) -> method(hello.json) .htaccess file is placed in the folder V1 # Turn on the rewrite engine Options +FollowSymlinks RewriteEngine on # Request routing RewriteRule ^([a-zA-Z_-]*)\.(html|json|xml)?$ index.php?method=$1&format=$2 [nc,qsa] goto your httpd.conf file in your apache server : # AllowOverride controls what directives may be placed in

Continue Reading →

Configuring code igniter with eclipse

1. Download code igniter. 2. Make two copies. 3. Rename the one of the folders as codebase. 4. Create a new eclipse project with existing files as codebase. 5. Copy the below code : /** * @var CI_Config */ var $config; /** * @var CI_DB_active_record */ var $db; /** * @var CI_Email */ var $email;

Continue Reading →

Command line option to uninstall NoSleep utility

#!/bin/sh COMMON_DEFINED=yes KEXT_ID=com.protech.NoSleepKEXT_PATH=/System/Library/Extensions/NoSleep.kextPERF_PATH=/Library/PreferencePanes/NoSleep.prefPaneHELPER_PATH=/Applications/Utilities/NoSleep.app USER_SUDO_CMD=”” if [ “$SUDO_USER” != “” ]; then USER_SUDO_CMD=”sudo -u $SUDO_USER”else if [ “$USER” != “” ]; then USER_SUDO_CMD=”sudo -u $USER”fifi#!/bin/sh echo “Uninstalling 1.3.1”sudo true if [ “$COMMON_DEFINED” = “” ]; then source `dirname “$0″`/Common.shfi if [ -e “$HELPER_PATH” ]; then echo “Removing NoSleep.app…” ps aux|grep NoSleep.app|awk ‘{print $2}’|xargs kill &> /dev/null

Continue Reading →

Error increase mspdb60.dll version

Execute the following command in WinDbg directory C: Program Files Debugging Tools for Windows (x86)> pdbcopy a.pdb b.pdb-vc6 the Old version of mspdb60.dll loaded the 6.00.8168.0 PDBCopy the requires at least version 6.20.9155.0 or one that implements PDB :: CopyToW2 Solution: install Win2003 SP1 DDK goto x86 directory, you will find the dll. 6.20.9155.0 it

Continue Reading →

Virtual function access – Interesting data

Virtual function access (C++ only) The access for a virtual function is specified when it is declared. The access rules for a virtual function are not affected by the access rules for the function that later overrides the virtual function. In general, the access of the overriding member function is not known. If a virtual

Continue Reading →

SVN Branching

$ svn checkout http://svn.example.com/repos/calc bigwc A bigwc/trunk/ A bigwc/trunk/Makefile A bigwc/trunk/integer.c A bigwc/trunk/button.c A bigwc/branches/ Checked out revision 340. $ cd bigwc $ svn copy trunk branches/my-calc-branch $ svn status A + branches/my-calc-branch $ svn commit -m “Creating a private branch of /calc/trunk.” Adding branches/my-calc-branch Committed revision 341. Easier way to create branch: $ svn

Continue Reading →

BitBucket adding a new project and pushing changes

Global setup: Download and install Git git config –global user.name “Your Name” git config –global user.email {username}@gmail.com Next steps: mkdir projectname cd projectname git init touch README git add README git commit -m ‘first commit’ git remote add origin git@github.com:{username}/{projectname}.git git push origin master

Continue Reading →

use CURL for testing form inputs

Instead of creating a special html form to test inputs, you can use CURL to do it for you through command line. You will be saving time. ex: curl -F “email=test@test.com” -F “password=test” http://127.0.0.1/~folder/mypics/register.php in the above example i have two parameters, email and password. if it was a form, i would have two text

Continue Reading →

Mac OS X – starting mysql server [ service ]

[root@localhost root]# mysql ERROR 2002: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) [root@localhost root]# mysql -h 127.0.0.1 ERROR 2003: Can’t connect to MySQL server on ‘127.0.0.1’ (111) [root@localhost bin]# mysqld Fatal error: Please read “Security” section of the manual to find out how to run mysqld as root! 051215 11:19:00 Aborting 051215

Continue Reading →

Variadic macros/functions

Variadic Macros Variadic functions or functions taking a variable argument list are rather common in C. For example: int printf(const char * fmt,…); C99 also supports variadic macros. A variadic macro looks like this: #define Trace(…) printf( __VA_ARGS__) The ellipsis represents a macro’s variable argument list. The reserved __VA_ARGS__ name is used for traversing the

Continue Reading →

Suppress warnings in virtual box

C:Program FilesOracleVirtualBox>VBoxManage setextradata global GUI/SuppressMe ssages remindAboutAutoCapture,confirmInputCapture,remindAboutMouseIntegrationOn, remindAboutWrongColorDepth This should basically do the trick. Also you can start vboxmanage.exe with the option –type=sdl with no warnings.

Continue Reading →

Pyton:script to search and copy files recursively from directories

import os import glob,shutil os.chdir(“f:\docs\Foldername”) print os.getcwd() destdir = “F:\docs\Foldername” for f in os.listdir(destdir): finalpath=os.path.join(destdir, f) if os.path.isdir(finalpath): os.chdir(finalpath) copypath=”*.wmv” print os.getcwd() os.system (“xcopy /s %s %s” % (copypath, destdir)) ##for mov in glob.glob(finalpath+”\*.wmv”): ##shutil.copy(mov, destdir)

Continue Reading →

Enabling advanced X features (e.g., guest resolution fit, drag and drop, and file and text copy/paste) in linux VMWare virtual machine

You can now run VMware Tools by invoking “/usr/bin/vmware-toolbox-cmd” from the command line or by invoking “/usr/bin/vmware-toolbox” from the command line during an X server session. To enable advanced X features (e.g., guest resolution fit, drag and drop, and file and text copy/paste), you will need to do one (or more) of the following: 1.

Continue Reading →

SVN: cheatsheets

SVN stands for sub version. SVN is a source control tool. This tool is used for tracking and maintaining a repository of your code and each and every minute changes made to it through the use of versions. You can use GUIs to access your SVN like tortoiseSVN and so on. But if you need

Continue Reading →

Database SQL Server, time for defragmentation

Keywords you will need to know: fragmentation/defragmentationThe DB server which I use is Microsoft SQL Server Enterprise EditionSQL commands: select * from sys.dm_db_index_physical_stats(DB_ID(ecommerce_vh10),NULL,NULL,NULL,NULL) The above command will get you all the index values and descriptions in the database. But it shall give you only the object needed for verification of your indexes, but not the

Continue Reading →

Disabling searchindexer.exe on windows

I know how annoying it is. It sucks big time this tool developed by Microsoft which eats up all the memory on my computer. Even though its good to look for mails instantly on outlook, but it keeps increasing its memory usage. You can disable it at startup only by the following registry keys: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesWSearch

Continue Reading →