MySQL: Recover root password

        # mysql -u root Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)   # mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)     1 Stop MySQL server: # service mysql start… Continue reading

Intranet: setup DJBDNS to respond for *.local to help development

  0. Follow instructions to setup a DNS Cache   1. Create an alias for eth0: # nano /etc/network/interfaces auto eth0:0 iface eth0:0 inet static address 10.0.0.251 netmask 255.255.255.0 network 10.0.0.0 broadcast 10.0.0.255 gateway 10.0.0.254 2 . restart networking # /etc/init.d/networking restart   3. Use tinydns-conf to setup djbdns  #… Continue reading

Intranet: Setup a DNSCACHE for your network using DJBDNS

On this tutorial you will learn how to using DJBDNS to setup a DNS cache to help speed up queries for your local network.   I like using Debian, so that is the distribution I'll be using for most of my tutorials. Current version as of this, is Squeeze.  … Continue reading

Git: Prepare your repository – step 1

  Here I’ll explain how you can create a new repository for your projects and use GIT for your version control needs.     For this, I’ll assume everything is already installed (git and stuff). This also assumes you’re using an Operating System and not the Vermont thing.   Replace… Continue reading

PHP Killer: Do not do this on your code

Unless you want/need to kill some time… do not do the following on your PHP code, or you will be banging your head against the wall:   1. Use trim() inside empty():   sample: if (!empty(trim($item))) { }   work around: $item = trim($item); if (!empty($item)) { }    … Continue reading

Kohana 3.2.6: Change Default Route

Let’s define a redirect module that will handle all requests that were not handled by any other controller. It will also be a good place to include a 404 page. modules/application/bootstrap.php Kohana::modules(array( . . ‘redirect’ => MODPATH . ‘redirect’, //Redirect module . . )); Route::set(‘default’, ‘(<request>)’, array( ‘request’ => ‘(.*)’,… Continue reading

Code:: css-message-box

I just started a Google Code hosted project since I’m always in need of pretty message boxes for my HTML things. Let me know if you want/can contribute to it. It’s currently licensed under GPL 2.0 Here’s the address: http://code.google.com/p/css-message-box/   Why: This seems to have been dead for a… Continue reading

Installing DropBox on Slackware 13.1 64-bit

Before you start, let's make sure you have gnome docutils installed: Get the package: http://www.linuxfromscratch.org/blfs/view/cvs/gnome/gnome-doc-utils.html Install GNOME Doc Utils (this part is borrowed from LinuxFromScratch book) ./configure –prefix=$(pkg-config –variable=prefix ORBit-2.0) –mandir=$(pkg-config –variable=prefix ORBit-2.0)/share/man make Test it make check and then install as root: make install switch to Dropbox installation folder… Continue reading

Kohana 3: Default Template [step 3]

Create the view for the default template: /modules/common/views/template/default/default.php   <!DOCTYPE html> <head> <title>Default template</title> </head> <body> <?php echo $content; ?> </body> </html>      

Kohana 3.1.x: Common controller [step 2]

Define parent controller:     <?php defined(‘SYSPATH’) or die(‘No direct script access.’); class Controller_Common_Content extends Controller_Template { public $template                = ”; public $template_name           = ‘default’; public $layout                  = ‘default’; public $save_auto_render        = null; public $content                 = ‘{Do something to generate content}’; public function __construct(Request $request, Response $response) { parent::__construct($request, $response);… Continue reading