source code aplikasi webcam menggunakan action scripts

udah hampir berbulan – bulan ga di apdet lagi nih blog, lagi keranjingan nyari-nyari piti di dunia asli :D
to the point aja lah, udah 3 bulan ini gw lagi improvisasi sama yang nama nya webcam di gabung pake php, udah nanya sana sini tapi semua jawaban programmer sama, yaitu TIDAK BISA… :( :(:(
setelah searching hasil nya qetemu, ternyata memang tidak bisa, harus lah menggunakan FLASH yang di gabung sama action scripts berikut code asal caplok yang bakalan di implementasiin..

var camera:Camera = Camera.getCamera();
var video:Video = new Video();
video.attachCamera(camera);
addChild(video);

Pertama, mari kita atur resolusi kamera dan video untuk contoh. Kode ini akan setup kamera default dan contoh default video. defaultnya adalah 320 × 240 px

var bandwidth:int = 0; // Specifies the maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second. To specify that Flash Player video can use as much bandwidth as needed to maintain the value of quality , pass 0 for bandwidth . The default value is 16384.
var quality:int = 50; // this value is 0-100 with 1 being the lowest quality. Pass 0 if you want the quality to vary to keep better framerates
var camera:Camera = Camera.getCamera();
camera.setQuality(bandwidth, quality);
camera.setMode(320,240,15,true); // setMode(videoWidth, videoHeight, video fps, favor area)

// Now attach the webcam stream to a video object.
var video:Video = new Video();
video.attachCamera(camera);
addChild(video);
var bandwidth:int = 0; // Specifies the maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second. To specify that Flash Player video can use as much bandwidth as needed to maintain the value of quality , pass 0 for bandwidth . The default value is 16384.
var quality:int = 100; // this value is 0-100 with 1 being the lowest quality. Pass 0 if you want the quality to vary to keep better framerates
var camera:Camera = Camera.getCamera();
camera.setQuality(bandwidth, quality);
camera.setMode(320,240,30,false); // setMode(videoWidth, videoHeight, video fps, favor area)
var video:Video = new Video();
video.attachCamera(camera);
addChild(video);

kalao scritps di atas agak sedikit ribet, kalau mau yang simple nih

Continue reading

implementasi nginx, php dan mysql pada vps centos x86_64

nginx. dibaca Engine – X merupakan High Performance HTTP Server dan Reverse Proxy serta IMAP/POP3 Proxy Server yang bersifat opensource dan gratis. Dikembangkan oleh Igor Sysoe pada tahun 2005 Nginx dengan cepat menjadi populer karena kestabilan, kekayaan fitur dan konsumsi resources yang sangat rendah meskipun masih dalam status beta, diambil dari wiki Nginx.

Bericut langkah-langkah nya :

nano /etc/yum.repos.d/Centos-Base.repo
list repo punya biznet
Setelah itu

yum update -y
yum groupinstall 'Development Tools' -y
yum install -y mysql-server mysql-devel
service mysqld start
mysql_secure_installation

isi pil pil the blank blank

yum install -y wget patch gcc libtool libmcrypt-devel libxml2-devel flex bison make pcre-devel zlib-devel openssl-devel gd-devel

Continue reading

convert htaccess phpmotion pada nginx

lagi iseng-iseng nyobain nginx + phpshield buat youtube-youtuban ala indonesia pake phpmotion, eh ada satu hal yang mengganjal yaitu htaccess pada nginx yang tidak sama jika pada apache. berikut tampilan htaccess dari phpmotion nya.

order allow,deny
allow from all
Options +FollowSymlinks
RewriteEngine On

RewriteBase /
RewriteRule \.(css|jpe?g|gif|png|flv|swf)$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos/load/([^/]*)$ seemore.php?load=$1 [L]
RewriteRule ^videos/load/([^/]*)/([^/]*)$ seemore.php?load=$1&page=$2 [L]
RewriteRule ^audios/load/([^/]*)$ audio.php?load=$1 [L]
RewriteRule ^audios/load/([^/]*)/([^/]*)$ audio.php?load=$1&page=$2 [L]
RewriteRule ^audio/album/([^/]*)/([^/]*)$ audio.php?album=$1 [L]
RewriteRule ^audio/album/([^/]*)/([^/]*)/([^/]*)$ audio.php?album=$1&page=$3 [L]
RewriteRule ^blogs/load/([^/]*)$ blogs.php?load=$1 [L]
RewriteRule ^blogs/load/([^/]*)/([^/]*)$ blogs.php?load=$1&page=$2 [L]
RewriteRule ^albums/load/([^/]*)$ albums.php?load=$1 [L]
RewriteRule ^albums/([^/]*)/([^/]*)$ albums.php?load=$1&page=$2 [L]
RewriteRule ^people_ajax people_ajax.php [L]
RewriteRule ^people/([^/]*)/([^/]*)$ people.php?load=$1&page=$2 [L]
RewriteRule ^people people.php [L]
RewriteRule ^upload-media upload.php [L]
RewriteRule ^groups$ groups.php [L]
RewriteRule ^search search.php [L]
RewriteRule ^videos/([^/]*)/([^/]*)$ play.php?vid=$1 [L]
RewriteRule ^audio/([^/]*)/([^/]*)$ play_audio.php?audio=$1
RewriteRule ^category/([^/]*)$ category_home.php?cid=$1 [L]
RewriteRule ^category/([^/]*)/([^/]*)$ category_home.php?cid=$1&page=$2 [L]
RewriteRule ^subcategory/([^/]*)/([^/]*)$ category_home.php?sub=$1 [L]
RewriteRule ^subcategory/([^/]*)/([^/]*)/([^/]*)$ category_home.php?sub=$1&page=$3 [L]
RewriteRule ^genre/([^/]*)$ genre_home.php?cid=$1 [L]
RewriteRule ^genre/([^/]*)/([^/]*)$ genre_home.php?cid=$1&page=$2 [L]
RewriteRule ^view-album/([^/]*)/([^/]*)$ album_view.php?album=$1
RewriteRule ^view-image/([^/]*)/([^/]*)$ album_view.php?image=$1
RewriteRule ^read_blog/([^/]*)/([^/]*)$ read_blog.php?id=$1 [L]
RewriteRule ^blogs/category/([^/]*)/([^/]*)$ blogs.php?cat_id=$1 [L]
RewriteRule ^blogs/category/([^/]*)/([^/]*)/([^/]*)$ blogs.php?cat_id=$1&page=$3 [L]
RewriteRule ^members/([^/]*)$ memberprofile.php?user=$1 [L]
RewriteRule ^videos(.?)$ seemore.php [L]
RewriteRule ^audios(.?)$ audio.php [L]
RewriteRule ^blogs(.?)$ blogs.php [L]
RewriteRule ^members(.?)$ people [R=301]
RewriteRule ^albums(.?)$ albums.php [L]
RewriteCond %{QUERY_STRING} (\|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteCond %{QUERY_STRING} SELECT(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} UNION(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteRule ^(.*)$ index.php [F,L]

Options -Indexes
SecFilterEngine Off
SecFilterScanPOST Off

ErrorDocument 403 /403.php
ErrorDocument 404 /404.php

Continue reading

scripts Nginx Daemon buat CentOS

#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO
#
# Author: Ryan Norbauer
#
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC=”nginx daemon”
NAME=nginx
DAEMON=/usr/local/sbin/$NAME
PIDFILE=/usr/local/nginx/logs/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
# Read config file if it is present.
#if [ -r /etc/default/$NAME ]
#then
# . /etc/default/$NAME
#fi
#
# Function that starts the daemon/service.
#
d_start() {
start-stop-daemon –start –quiet –pidfile $PIDFILE \
–exec $DAEMON \
|| echo -n ” already running”
}
#
# Function that stops the daemon/service.
#
d_stop() {
start-stop-daemon –stop –quiet –pidfile $PIDFILE \
–name $NAME \
|| echo -n ” not running”
}

#
# Function that sends a SIGHUP to the daemon/service.
#
d_reload() {
start-stop-daemon –stop –quiet –pidfile $PIDFILE \
–name $NAME –signal 1
}

case “$1″ in
start)
echo -n “Starting $DESC: $NAME”
d_start
echo “.”
;;
stop)
echo -n “Stopping $DESC: $NAME”
d_stop
echo “.”
;;
#reload)
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
# If the daemon responds to changes in its config file
# directly anyway, make this an “exit 0″.
#
# echo -n “Reloading $DESC configuration…”
# d_reload
# echo “done.”
#;;
restart|force-reload)
#
# If the “reload” option is implemented, move the “force-reload”
# option to the “reload” entry above. If not, “force-reload” is
# just the same as “restart”.
#
echo -n “Restarting $DESC: $NAME”
d_stop
# One second might not be time enough for a daemon to stop,
# if this happens, d_start will fail (and dpkg will break if
# the package is being upgraded). Change the timeout if needed
# be, or change d_stop to have start-stop-daemon use –retry.
# Notice that using –retry slows down the shutdown process somewhat.
sleep 1
d_start
echo “.”
;;
*)
echo “Usage: $SCRIPTNAME {start|stop|restart|force-reload}” >&2
exit 3
;;
esac
exit 0

Start dan Stop Daemon nginx

http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-1.tar.gz

tar zxvf apps-sys-utils-start-stop-daemon-IR1_9_18-1.tar.gz
cd apps/sys-utils/start-stop-daemon-IR1_9_18-1/
gcc start-stop-daemon.c -o start-stop-daemon
cp start-stop-daemon /usr/sbin
chkconfig --add nginx
chkconfig --level 345 nginx on