Thursday, November 14, 2013

How to compile JW Player from source code using Adobe Flash CS

To compile JWPlayer, you need two things:
1. Flash CS4 (or CS5)
2. Flex SDK v4 (hoặc v3)

You can download it at:




3. Download Source Code of JW Player at:


Choose the lastest version, download and unpzip to your folder. For example, I'm using JWPlayer5
Now open Flash CS4, Creat New choose Flash File (ActionScript 3.0)



Click Ctrl + S , name file (ex. player.fla) and save it at C:JWPlayer5SRC (must be SRC)



Go to Properties, at tab Publish, copy and paste below code to Class:

com.longtailvideo.jwplayer.player.Player

Below Tab Properties, at Stage you can choose color of default background for  JW Player, I choose white color (#000000)

Ctrl + U to show Preferences, Choose ActionScript, click ActionScripts 3.0 Settings



At Flex SDK path, find to directory Flex SDK v4.

Click OK twice.

Hold Ctrl + Shift + F12 (or FilePublish Settings) to show Publish Settings
click Tab Flash, click Settings at Script : ActionScript 3.0

 

Settings, you choose tab Library path, clear all and  +. Copy and paste below line:
$(FlexSDK)/frameworks/libs


Click+ , choose Library of JWPlayer: C:JWplayer5libs

 

Click OK to save and return to Public Settings:

Clcik Publish to compile. Go to  C:JWplayer5src and you get jwplayer swf:



That's all.

Saturday, October 19, 2013

Backup to Amazon S3 Bucket from CentOS 6.4

In this tutorial I’ll make mysql db backup and then upload it to AMAZON S3 Bucket using S3CMD tool and bash script. The script will also create the separate folder automatically for each day inside the bucket.

Before starting this tutorial, we need to install the EPEL for s3cmd tools:
wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6 
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm --import RPM-GPG-KEY-EPEL-6
rpm -ivh epel-release-6-8.noarch.rpm
yum repolist

Switch to the root user:
sudo su -

1

Install the s3cmd tools:
yum install s3cmd

2

After installation, run the following command in order to configure the s3cmd tools using your AMAZON ACCESS KEY and SECRET KEY.
s3cmd --configure

3

It is always a good practice to create a separate scripts directory:
mkdir /script
cd /script
nano mysqlbackuptos3.sh

4

Paste the below code into the script (Please modify the following script to suit your purposes):
#!/bin/bash
#############################################################
# Created by: Thoai Nguyen (thoai.nguyenanh{at}gmail(dot)com) #
#                                                           #                                                                                                #
#############################################################
## Specify the name of the database that you want to backup
DATABASE="tendodb"

## USERNAME and PASSWORD to take the backup
USER="arbab"
PASSWORD="PASSWORD"
## Defination of some necessary variables
S3_BUCKET=tendodbbackup
DATE=`date +%A-"(%d.%m.%Y)".%H`
BACKUP_LOC=/tmp/backups
S3BDIR=`date +%d.%A-"(%d.%m.%Y)"`
mysql_backup(){
/usr/bin/mysqldump -u $USER -p$PASSWORD --databases $DATABASE | gzip -9 > $BACKUP_LOC/tendodb_$DATE.sql.gz
s3cmd ls s3://$S3_BUCKET/$S3BDIR > /tmp/log.txt
grep -lr "$S3BDIR" /tmp/log.txt
if [ $? -ne 0 ]
then
mkdir /tmp/$S3BDIR
s3cmd put -r /tmp/$S3BDIR s3://$S3_BUCKET/
s3cmd sync -r $BACKUP_LOC/ s3://$S3_BUCKET/$S3BDIR/
else
s3cmd sync -r $BACKUP_LOC/ s3://$S3_BUCKET/$S3BDIR/
fi
}
mysql_backup
echo "----------------------------------------------------------------------------------------------" >> /scripts/dbbackup.log
echo "Backup Successfully uploading to the S3 Bucket at `date +%A.%Y%m%d-%H.%M`" >> /script/dbbackup.log
echo "##############################################END#############################################" >> /scripts/dbbackup.log
rm -rf $BACKUP_LOC/* /tmp/$S3BDIR
exit 0

5

Create the backups directory inside the tmp directory (or anywhere else, as per your desire) to hold the mysql backup temporarily before uploading it to the s3 bucket:
mkdir /tmp/backups
chmod 0777 /tmp/backups

6

Verify the access to the bucket, where you want to upload the backup using the following command:
s3cmd ls

7

Give the execute right to the script and run it:
cd /script
chmod +x mysqlbackuptos3.sh
ls
./mysqlbackuptos3.sh

8

This bash script also creates a log file inside the /script directory:
cd /script
ls
cat dbbackup.log

9

Inside the S3 Bucket, it will create the mysql backup like this:

10

To automate this process using the cronjob, enter crontab -e at the shell prompt:
crontab -e

11

Add this line to run the script at midnight every day:
0 * * * * /script/mysqlbackuptos3.sh > /dev/null

12

Enjoy :-)

Hope this will help you!

Please Remember me in your prayers!

Monday, October 14, 2013

WooTake.Com - Video Monetiztion Site for Free

Promote Program Beta – You upload videos, we handle revenue


With this program, you can:

- Promote your business by yourself. It is completely free

- Get paid for uploading good content that people want to see. The program is open to anyone with an account, and you get paid monthly with no traffic shaving, and no hidden rules.

 

1. Earn from views (Comming Soon)


You get $5 per 10,000 views from all countries

  • A user must be unique (they haven’t downloaded anything else on the site in the last 24 hours)

  • They must watch 2 minutes of the clip in order for you to get paid. Most other affiliates ask for a FULL stream.

  • Clips under 2 minutes are not paid

  • You can earn additional $1 per 10.000 visitors, if these visitors have come from your site.


Here you can view your stats: My Account -> Manage Affiliate -> Stats

 

2. Earn from your own ads

- You can put your own banner on all your videos

- We only accept Banner 468 x 60

- Go to My Account -> Manage Affiliate -> Banner Code -> put your code -> Save

 

3. Earn from your dailymotion publisher

Check out at http://publisher.dailymotion.com for details.

- You can put your syndication key on all your videos

- You don’t need put your syndication key for each video manually, we help you do it automatically.

- Go to My Account -> Manage Affiliate -> Publisher Key-> put your syndication key -> Save

 

Payout:

  • Payouts can be immediately applied from 10 USD

  • Minimum payment amount is $10

  • You must embed or link the video. The source you find in your account -> my videos.

  • Manipulating the results in any way will result in account disabling

  • PayPal, perfectmoney, webmoney, …


 

Signup for an account, enter your banner code or your syndication key in your profile, upload your files and link to the videos from your freesite, mgp, linklist or any other type of website to earn money.


WooTake – Unlimited Video Monetization Flatform

Friday, August 16, 2013

Install Transmission Daemon on CentOS / Fedora / Ubuntu



Transmission is Torrent / Magnet link client vastly used on Linux, its available for almost all distros.
If you are willing to use it as headless / VM to download torrents with minimal installationon your CentOS / Fedora / RHEL distro following is the packages needs to be installed & configuration required to access transmission as web service.

here 192.168.1.1 is machine transmission daemon
192.168.1.0/24 is lan

CentOS
Install epel repo

rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
yum -y install transmission-daemon transmission-cli


Fedora

yum -y install transmission-daemon transmission-cli


Ubuntu

apt-get install transmission-daemon transmission-cli


Configure your machine ip / network to allow access to transmission daemon.

Make sure daemon is already stopped, otherwise changes may not work on start / restart.
CentOS

/etc/init.d/transmission-daemon stop
vi /var/lib/transmission/.config/transmission/settings.json
#from
"rpc-whitelist": "127.0.0.1",
#to
"rpc-whitelist": "192.168.1.*",

/etc/init.d/transmission-daemon start


Fedora 16
Fedora does not install transmission-daemon as a service.

killall transmission-daemon
vi ~/.config/transmission-daemon/settings.json
#from
"rpc-whitelist": "127.0.0.1",
#to
"rpc-whitelist": "192.168.1.*",
transmission-daemon


Ubuntu 11.10

/etc/init.d/transmission-daemon stop
vi /etc/transmission-daemon/settings.json
#from
"rpc-whitelist": "127.0.0.1",
#to
"rpc-whitelist": "192.168.1.*",

/etc/init.d/transmission-daemon start


Now you can access transmission using http://192.168.1.1:9091/
Ubuntu may ask for username & password. which is transmission. Thats because of following entry in settings.json
"rpc-authentication-required": false,

Sunday, August 11, 2013

Increase the root filesystem in Linux inside VMWare Workstation/VSphere without LVM

In this tutorial, I’ll explain the step by step procedure to resize the Linux root partition without losing the date. This will be really handy if you are not using LVM and you came to know that your existing root partition is run out of space.

WARNING: It’s really dangerous, so backup your data before attempting this. Please don’t blame me, if you destroy your system. You are responsible for your own actions!

Prerequisites to Start this Tutorial:

You will need to download the GParted live CD ISO file for the later use in this tutorial, so you can get this here.

Let’s start the tutorial by verifying the current root filesystem size:
df -h

1Create any file, just for verification, that we didn’t lose the data during the root partition increase process.

Turn off the virtual machine:
sudo shutdown -h now

2

Once, it shutdown, Click on the “Edit Machine Settings“, select the Hard Disk from the right side and press “Utilities“. A menu will be displayed, select “Expand” from it:

3

Current size is 4GB (It will be different in your case):

4

Increase it to your desired size(mine is 10 GB):

5

Once it will be expanded, will show you the success message:

6

Select the CD/DVD and press Browse:

7

Locate the GParted ISO that we have download in the prerequisite step:

8

Next, Power on the virtual machine to BIOS:

<9

Select the CDROM as first boot device from Boot Menu:

10

Accept the Default Settings:

11

Select “Don’t touch keymap“:

12

Press Enter to accept the default type of keyboard that have:

13

Press Enter again to start GParted in graphic mode:

14

Select the “linux-swap” from the partition layout and press the “Swapoff” from the Partition menu:

15

Select the “exteneded” from the partition layout and press the “Resize/Move“from the Partition menu:

16

Assign all unallocated space to it:

17

Press the “Resize/Move” Button after assigning all the unallocated space:

18

Next, again select the “linux-swap” from the partition layout and press the ”Resize/Move” Button:

19

Move the swap to the end of the extended partition and press the ”Resize/Move” Button:

20

Click “OK“ to the warning:

21

Once again select the “exteneded“ from the partition layout and press the “Resize/Move” button:

22

Shrink it like this, so that it’s size will only be equal to the size of the swap partition by moving the slider from left to the right side and press the “Resize/Move” button:

23

Next, select the “/dev/sda1“,which is root filesystem, from the partition layout and press the ”Resize/Move” Button:

24

Assign all unallocated space to it:

25

Then press the ”Resize/Move” Button:

26

Once you are done with the changes and sure that they are correct, press the “Apply” Button (Be Careful: changes will be irreversible once applied):

27

If everything go well, GParted will show us the “All operations successfully completed”, just press Close:

28

Reboot the system, login to the machine and verify the increase in the size of the partition of root filesystem:
df -h

29

 

Enjoy :-)

Hope this will help you!