Sublimetext Package: SideBarEnhancements

20 Apr

This is one of those packages that should be in core. This enhances the default simple sidebar with additional operations.  You can install this via Package Control or from their git repository.

SideBarEnhancements

Sublimetext Plugins: Gitgutter

19 Apr

I am going to write series of posts showing my favorite plugins for Sublimetext editor. Sublimetext is one of the coolest editor around. Today we are going to learn about gitgutter . If you are using git for versioning then you have to have this plugin.  It shows a realtime git diff in your editor.

gitgutter

I was looking for  a plugin like this when i switched from netbeans. Netbeans has this cool plugin named nbgit which i loved most.

I hope this plugin grows more powerful.  BTW you can install this via package control too. More details

CodeIgniter Composer Twig Doctrine

22 Aug

Its not always the power of a framework, its (human) resource that acts as key factor for final selection. On such cases the best option is to add the best things from the new framework and incorporate with the selected one. I really liked symfony2 components and wanted to have that in my CodeIgniter pack also wanted to leverage the power of composer.

After digging and headbanging for few hours; its a SUCCESS. So now my pack relies on composer’s autoload, uses twig template engine and uses doctrine.

Here are my code : ( 99% are of others I just patched those for my need )

Thanks guys for your hard work which saved tons of hours for me. Here are the references:

  1. http://philsturgeon.co.uk/blog/2012/05/composer-with-codeigniter
  2. https://github.com/dilantha/codeigniter-twig
  3. http://www.joelverhagen.com/blog/2011/05/setting-up-codeigniter-2-with-doctrine-2-the-right-way/

I will try to update this code based on issues i face. Do let me know if anything  is missing or needs any modification.

Traffic Shaping using TC

17 Mar

A year ago I configured a local ISP server for my friend. Later I created a PERL script to generate tc commands for Traffic shaping. I wanted to share a step by step guide on how to do that. As usual that didn’t saw the daylight. Today I saw a nice post on tc in here. At last I decided to publish my PERL script. You can get the Script in here :  github.com/neotohin . The script does some very basic things:

  1. add/edit cilent
  2. Remove client
  3. Set bw limit to client
  4. Generate the script file to be run in startup.

This was my first PERL script so if you are a perl guru please share your thoughts.

Back

7 Mar

Nope !  i am not gone. Neither i have stopped coding nor i quit from my dev life. I am working my ass off more than any days from the past (bfr 2010). I have become more systematic(really!), more organized(WTF!) and more creative (Oh yeah!).  Don’t think i am not aware with the progress of CI to CI Reactor .. Starting of Drupal 7 or the new layout of Facebook. Though my current job forces me to stick with Drupal mostly but still my interest for CodeIgniter never withered .

So why this post — a modest warning of my coming back. Get ready for  some new posts — mostly drupal ( drush, git, management etc.) ..   BEST OF LUCK TO ME :)

 

 

 

Debugging CodeIgniter Project using Xdebug and Netbeans

12 Feb

Finding the right way to debug PHP projects has always been a hot topic. Primitive solutions like `echo`, `print_r`,`var_dump` has always been the power tool :) for my type of ppl .  Let us forget those painful nights and go to a quick debugging solution with Xdebug and Netbeans 6.8; in a 1-2-3 step guide for CodeIgniter.

What i am expecting from you:

  • You already have a running web server [ Xampp/WAMP/ Uniform server ]
  • You know how to install Netbeans IDE 6.8 or it’s already running in your environment
  • You know what is CodeIgniter
  • You are not a complete Newbie

# STEP – 1

