shenyi

shenyi

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=192.168.56.103:1234}" --sout-keep

192.168.110.103 : your wowza server IP

1234 :  port

Or rediffuser

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -vvv "C:\ebooks\Symfony2\KpnUniversity.Starting.in.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=192.168.56.103:1234}"

2. wowza server configuration

http://192.168.56.103:8088/enginemanager

add a stream name : mpegts.stream
and with this stream URI :  udp://0.0.0.0:1234

 

3. flow player

<script src="http://releases.flowplayer.org/js/flowplayer-3.2.13.min.js"></script>

<script type="text/javascript">

$( document ).ready(function() {
$f("wowza", "http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf", {
clip: {
url: 'mpegts.stream',
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://192.168.56.103:1935/live'
}
},
canvas: {
backgroundGradient: 'none'
}
});
});
</script>

Build Virtual Machines With PuPHPet

1. install Virtual Box 4.3 and Vagrant 1.3

2. puphpet.com

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

4. Local VM IP Address : 192.168.56.101

5. Box Sync Folder Source : c:/sandbox

6. Shared Folder Type : Default

7. voir : http://www.sitepoint.com/build-virtual-machines-easily-puphpet/ 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 127.0.0.1 port 2222

15 login : vagrant

16 sudo netstat -tlnp

17. go to http://192.168.56.101  and http://192.168.56.101/phpmyadmin

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

http://localhost:8000

Ctrl + C

cordova prepare iso

cordova compile ios

cordova emulate iphone

:)

install svn in sandbox

##server
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

{code}

<Location /svn>

DAV svn
SVNParentPath /var/svn
SVNListParentPath On
AuthType Basic
AuthName « Subversion Repository »
AuthUserFile /etc/subversion/passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>

[/code]

sudo /etc/init.d/apache2 restart

sudo htpasswd -c /etc/subversion/passwd susername

##client

svn co http://sandbox.dev:8080/svn/monprojet 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
Screenfony/DemoBundle
annotation

# 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
ScreenfonyDemoBundle:User
username
password
email

add some configuration
# app/config/config.yml


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

fos_rest:
format_listener:
prefer_extension: false
view:
view_response_listener: true

# app/config/routing.yml
users:
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')
                 ->findAll();
        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();
 $alice->setUsername('alice');
 $alice->setEmail('alice@screenfony.com');
 $alice->setPassword('fooalicepassword');

$bob = new User();
 $bob->setUsername('bob');
 $bob->setEmail('bob@screenfony.com');
 $bob->setPassword('foobobpassword');

 $manager->persist($alice);
 $manager->persist($bob);

 $manager->flush();

 }
}

#configure data base app/config/parameters.yml

parameters:
    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

# https://github.com/jkbr/httpie

https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py

sudo python ez_setup.py
sudo pip install –upgrade setuptools

https://raw.github.com/pypa/pip/master/contrib/get-pip.py

sudo python get-pip.py

sudo pip install –upgrade httpie

http –version
0.7.2

http://sandbox.dev:8080/sf2/symfony2-rest/web/app_dev.php/users.json

http://sandbox.dev:8080/sf2/symfony2-rest/web/app_dev.php/users.xml

#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

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

## http://symfony-cmf.dev:8080/

#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

##Installation

#composer.json
« 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
sonata_block:
default_contexts: [cms]
blocks:
sonata.admin.block.admin_list:
contexts: [admin]
sonata_admin_doctrine_phpcr.tree_block:
settings:
id: ‘/cms’
contexts: [admin]

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

sonata_doctrine_phpcr_admin:
document_tree:
Doctrine\ODM\PHPCR\Document\Generic:
valid_children:
- all
# if you are using the SimpleCmsBundle, enable the Page as well
# Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page:
# valid_children:
# – all
Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent:
valid_children:
- all
Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route:
valid_children:
- Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route
- Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute
Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute:
valid_children: []
Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode:
valid_children:
- Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode

# Add route in to your routing configuration:

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

sonata_admin:
resource: .
type: sonata_admin
prefix: /admin

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

cmf_tree:
resource: .
type: ‘cmf_tree’

# Sonata Assets
$ php app/console assets:install

# http://symfony-cmf.dev:8080/app_dev.php/admin/dashboard

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

# http://stackoverflow.com/questions/15299919/the-function-is-granted-does-not-exist-in-sonataadminbundle-symfony2-cmf

duyphanasnet Symfony2.3 blog install note

#git clone https://github.com/duyphanasnet/symfony2-blog.git

#cd symfony2-blog

#php ../composer.phar update

#http://sandbox.dev:8080/sf2/symfony2-blog/web/config.php

add local ip: ’10.0.2.2′,

#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

#http://sandbox.dev:8080/sf2/symfony2-blog/web/app_dev.php/blogger

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 https://github.com/exu/symfony2-jobeet.git symfony2-2-jobeet

#cd symfony2-2-jobeet

#php ../composer.phar update

#http://sandbox.dev:8080/sf2/symfony2-2-jobeet/web/config.php and /web/app-dev.php
add local ip: ’10.0.2.2′,

#php app/console assets:install

#http://sandbox.dev:8080/sf2/symfony2-2-jobeet/web/config.php

# 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

#http://sandbox.dev:8080/sf2/symfony2-jobeet/web/app_dev.php

#sudo nano /etc/hosts
127.0.0.1 jobeet2.dev

#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

#http://jobeet2.dev:8080/ et http://jobeet2.dev:8080/admin/

GitHub isidromerayo Symfony2.1 Jobeet insatll note

##Symfony2 Jobeet install note

#https://github.com/isidromerayo/symfony2-jobeet

#git clone https://github.com/isidromerayo/symfony2-jobeet.git

#cd symfony2-jobeet

#php ../composer.phar install

#Install and enable a PHP accelerator like APC.

sudo apt-get install php-apc
sudo apache2ctl restart

#http://sandbox.dev:8080/sf2/symfony2-jobeet/web/config.php
add local ip: ’10.0.2.2′,

#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

#http://sandbox.dev:8080/sf2/symfony2-jobeet/web/app_dev.php

#sudo nano /etc/hosts
127.0.0.1 jobeet.dev

#http://jobeet.dev:8080/ et http://jobeet.dev:8080/admin/

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