About myapit

i love anime very very very much ^_^ i love eating :-) i like video games & computing just wanna be friend with everyone....

linux sftp to user own home folder only

Edit /etc/ssh/sshd_config

add/change those line

# add -u 0000 for rwxwrxrwx on files/directories creation. (not secure)
Subsystem sftp internal-sftp -u 0000

# no more delay on password
UseDNS no

Match group filetransfer
ChrootDirectory /home/%u
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

save and exit and reload sshd.

#adduser kambing
#usermod -a -G kambingGroup kambing
#usermod -a -G filetransfer kambing
#cd /home
#chown root:root kambing
#cd kambing
#chown kambing:kambing public_html/

– to share directory where kambingGroupShareDir located outside current user’s home directory.

#mount –bind /home/kambingGroup/public_html kambingGroupShareDir

before that, make sure the ssh server setup using this configuration:

add/edit line in /etc/ssh/sshd_config

Subsystem sftp internal-sftp -u 0000 -f AUTH -l INFO

UseDNS no

Match group filetransfer
ChrootDirectory /home/%u
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

Mysql grant all privileges to User own stuff only

mysql> create user ‘kambing’@'localhost’ identified by ‘gilo’;

mysql>grant all privileges on `kambing_%’.* to ‘kambing’@'localhost;

mysql>flush privileges;

now login using kambing and create database with prefix kambing_

using this technique, user kambing only allowed to create database with preifx kambing_ and only can access kambing_* databases;

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..