First add extension Xdebug in PHP. Download latest stable Xdebug version from Xdebug.org. Follow the procedures. If you are lazy like me and don’t want to read the whole thing [it's a bad habit :) ] copy the following settings and put at the end of your php.ini by not forgetting to change the path :)

zend_extension_ts="C:/wamp/bin/php/php5.2.9-1/ext/php_xdebug-2.0.4-5.2.8.dll"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

Note: If anything messes up later; come back and study those links over and over till u understand the whole thing.

# STEP – 2

Configure CodeIgniter to accept ‘?XDEBUG_SESSION_START=netbeans-xdebug’. You can follow one of my post or check in codeigniter forums for accepting GET data in CodeIgniter.

Start Netbeans IDE. Goto Tools >> Options >> PHP >> General: and check for settings in Debugging section. By default the port should be 9000 and Session-ID ‘netbeans-xdebug’.

#STEP -3 [ FINAL :D ]

Let’s say, You have installed a ‘test’ CodeIgniter application in your web server. Now add that application as a project in Netbeans 6.8 . Goto Project properties by right clicking on the project ‘test’.  Now go to ‘Run Configuration’ and click ‘advanced’  select ‘Ask Every time’ in Debug URL.

Now Open your ‘welcome’ controller and press ‘Ctrl+F5′ which will request for the URL:

specify url

insert ‘http://localhost/test/’  and press ‘Ok’.  Next select `Server side PHP`.

Clicking in ‘Debug’ button will open ‘http://localhost/test/?XDEBUG_SESSION_START=netbeans-xdebug‘ In you default web browser.

Now check in status bar for:

And check in toolbar for:

If those 2 shows up then u have successfully installed Xdebug+Netbeans. Your IDE is ready to do some debugging. Take your cursor over a line on index function of welcome.php; press ‘F4′ this will execute php scripts till that cursor. Dont worry if index.php is opened up focusing on first line.

Now You can watch for variables or step into functions or step over. You can check your code line by line.

Read this link which have brief discussion on what options you have for Debugging :) .


My counting on steps could be wrong :) .. bt it looks nice 1-2-3. I tried not to explain a lot; so for more details study provided links.  I hope this will make your life more easier. Enjoy !!

Log – 1: Network Server and B/W Re-seller

26 Dec

Some Background Talk:

It was way back when I first got my hand on linux in 2002. It was a Red-hat. My neighbour Zakir Uncle introduced it to me. He told me at that time, linux holds gr8 features and u can do so many things with it. But all I did was ( cd .. / cd. / mkdir / touch / ).  I removed linux after 1month cause it was boring( what do u expect from a 3month old experienced computer user? ). Later, I experiment with different linux versions ( fedora, mandrake); and did able to make it popular enough that my late cousin (she died in 2008), my little sister and even my aunt used linux. Just to play Shishanshu and Mahjong.

In February, 2009 jhoroTEK configured the network server at Skyinnova (experimental work), where we configured a central server with Fedora Core 10 and squid. Adnan made it a success. [ He was suppose to write an article on it. Hopefully he will put it sooner.] My  friend Harun-ur Rashid who is a B/W  re-seller in our area was using squid as a proxy server and tc for traffic shaping.  No visual admin section and no DHCP.  So I got the perfect opportunity to experiment at his place.

For the Reader:

It’s not a complete tutorial on Configuring a network Server using CENT OS rather an experience sharing.  If you can take the clues and see the rose line u will find the destiny ;) .  My task is still on-going;  if you have better suggestion then drop a comment.

If you want more details or consultancy then contact me.

Follow me on twitter  @neotohin  to see which step i am right now and some tips :) .

Things in my hand:

  1. An 1 mbps B/W from ISP provider
  2. A Core-2-duo Machine ( server ), A Pentium 4 client Machine)
  3. 1 switch,  1 hub
  4. CentOS 5.2

Task :

  1. Share the B/W with clients in sub-network
  2. Traffic Shaping Each client will have different kind of B/W plan like  16KB to 64KB shared.
  3. DHCP Server + MAC binding [ future PPP ]
  4. Proxy Server
  5. FTP, WEB server ( Simple extensions )
  6. More interesting things to come ;)

Let the Journey Begin ====================================

Follow

Get every new post delivered to your Inbox.