This user hasn't shared any profile information

Posts by shenyi

Streaming your screen with vlc and wowza

1. vlc  streaming your screen command :

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -vvv screen:// :screen-fps=24 --sout="#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:udp{dst=}" --sout-keep : your wowza server IP

1234 :  port

Or rediffuser

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -vvv "C:\ebooks\Symfony2\\Symfony_2.3_Beginners_Tutorial_-_Part 5_-_Doctrine_ORMs_and_your_Database_(1080p).mp4" --sout "#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:udp{dst=}"

2. wowza server configuration

add a stream name :
and with this stream URI :  udp://


3. flow player

<script src=""></script>

<script type="text/javascript">

$( document ).ready(function() {
$f("wowza", "", {
clip: {
url: '',
live: true,
// configure clip to use influxis as our provider, it uses our rtmp plugin
provider: 'influxis'

// streaming plugins are configured under the plugins node
plugins: {

// here is our rtpm plugin configuration
influxis: {
url: "flowplayer.rtmp-3.2.13.swf",

// netConnectionUrl defines where the streams are found
netConnectionUrl: 'rtmp://'
canvas: {
backgroundGradient: 'none'

Build Virtual Machines With PuPHPet

1. install Virtual Box 4.3 and Vagrant 1.3


3. guest VM : Ubuntu Precise 12.04 – Virtualbox 4.3 – php 5.5

4. Local VM IP Address :

5. Box Sync Folder Source : c:/sandbox

6. Shared Folder Type : Default

7. voir : for the rest

8. download puphpet zip

9. do to the download directory

10. vagrant up

11. convert the %HOMEPATH%\.vagrant.d\insecure_private_key to .ppk using PuTTYGen

12. use the .ppk key in your PuTTY session – configured in Connection > SSH > Auth > Private key file

13. use port 2222 instead of 22

14. ssh port 2222

15 login : vagrant

16 sudo netstat -tlnp

17. go to  and

First iphone app with cordova 3.4 in 2 minutes

npm install -g cordova

mkdir MyApp | cd MyApp

cordova platform add iso

cordova build

cordova serve iso


Ctrl + C

cordova prepare iso

cordova compile ios

cordova emulate iphone


install svn in sandbox

sudo apt-get update

sudo apt-get install subversion

sudo mkdir /var/svn

sudo mkdir /var/svn/monprojet

sudo svnadmin create /var/svn/monprojet

sudo chown -R www-data /var/svn/monprojet

sudo svnserve -d

sudo addgroup svn –system

sudo adduser svn –system –home /var/svn –no-create-home –ingroup svn

sudo chown -R www-data:svn /var/svn/monprojet

sudo chmod -R g+rws monproje

sudo apt-get install libapache2-svn libapache2-mod-python

sudo a2enmod dav_svn

sudo apt-get install libapache2-mod-svn

sudo nano /etc/apache2/mods-available/dav_svn.conf


<Location /svn>

DAV svn
SVNParentPath /var/svn
SVNListParentPath On
AuthType Basic
AuthName « Subversion Repository »
AuthUserFile /etc/subversion/passwd
Require valid-user


sudo /etc/init.d/apache2 restart

sudo htpasswd -c /etc/subversion/passwd susername


svn co monprojet --username username

svn add

svn commit


Rest with symfony 2 – note

# php composer.phar create-project symfony/framework-standard-edtion rest 2.2.0

# cd rest

# php ../composer.phar update

we need these two bundles
# php ../composer.phar require jms/serializer-bundle @stable

# php ../composer.phar require friendsofsymfony/rest-bundle @stable

# php app/console –version
Symfony version 2.2.11

create a bundle
# php app/console generate:bundle

# in app/AppKernel.php add these bundles

 new JMS\SerializerBundle\JMSSerializerBundle(),
 new FOS\RestBundle\FOSRestBundle(),

Create a user entity
#php app/console doctrine:generate:entity

add some configuration
# app/config/config.yml

view: { annotations: false }
router: { annotations: true }

prefer_extension: false
view_response_listener: true

# app/config/routing.yml
type: rest
resource: Screenfony\DemoBundle\Conroller\UsersController

# add UsersController.php

namespace Screenfony\DemoBundle\Controller;

use Screenfony\DemoBundle\Entity\User;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use FOS\RestBundle\Controller\Annotation\View;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;

class UsersController extends Controller{
 * @return array
 * @View()
 public function getUsersAction() {
        $users = $this->getDoctrine()->getRepository('ScreenfonyDemoBundle:User')
        return array('users' => $users);

 * @param User $user user object
 * @return array
 * @View()
 * @ParamConverter("User", class="ScreenfonyDemoBundle:User")
 public function getUserAction(User $user) {
     return array('user' => $user);

# php app/console router:debug

get_users GET ANY ANY /users.{_format}

With ParamConverter annotation we don’t need to manually load the User entity

## test our api

# php ../composer.phar require doctrine/doctrine-fixtures-bundle dev-master

# php app/console cache:clear –no-warmup

Install the bundle as usual
# app/AppKernel.php
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),

# we need two users in database
add DataFixtures/ORM/LoadUserData.php

namespace Screenfony\DemoBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Screenfony\DemoBundle\Entity\User;

class LoadUserData implements FixtureInterface {

 * Load data fixures with the passed EntityManager
 * @param \Screenfony\DemoBundle\DataFixtures\ORM\ObjectManager $manager
 public function load(ObjectManager $manager) {

 $alice = new User();

$bob = new User();




#configure data base app/config/parameters.yml

    database_driver: pdo_mysql
    database_host: localhost
    database_port: ~
    database_name: screenfony
    database_user: root
    database_password: root

# php app/console doctrine:database:create
# php app/console doctrine:schema:create
# php app/console doctrine:fixtures:load


sudo python
sudo pip install –upgrade setuptools

sudo python

sudo pip install –upgrade httpie

http –version

#Postman – REST Client

#add a file src/Screenfony/DemoBundle/Resources/config/serializer/Entity.User.yml

php app/console cache:clear –env=dev

#http http://localhost/sf2/symfony2-rest/web/app_dev.php/users/1

Symfony 2 CMF et Sonata admin bundle Installation


# php composer.phar create-project symfony-cmf/standard-edition symfony-cmf

# cd symfony-cmf

# php composer.phar install

## Set up the Database

# php app/console doctrine:database:create
# php app/console doctrine:phpcr:init:dbal
# php app/console doctrine:phpcr:repository:init
# php app/console doctrine:phpcr:fixtures:load

## Set Up Local DNS


#If you want to review the contents of the PHPCR database
you can use the following commands:

$ php app/console doctrine:phpcr:node:dump
$ php app/console doctrine:phpcr:node:dump –props
$ php app/console doctrine:phpcr:node:dump /path/to/node

##Creating a CMS using CMF and Sonata


« require »: {

« sonata-project/doctrine-phpcr-admin-bundle »: « 1.0.* »,

# php composer.phar update

# Initialize Bundles

# app/AppKernel.php

// support for the admin
new Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle(),
new Sonata\jQueryBundle\SonatajQueryBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
new Sonata\AdminBundle\SonataAdminBundle(),
new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(),
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),

# Configuration
# app/config/config.yml
default_contexts: [cms]
contexts: [admin]
id: ‘/cms’
contexts: [admin]

# default global templates
ajax: SonataAdminBundle::ajax_layout.html.twig
# display a dashboard block
- { position: right, type: sonata.admin.block.admin_list }
- { position: left, type: sonata_admin_doctrine_phpcr.tree_block }

- all
# if you are using the SimpleCmsBundle, enable the Page as well
# Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page:
# valid_children:
# – all
- all
- Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route
- Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute
valid_children: []
- Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode

# Add route in to your routing configuration:

# app/config/routing.yml
resource: ‘@SonataAdminBundle/Resources/config/routing/sonata_admin.xml’
prefix: /admin

resource: .
type: sonata_admin
prefix: /admin

resource: « @FOSJsRoutingBundle/Resources/config/routing/routing.xml »

resource: .
type: ‘cmf_tree’

# Sonata Assets
$ php app/console assets:install


The function « is_granted » does not exist in SonataAdminBundle::standard_layout.html.twig at line 126


duyphanasnet Symfony2.3 blog install note

#git clone

#cd symfony2-blog

#php ../composer.phar update


add local ip: ’′,

#php app/console assets:install

#You modify the connection parameters into app/Resources/config/parameters.yml

# prepare database
php app/console doctrine:database:drop –force
php app/console doctrine:database:create

# schema
php app/console doctrine:schema:update –force

# load data
php app/console doctrine:fixtures:load


BloggerBlogBundle_homepage GET ANY ANY /blogger/
BloggerBlogBundle_about GET ANY ANY /blogger/about
BloggerBlogBundle_contact GET|POST ANY ANY /blogger/contact
BloggerBlogBundle_blog_show GET ANY ANY /blogger/{id}/{slug}
BloggerBlogBundle_comment_create POST ANY ANY /blogger/comment/{blog_id}
BloggerBlogBundle_sidebar GET ANY ANY /blogger/sidebar


GitHub exu Symfony2.2 Jobeet install note

#git clone symfony2-2-jobeet

#cd symfony2-2-jobeet

#php ../composer.phar update

# and /web/app-dev.php
add local ip: ’′,

#php app/console assets:install


# prepare database
php app/console doctrine:database:drop –force
php app/console doctrine:database:create

# schema
php app/console doctrine:schema:update –force

# load data
php app/console doctrine:fixtures:load


#sudo nano /etc/hosts

#ubuntu box
sudo cp /etc/apache2/sites-available/sandbox /etc/apache2/sites-available/jobeet2
sudo nano /etc/apache2/sites-available/jobeet2
sudo a2ensite jobeet2
sudo service apache2 restart

# et

GitHub isidromerayo Symfony2.1 Jobeet insatll note

##Symfony2 Jobeet install note


#git clone

#cd symfony2-jobeet

#php ../composer.phar install

#Install and enable a PHP accelerator like APC.

sudo apt-get install php-apc
sudo apache2ctl restart

add local ip: ’′,

#php app/console assets:install

#You modify the connection parameters into app/Resources/config/parameters.yml

# prepare database
php app/console doctrine:database:drop –force
php app/console doctrine:database:create

# schema
php app/console doctrine:schema:update –force

# load data
php app/console doctrine:fixtures:load

# create user to admin
php app/console hcuv:jobeet:users admin admin


#sudo nano /etc/hosts

# et

Bootstrap 2 responsive utility classes

For faster mobile-friendly development, use these utility classes for showing and hiding content by device. Below is a table of the available classes and their effect on a given media query layout (labeled by device). They can be found in responsive.less.

Class Phones767px and below Tablets979px to 768px DesktopsDefault
.visible-phone Visible Hidden Hidden
.visible-tablet Hidden Visible Hidden
.visible-desktop Hidden Hidden Visible
.hidden-phone Hidden Visible Visible
.hidden-tablet Visible Hidden Visible
.hidden-desktop Visible Visible Hidden
shenyi's RSS Feed
Go to Top