Reset Joomla 1.5 administrator password

this is the not so smart way to reset joomla 1.5 administrator password !

  1. go to joomla 1.5 root folder.. e.g : C:\xampplite\htdocs\mywebsite
  2. then goto folder \plugins\authentication
  3. edit file joomla.php with your favorite  editor
  4. find this code ..
    if ($crypt == $testcrypt) {
    and change to
    if ($crypt != $testcrypt) {
  5. after that, save the file and login to you joomla administrator with correct username (admin) and wrong password.
  6. then change your password and save.
  7. after that change back
    if ($crypt != $testcrypt) {
    to
    if ($crypt == $testcrypt) {
  8. done. you should now able to login with the password you has changed.

p/s: tested on joomla 1.5.22 only , not sure if it same with other version.

New ! Codeigniter release version 2.0.0

grab from http://codeigniter.com/news/codeigniter_2.0.0_released/

codeigniter

CodeIgniter 2.0.0 Released

Today EllisLab and the CodeIgniter Reactor Engineers are proud to announce the first official release of CodeIgniter 2.0.0, which is being released in two flavors:

CodeIgniter Core

Core is a slow-moving branch that will be used as the base for EllisLab commercial products such as ExpressionEngine and MojoMotor. It will continue at a similar pace that CodeIgniter has in the past and will be useful for large commercial applications that require the upmost in stability and backward/forward compatibility at a pace more typical of SLA backed Enterprise products.  Core is publicly available with tagged downloads at BitBucket.

CodeIgniter Reactor

Reactor is a community driven branch of CodeIgniter that will enable faster adoption of the best community submitted code to the framework. This means the community can create a fork of the project on BitBucket and contribute bug fixes, new features, documentation improvements, etc and have it reviewed by a code-review team called Reactor Engineers. These Engineers are primarily responsible for driving the development of the framework.

Changes and features made by EllisLab to Core will be merged into Reactor, and EllisLab will actively contribute to Reactor’s development.  Reactor is the recommended version of CodeIgniter for use in the majority of day to day work. When you see “CodeIgniter” by itself on this web site, it is referring to CodeIgniter Reactor.  The downloads, documentation, and forums all reflect this change.  Put simply, Reactor = CodeIgniter.

Some of the big changes to happen in CodeIgniter 2.0 since CodeIgniter 1.7.3 are:

  • Support for PHP 4 is gone, PHP 5.1 is now a requirement.
  • CSRF Protection built into the form helper
  • Drivers
  • Application Packages
  • Scaffolding, having been deprecated for a number of versions, has been removed.
  • Removed the deprecated Validation Class.
  • Plugins have been removed, in favor of Helpers.
  • Added routing overrides to the main index.php file, enabling the normal routing to be overridden on a per “index” file basis.
  • Added $route[‘404_override’] to allow 404 pages to be handled by controllers.
  • 50+ bugs fixed

Reactor contains all of these above and some nice changes of its own:

  • Full query-string support
  • Automatic base_url detecion if left blank
  • New Cache driver with file system, APC and memcache support
  • Command line compatibility for easy cron jobs
  • 20+ tweaks and improvements

change log : http://codeigniter.com/user_guide/changelog.html

PHP 4 support is removed. CodeIgniter now requires PHP 5.1.6. .. seem like CI don’t want to lose its’ fans..

…. just after I decide to use Yii to replace CI…. thinking of using CI for small web apps and  Yii for large apps.

Yii framework ..my new “friend” :)

after for almost a year using CodeIgniter (CI) as my primary php framework, now I shift to a new frameworl called Yii. Yii framework has many features compare to CI and it use PHP5… which my primary reason I change to Yii…

yii

.. more article about Yii will be posted here when I finish my learning session .. hehehe..

p/s: use any framework as long as you are comfortable with it…. don’t use it because someone ask you to use it.

Git ? my new tools

What Git is, why you would want to use it and where to get it and learn about it.

 

Git is a fast, open source, distributed version control system that is quickly replacing subversion in open source and corporate programming communities.

 

version control system

First off, Git is a version control system, a simple command line tool for keeping a history on the state of your source code projects. You use it as you might use something like Subversion, CVS or Perforce.

You tell it to track files in your project and periodically commit the state of the project when you want a saved point. Then you can share that history with other developers for collaboration, merge between their work and yours, and compare or revert to previous versions of the project or individual files.

As it is primarily a command line tool, most of the examples in this course will show the command line versions of the functions. We will be using a recent version of Git (the 1.7 series) for the examples in this course. We recommend upgrading to the 1.7 series if your version of Git is older – there have been a number of UI improvements that make Git a bit easier to use.

$ git --version
git version 1.7.1

If you need help with any of the commands, you can type ’–help’ and it will show you the man page. You can also type ‘git helpcommand’ for the same thing.

$ git log --help
$ git help log

open source

Git is an open source project, that has been active for several years and is written mostly in C.

Git Language Breakdown

At any time you can get the full source code to analyze or improve upon. To get a download of the source code, visit git-scm.com/download. Git is licensed under the GNU General Public License.

offline and fast

Git is fully distributed, which means that it can work almost entirely offline. In stark contrast to VCS tools like Perforce or Subversion, Git does nearly all of it’s operations without needing a network connection, including history viewing, difference viewing and commiting.

This also means that Git is very fast compared to those systems partially due to the fact that none of these operations has any dependency on network latency. For example, take a look at how fast the simple ‘log’ command takes to run in Git and in Subversion.

[master]$ time git log > /dev/null

real	0m0.352s
user	0m0.300s
sys	0m0.034s

$ time svn log > /dev/null

real	0m3.709s
user	0m0.482s
sys	0m0.168s

Git at 0.3 seconds vs Subversion at 3.7 seconds. That is a difference of a full order of magnatude. You’ll find similar differences with nearly any command comparison. For example, adding the popular famfamfam icon set and committing them. Since you can seperate the commit from the network ‘push’ in Git, this action takes a quarter of a second in Git, but 45 seconds in Subversion.

time 'git add icons; git commit -m "added icons"'

real	0m0.273s
user	0m0.032s
sys	0m0.008s

time 'svn add icons; svn commit -m "added icons"'

real 	0m45.276s
user	0m15.997s
sys	0m5.503s

Even if you needed to push to a shared repository at that time as well, it still takes far, far less time than Subversion.

time git push

real	0m6.219s
user	0m0.023s
sys	0m0.011s

If you just want to commit and keep working, you’re looking at a huge time difference – one that severely changes your workflow. Most commands in Git seem instantaneous – no more typing ‘svn commit’ and then going for a cup of coffee.

small (vs svn)

Git is also very space efficient. For example, if you import the Django project from SVN into Git and compare their checkout/clone sizes, Git comes out very favorably.

$ du -d 1 -h
 44M	./django-git
 53M	./django-svn

Interestingly, it is even smaller than the Subversion checkout, which is pretty amazing, considering that the Git clone contains the entire history of the project – every version of every file back to the first commit, whereas the Subversion checkout is just the last version of the project.

snapshots, not changesets

Unlike most other VCSs, Git is snapshot based. That is, instead of thinking about and storing commit points as file based patches or changes, it stores it as a simple snapshot of what your project looked like when you committed.

Commits, then, are simply objects that contain some metadata about the commit (the message, author, date, etc), a pointer to a single snapshot of the project and pointers to the commit(s) that came directly before it. Git’s commit history and data model is really just a directed graph – a simple series of snapshots.

Git Data Model

Keeping this in mind is helpful when you’re thinking about what Git will do in a given situation.

For a more in-depth examination of how Git stores data, checkout Git for Computer Scientists.

cheap branching and easy merging

Probably the most compelling feature of Git, since it often fundamentally changes the way that many developers work, is Gits branching model. Instead of the popular VCS branching method of simply cloning into a seperate directory for a branch, Git lets you switch between branches in a single working directory. Add to that the fact that creating and switching between branches is nearly instant, not all of your branches need to be shared, and it’s easy to stash partially completed work – means that the way you work can be incredibly different.

Instead of only having branches for major development line departures, Git developers routinely create, merge and destroy multiple branches a week, or even per day. Often each feature or bug you are working on can have its own branch, merged in only when it is complete. This model allows you to experiment quickly, easily and safely – without having to go through hoops to get back to where you where. It enables and encourages a non-linear development cycle, where you can work on multiple lines of thought in parallel without them stepping on each other.

Many developers feel that this is so incredibly helpful and has changed their workflow and productivity so much that they dub it the“killer feature” of Git.

 

this article are not written by me and it’s not copyrighted for me.
please refer to reference to know more about the real author.
–reference : http://learn.github.com/p/intro.html

20 Unchangeable Rules in ANY OFFICE

20 Rules in any office

1. The Boss is always right.

2. If the Boss is wrong, see rule 1.

3. Those who work get more work. Others get pay, perks, and promotions.

4. Ph.D. stands for “Pull Him Down”. The more intelligent a person, the more hardworking a person, the more committed a person; the more number of persons are engaged in pulling that person down.

5. If you are good, you will get all the work. If you are really good, you will get out of it.

6.. When the Bosses talk about improving productivity, they are never talking about themselves.

7. It doesn’t matter what you do, it only matters what you say you’ve done and what you are going to do.

8. A pat on the back is only a few centimeters from a kick in the butt.

9. Don’t be irreplaceable. If you can’t be replaced, you can’t be promoted.

10. The more crap you put up with, the more crap you are going to get.

11. If at first you don’t succeed, try again. Then quit. No use being a damn fool about it…

12. When you don’t know what to do, walk fast and look worried.

13.. Following the rules will not get the job done.

14. If it weren’t for the last minute, nothing would get done.

15. Everything can be filed under “Miscellaneous” .

16. No matter how much you do, you never do enough.

17. You can do any amount of work provided it isn’t the work you are supposed to be doing.

18. In order to get a promotion, you need not necessarily know your job.

19. In order to get a promotion, you only need to pretend that you know your job.

20. The last person that quit or was fired will be held responsible for everything that goes wrong.

 

reference : somewhere on the internet… a blog..

simple sql insert function in php

php function :
<?php
function insertSQL($post, $exvar, $table)
{
$x=0;
$fld=array();
$vlu=array();
foreach($post as $key=>$val){
if( !in_array($key, $exvar) ){
$fld[$x]=$key;
$vlu[$x]=”‘”.$val.”‘”;
++$x;
}
}
$sql = “insert into $table (“.implode(“,”,$fld).”) values (“.implode(“,”,$vlu).”)”;
return $sql;
}
if($submit) {
$ex = array(‘submit’=>’submit’,'reset’=>’reset’);
echo insertSQL($data,$ex, ‘tableUser’);
}
?>

html :

<form method=”post”>

<input type=”text” name=”name”>

<input type=”text” name=”middlename”>

<input type=”submit” name=”submit” value=”submit”>

</form>

p/s: no input validation… html form, the name of the input must be the same with the name of the column/field in tables.

Configure samba on linux ubuntu

Configure SAMBA on linux ubuntu
(tested on ubuntu 8.04)

1.0 check your samba (do this in root account)
1.1-if this happen, it’s mean you already have samba server installed.
usm-desktop usm # /etc/init.d/samba restart
* Stopping Samba daemons                                                [ OK ]
* Starting Samba daemons                                                  [ OK ]

-skip steps below, go to step no 2.

1.2-if this happen, mean you need to install samba server first
/etc/init.d/samba restart
bash: /etc/init.d/sambax: No such file or directory

go to next step

1.3-install samba : #apt-get install samba

2.0 configuring your samba. In this example, I will make 2 user account and 1 folder for them to access it.
2.1-create folder in /home/
usm-desktop home # mkdir /home/kongsi
then set permission
usm-desktop samba # chmod o+rwx /home/kongsi/

2.2-create account (repeat this steps for any user)
usm-desktop usm # adduser devel2
Adding user `devel2′ …
Adding new group `devel2′ (1004) …
Adding new user `devel2′ (1006) with group `devel2′ …
Creating home directory `/home/devel2′ …
Copying files from `/etc/skel’ …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for devel2
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y

2.3-add existing user to samba service

usm-desktop samba # smbpasswd -a devel2
and enter the same password you have entered before (step 2.2)
repeat the same step for any existing user.

2.4-config samba configuration file.

usm-desktop samba # nano /etc/samba/smb.conf
add this config text at the end of file :

[kongsi]
comment = folder untuk kongsi ramei2
read only = false
guest ok = no
public = no
writeable = yes
path = /home/kongsi
browseable = yes
directory mask = 777
create mask = 777
valid user = devel,devel2

save the file: ctrl+o, ctrl+x
restart the service
usm-desktop samba # /etc/init.d/samba restart

::::finish::::
access it from your windows computer
\\10.206.3.2\kongsi

enter the username & password