Removing strong password policy in Windows 2008

0

You can use gpedit.msc to change the password policy, also you can change the domain policy if you are a member of a domain to change it that way as well.

You can run gpedit.msc by doing the following.

1. click on the start menu, click run, type in gpedit.msc then press Enter.

2. Locate the “Local Computer policy / Computer Configuration / Windows Settings / Security settings / Password Policy

3. Change the keys you wish to change according to your existing password policies in your work place.

source: http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_23612846.html

How to deploy Symfony 2.0 project to production server

0

This instruction was written for Ubuntu 11.04 and 11.10

Installing Capifony

    sudo apt-get install rubygems

    sudo gem install capifony

    sudo gem install capistrano_rsync_with_remote_cache

Time to “capifony” our project. It creates needed files to start using Capifony in this project. To do so just type

    capifony .

Fix for common error with wrong datetime format


sudo perl -p -i -e 's/ 00:00:00.000000000Z//' /var/lib/gems/*/specifications/*.gemspec

Deploy.rb

set :application, "konradpodgorski"
set :domain,      "#{application}.com"
set :deploy_to,   "/var/www/#{domain}"
set :app_path,    "app"

# You might want to change this to other branch e.g. "stable"
set   :branch, "master"

# git url to repository
set :repository,  "[GIT REPOSITORY ADDRESS]"

# useful add on that speeds each deployment
set :deploy_via,    :rsync_with_remote_cache

# Capifony also works with other version control systems but we love git, right?
set :scm,         :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, `subversion` or `none`

set :model_manager, "doctrine"
# Or: `propel`

role :web,        domain                         # Your HTTP server, Apache/etc
role :app,        domain                         # This may be the same as your `Web` server
role :db,         domain, :primary => true       # This is where Rails migrations will run

set  :keep_releases,  3

set  :user, "ec2-user"
set  :use_sudo,      false
set  :git_enable_submodules, 0

set :shared_files,      ["app/config/parameters.ini"]
set :shared_children,   [app_path + "/logs", web_path + "/uploads", "vendor"]

# after first deployment you might want to change this to false. Setting to true will always install vendors each time
set :update_vendors,  true

set :dump_assetic_assets, true

Gitignore for Symfony 2.0 project

2

Every time I start new project there is same problem, adding specific files to gitignore. Here is my standard .gitignore file that I use.

(more…)

symfony-2.0-logo

Timestampable Entity in Symfony 2.0

0

This is another copy & paste ready snippet for rapid application development in Symfony 2.0. This time for well know from Symfony 1.4 Timestampable behavior.

(more…)

symfony-2.0-logo

Snippet for quick single file upload in Symfony 2.0

1

This is universal snippet for models that require single file upload. Simply copy & paste into your model and change method getLogo name so instead using in twig “entity.webPath” you could simply “entity.logo”. Second thing to change is upload DIR.

(more…)

[How to] Installing Nodejs with LESS

3

This is working method for installing Nodejs and LESS.

First we install node.js

UPDATE: 27 Feb 2012
latest version of Nodejs i not compatibilite with LessCSS. If you experience problems like I did use “git checkout v0.6.6″ just before “./configure”

    cd ~
    mkdir nodejs
    cd nodejs
    git clone git://github.com/joyent/node.git
    cd node
    git checkout v0.6.6
    ./configure
    make
    sudo make install

If you get an error about missing OpenSSL, even if you have it already you need to install libssl-dev. Ubuntu users simply type:

    sudo apt-get install libssl-dev

And now time for less, note that npm is installed with nodejs since version 0.6

    cd ~
    npm install -g less

Above command will install less in your home directory.

Editing fstab to get acl working in ubuntu

Ubuntu configuration for Symfony Developer

2

This is complete full instruction how to configure Ubuntu 11.10 / 11.04 fresh after installation to start developing with Symfony 2 Framework.

I haven’t tested it with Ubuntu 10.10 / 10.04 but it should work just fine.

Installation of lamp server

sudo apt-get install lamp-package^

now some required packages

sudo apt-get install php5-sqlite php5-intl

and optional but recommended

sudo apt-get install php-apc php5-xdebug

Required changes to php.ini

Remember to modify both php.ini files, /etc/php5/apache2/php.ini is for apache, second one /etc/php5/cli/php.ini is used for terminal commands

sudo gedit /etc/php5/apache2/php.ini
# /etc/php5/apache2/php.ini
...

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Europe/Warsaw"

...

Repeat this for /etc/php5/cli/php.ini

sudo gedit /etc/php5/cli/php.ini

Apache2 Modules

Now it’s time for apache2 modules, we will need to install mod rewrite

sudo a2enmod install rewrite

Restart Apache2

sudo service apache2 restart

Permissions – ACL

Before we dive into codding one more thing needs to be done.

sudo apt-get install acl

First we need to enable ACL support, to do this edit /etc/fstab file

Now commands mentioned in official book will work

sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs

If you get following warning in terminal, please see this post
[Fix] PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php5/20090626/sqlite.so’

reference

http://symfony.com/doc/current/book/installation.html#configuration-and-setup

How to install PHPUnit on Ubuntu 11.10 and get it to work

0

Installing PHPUnit is not a big deal, but I found that it doesn’t work out of box if you install it from Ubuntu repositories. After apt-get you still need to update it to newer version

sudo apt-get install phpunit
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover components.ez.no
sudo pear channel-discover pear.symfony-project.com
sudo pear upgrade
sudo pear upgrade phpunit/PHPUnit

Installing LAMP on Ubuntu 11.10 / 11.04 / 10.10 / 10.04

2

Abbreviation LAMP stands for Linux Apache Mysql PHP, everything (well.. almost :) ) you need to start developing your awesome PHP web applications :)

To install lamp package simply type into terminal

sudo apt-get install lamp-server^

you might also find useful phpmyadmin

sudo apt-get install phpmyadmin

Yes, that’s all

[How to] generating thumbnails in Symfony 1.4

0

add following method to form class

/* lib/form/doctrine/ExampleForm.class.php */
protected function processUploadedFile($field, $filename = null, $values = null) {

   $fn = parent::processUploadedFile($field, $filename, $values);

    if ($fn != "" && $fn != null && $this->getValue($field) != null) {
      if($this->getValue($field)->getTempName() != null){
        $thumb = new sfThumbnail(400, 300);
        $thumb->loadFile(sfConfig::get('sf_upload_dir') . '/image_directory/' . $fn);
        $thumb->save(sfConfig::get('sf_upload_dir') . '/thumb_directory/' . $fn);
      }
    }

    return $fn;
  }
Go to Top