Posts

Showing posts from July, 2013

Why doesn't Amazon Cloudfront stream don't play for some videos?

Image
Today I am writing about a small issue I faced while working with Amazon CloudFront. I use this for streaming videos saved in Amazon S3. CloudFront gives me an rtmp url like rtmp://saqiu28r4l5ke.cloudfront.net/cfx/st and then my clip url becomes mp4:video.mp4 . This works completely fine with FlowPlayer I have used along with Flash RTMP Player that I use for a quick check. But  I was thinking of naming my video files with date and time so I changed the name to video-2013-07-29-12:39.mp4 . And eventually, Amazon CloudFront stopped streaming the video. The issue with such a filenaming was the ':' colon character. And I replaced that colon character with a period character, and the video stream worked fine again. So what I learnt from here that having colon in the filename of the file to be streamed will stop the stream. Its because it bring ambiguity for clip to stream as we have the streaming clip url as mp4: video.mp4. Having two colons causes this issue. 

Twitter Bootstrap updated from 2.3.2 to 3RC1 & available in CDNs

Image
Twitter Bootstrap has been updated from version 2.3.2 to version 3 now. Twitter Bootstrap version 3 RC1 is the latest version now. Now boostrap is available in a new home page. Its now available in a CDN hosted network to make loading faster.The CDN hosted files can be linked using the following lines. <link href= "//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css" > <script src= "//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/js/bootstrap.min.js" ></script> Its better to update your websites to the new CDN hosted latest files for faster loading. The older version is still available at  http://twitter.github.io/bootstrap/2.3.2/ . Key change in this new version is that " the version 2 was desktop browser first design." but now version 3 is mobile first design. That is developing with version 2 was to build for desktop and then ultimately for mobile devices. But the recent version 3 is mobile first design develo

How to upload a file using AJAX request?

Image
Today, I am going to write solution of a problem I encountered while doing a project. Most of us are familiar with AJAX requests. We send values using ajax request to the server for processing. That's easy right we have been doing that all the time during web development. How about sending an image in the AJAX request? Have you tried that? Yes? Cool. If no, then you are going to learn this today. Yippee. Not only this, you will be able to submit the whole form without hitting submit button and without the page being refreshed. For viewing purpose it might seem like nothing happened at all. But it can turn out a great advantage for you. I used this for to create 'Live Preview' functionality i.e. clicking on a preview button the form was submitted and after successful AJAX request the preview of the submitted values was shown and once the preview is the one we want we can use the save button of the form to save our result. Using the Live Preview won't change anything in o

How to get values of a textarea which has tinymce editor

Image
TinyMCE is a platform independent web based JavaScript HTML WYSIWYG editor. The screenshot above is an implementation of TinyMCE editor in a textarea. It is light weight and easy to use. Also, it has lots of plugins to use with. If you haven't used it before, give it a try.You'll love it. Actually here in this post, I am not going to tell how to use TinyMCE editor in your forms. But I encountered a small thing that I wanted to share it with you. The thing is mostly when ever we use TinyMCE we have nothing to do for this in client side. All we do is in the server side with the values in it. The value of the editor is obtained by the value in the name attribute. However if we want the same value in client side for use then we might try: JavaScript: document . getElementById ( 'id_of_the_editor' ). value ; jQuery: $('#id_of_the_editor').val() which wouldn't work then how to get the values. Here's how we get values of the textarea field with TinyMCE editor :

Android 4.3 and Updated Developer Tools | Android Developers Blog

Image
Google announced Google Nexus 7 today with Android 4.3 ' JellyBean'. Nexus 7  has  new in: OpenGL ES 3.0 Bluetooth Smart Restricted profiles New media capabilities Notification access Imporved profiling tools This brand new launch of Nexus 7 is priced at $229.99. Read the details on android developers blog:  Android 4.3 and Updated Developer Tools | Android Developers Blog

Galaxy Note 2 Magic Wave wallpaper for download - Android apk

Image
Here in this  post, I  am sharing nothing more than a mere  live wallpaper for you android phone. This live wallpaper is one from Galaxy  Note 2 for your android phone. I have used it in my Android Ice-cream Sandwich. You  might like to download  it too. A still preview of the live wallpaper is attached  below:  If  you  want to download it. You  can download it form http://adf.ly/SlAUw .

Allowing MySQL access to MySQL Server in Amazon EC2 instance from remote host

Image
Here in this post I am going to tell how I did allow remote access to MySQL server running in Amazon EC2 instance running Linux. I believe you are capable of installing MySQL server in your Amazon EC2 and  I also believe you have read my previous posts on ' Firewalls in Amazon EC2 ... '. This post  will help you open the ports for the MySQL Server. Now, connect to your Amazon EC2 instance and open mysql as a root user and then run the following SQL query:  grant all on db_name.* to 'username'@'%'; This command will allow all the permission to the database db_name to the user 'username' from any host. That is the database can be accessed from any remote host. For you case please don't forget to change the datbase name and the username. Using % means to allow all hosts, if you have any specific host than please change that to what you want. e.g.  grant all on db_name.* to 'username'@'example.com'; Once you have granted the p

Getting a Master Card [ Payoneer Card ]

Image
For all the Nepalese who are thinking of doing online business as an Agency, Freelancer, or want to  receive money worldwide. They need a master card for this. Yes, Nepalese Banks don't issue master cards to their account  holders. But this doesn't mean Nepalese can't  do Internation Bussiness. There is a solution for all out there who want a master card in their hand. To order you master card for free please visit the link:   http://share.payoneer-affiliates.com/a/clk/S6Khm  . The master card is provided by a very reliable  service provider from USA called Payoneer. This card can be  used for all kinds of online transactions for sending money, getting paid from clients, getting  cash from ATMs. Payoneer Card is a reliable payment method and is supported by  thousand of web clients like Odesk , Elance , Paypal , Moneybookers / Skrill , etc The Payoneer master card can be issued and used in more than 200 countries. Here's a video which shows why to use Payonner C

Get akismet API Key for Free

Image
WordPress is a web software that can be used to create beautiful websites and blogs. Its a free in the sense of freedom and in the sense of free beer. This community driven development of WordPress has made it very popular among the community members. It has thousands of  http://wordpress.org/themes/  and plugins  and is downloaded millions of times.Here in this post we are going to discuss about a plugin of WordPress i.e. akismet . Akismet plugin is an anti-spam plugin. It is useful in checking comments from spam comments. Its an autopilot plugin which does its work by self. Akismet's API key can be obtained from  http://akismet.com/get/ . You just need to use the Personal/Blog version. If you want to pay for the Key then you can use the commercial one.

How to track the activities of visitor

Here in this post, you will learn how to track the activities of the visitor in your website. By tracking activities here, I mean to say, we will want to store information about from which link the visitor came, whats the IP address of the visitor, did he come by clicking a link on any other website or did he came directly to our page. All such information can be tracked. Information we would like to track are: IP of the visitor: $_SERVER['REMOTE_ADDR'] Requested URI: $_SERVER['REQUEST_URI'] Current Website: $_SERVER['HTTP_HOST'] Current URL: curlPageURL()  public function curPageURL() {         $pageURL = 'http';         if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}         $pageURL .= "://";         if ($_SERVER["SERVER_PORT"] != "80") {             $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];         } els

WordPress Plugin to display dates converted from A.D. to B.S.

Image
If you're looking for a WordPress Plugin that can convert the dates in your WordPress website from A.D. to B.S. then use the plugin available at   http://adf.ly/SDGxE . This plugin is still in development phase and has limitations. Its a modification of the Nepali Date Converter we made in our previous post http://writephp.blogspot.com/2013/05/date-converter-ad-to-bs-and-bs-to-ad.html . This plugin has the same limitation on date conversion as that in our previous Date Converter Application. 

Firewalls in Amazon EC2 : iptables and security group

Image
Amazon Web Services offers Amazon Elastic Compute Cloud service, also known as Amazon EC2. According to AWS Definition: Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud.    It is designed to make web-scale computing easier for developers. Yes Amazon EC2 is a cloud computing service offering scalable, pay as you go service. And it can be launched from amazon web console. Once an Amazon EC2 instance is created first thing we might want to do is open ports so that the Amazon EC2 will be accessible. By default, the Amazon EC2 instance is accessible by SSH. But ports for http, https, smtp, pop, imap are not open by default in Amazon EC2. Here in this post we will learn how to open http port 80. Amazon EC2 has a two level of security. One is maintained form the amazon ec2 console. And the other is on the instance itself. Here in this post our EC2 instance is a Linux based instance. So we are more focused on Linux system

How to make all the files default to public in Amazon S3 bucket

Image
After so long I am writing this another post on amazon web services. Yes, I want to share my another experience with Amazon S3 bucket. I am using S3 bucket to store my video files that I stream through my website. And all videos are added to the bucket using S3 API. But the problem is the videos are not accessible to the public unless I make each video public. Every new video added thus had to be made public from the aws console. And it was so hard to do this. And therefore I was looking for a solution for this. And viola, I found it. Amazon S3 bucket has this thing done using bucket policy. In this post, I will help you add bucket policy so that you too can have all your files in S3 bucket public accessible if you want them too. To add the bucket policy select the bucket and click on properties tab on the top right corner, then on the right side a column will appear with options like static permissions, web hosting, logging, notifications, life cycle. To add the bucket policy

WPScan to check WordPress Vulnerability

Image
WordPress is a open web software used widely for building personal blogs and commercial websites. Since websites are public accessible to the world, they are prone to security hacks. To check the security of WordPress website, an application was developed call WPScan . Well so lets know some more about WPScan. WPScan is a black-box WordPress vulnerability scanner. Its an open source project and its source code is available at https://github.com/wpscanteam/wpscan .  It comes by default in some Linux distros like BackTrack , BackBox , Pentoo . Its a ruby based command line application. Therefore this command line application is very useful for the security analysts, hackers, WordPress Webmasters to check the security of their WordPress application. Below is a video which shows a demonstration on how to use WPScan to check WordPress Vulnerability.

John The Ripper - jtr

Image
John The Ripper , also known as ' jtr' , and recently known as ' john ' is a password cracker tool used by hacker in brute force attacks.Brute force attack is the hit and trial method of using random passwords to crack into a system. John the ripper is so powerful enough at generating random passwords of specified lengths using specified characters. Installing john the ripper is easy in Linux system.If your package manager is 'yum' then its pretty straight forward to use the command:  'sudo yum install john' and for those with apt-get 'sudo apt-get install john'  Or you can visit 'John the Ripper password cracker' s website at  http://www.openwall.com/john/  for download. It is available for Linux, Mac and Windows. Once the password cracker tool, john is installed you can check it's installation and usage help by the command ' john ' in terminal, the output of the command should be as shown in the image below:

How to change MAC address

Image
Wikipedia defines MAC Address as : A  media access control address  ( MAC address ) is a  unique identifier  assigned to  network interfaces  for communications on the physical network segment. MAC addresses are used as a  network address  for most  IEEE 802  network technologies, including  Ethernet . Logically, MAC addresses are used in the  media access control  protocol sublayer of the  OSI reference model . MAC address is a 6 groups of two hexadecimal value separated by ':' ,  assigned to the network interface card. The form of the addressing is known as EUI-64.  MAC Address are assigned by the manufacturer and therefore are unique for all the interface cards. Therefore MAC Address of a NIC is its identity. Its writted in a read only memory of the device. If you are curious enough then you might want to find the mac address of your NIC card if its so then open your terminal and hit the command ifconfig interface . For my case the result is as follows: [paras@c2w

Ubuntu One for Android - Download APK

Image
Ubuntu One is a great cloud storage service by Ubuntu. Its can be used to store photos, music, documents online, synced with various devices. It also offers premium service like Music Streaming. Its available for most of the devices for example your windows machine, Linux Machine, Mac, iPhone, iPad. And yes Android Phone too. It can sync your files to all these available devices. All you have to do is download Ubuntu One in your devices. For your android phone you can download from  http://adf.ly/RiFqm .

Terminal Application for Android -Download APK

Image
Android is a linux based mobile operating system. Therefore it has the file structure of Linux. And definitely when the term Linux comes, there other term is accompanied with it and that is terminal. Yes, when someone says, for many people that first thing to strikie is terminal. Yes Android has a terminal application too. You can download it from  http://adf.ly/RiELD . You'll be amused to know that most of the commands you run on your Linux machine runs in android too. The screenshot in the side shows a view of the terminal program in execution. This can be used to view files, create files. If you have tried SL4A, then you are going to love to work in terminal in your Android Phone. 

EbookDroid For Reading PDF Files in Android - Download APK

Image
EbookDroid is really a very cool e-book reader for Android Phones. You can download it from  http://adf.ly/RiBgE  . This has a nice book shelves to display the books. The thumbnail view of the cover of the E-book makes us easy to identify the books. Some of the cool feature of E-book Reader are: Resumes from the page where we left last time Recent E-books in separate shelves, along with e-book search feature Zooming, Bookmarks, Navigation outline, Different View options Backup and restore facility Auto-scan directories to find new e-books Supported file types: .pdf, .xps, .djvu, .djv, .oxps, .cbz, .cbr, .fb2, .fb2.zip Night mode, gamma & contrast settings

How to use nmap - Network Mapper Tool

Image
Nmap  [ Network Mapper ] is a network security scanner tool. It is a completely free tool, free as in free beer and free as freedom. That means its free of cost and is open source too. Cool huh? Its extensively used for network discovery and security auditing by System and Network Administrators. It uses the raw packets to find out the characteristics of the system being audited. It helps finding out the operating system running, the running services, firewalls in use, etc. And thus its very useful for System Administrators, Network Administrators and Security Analysts. Its very helpful in gaining information that can be used to compromise a system by hackers. Its available for all of the operating system Linux, Mac, Windows. Its a command line utility tool. However a GUI version is also available, Zenmap . Now that we have known about Nmap. Lets get it installed in our system. For operating systems viz. Redhat, Fedora, Cent-Os use the command:  sudo yum install nmap  For Debian

How to use vi text editor

Image
Vi is a very popular text editor in Linux Systems. Its very worth full to learn vi, because almost all of the Linux systems text editor for command line is vi. So learning vi is very very useful. Its very useful for programmers, system administrators, network administrators,etc. Vi has 3 mode of operations. In this post, I will help you learnt the two modes of vi which are the frequently used vi modes. They are the command mode and the insert mode. To get started type: vi file.txt this command create a new file 'file.txt' if it doesn't exist. If it exists then it will open the file. As soon as the file is opened or created the mode of vi is command mode where we can type specific commands for specific operations. To type some contents in the file or edit the content we need to hit the key 'i'. This takes us in insert mode. In insert mode, we can type whatever we want. To get out of the insert mode we use the key 'Esc'. This brings us back to command mod

Linux CommandLine Video Tutorial

Image
Many people starting to use Linux find the command line very hard to use. Some just think Linux is command line operating system and is very hard to use, which is not the truth. Linux is there in beautiful GUI too. Actually there are a couple of choices of GUI in Linux for example, GNOME, KDE, Cinnamon, XFce, etc. However command line is not that difficult. I have a video attached here that you would like to check out. This video was recorded an year ago while I was recording some video tutorials for backtrack. Which I couldn't complete. And Now that I have uploaded this video to YouTube, may be this would help you  get started with terminal in Linux. In this video I have tried to show how to use some of the basic commands in Linux. You will learn to use commands like cd, mkdir, ls, more, pwd, etc. You can watch this video on YouTube too in the following link :  http://youtu.be/JWasYrQnOqA  . 

Getting Latitude and Longitude of a place in Google Maps 3

Image
Well if you have read my post on integrating Google maps 3 in website . Then I have put a link to this post. There in the post we need the latitude and longitude of the place for the map to show the location we want. But in that post we had no idea from where we can get the latitude and longitude. We just integrated Google Maps in with the an arbitrary latitude and longitude. Now, here in this post we are going to find the latitude and longitude of the address we want to use. This will have a field to enter the place to search, and the other two fields will show the latitude and longitude of the address found. The full working code snippet of getting latitude and longitude of a place in Google maps is as follows: <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Get Latitude and Longitude from Google Maps 3</title> <script src="http://maps.google.com/maps/api/js?libraries=places&region=uk&l

Integrating Google Maps 3 in website

Image
Google Maps had a new version announced on Google I/O 2013. The maps is live now. For developers using the previous version. That was pretty easy to integrate the maps in to the website because there was a button to get the integration code which was based on iframe. But version 3, has a new set of API, and integration code is to be written by self. And for this we need to know the latitude and longitude of the address we want to integrate in website. Integrating Google Maps 3 has a few steps to do: 1. Include the maps library:   <script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> 2. Make an area to display the map     <div id="map_canvas"></div> 3.  Display the map in the area with id map_canvas.   <script>       function initialize() {         var map_canvas = document.getElementById('map_canvas');         var map_options = {           center: new google.maps.LatLng(27.7, 85.33333330000005),           z

Firefox OS Smart Phones to be launched this month

Image
Firefox OS , Boot to Gecko , B2G is an open web app based mobile operating system being developed by Mozilla .Its designed to allow HTML5 applications to use the hardware resources using JavaScript and Open Web APIs. Firefox announced today, that Firefox OS Smart Phones will be launched this month in market. Till date, the Firefox Smart Phone was available only to developers, which was known as the Developers' Phone. But from this month, Firefox OS Devices will be available in select markets. Firefox claims to free people from the existing proprietary mobile platforms by taking the open web beyond browsers to mobile operating system.  Open Web Apps is the best part with Firefox OS l iberating more freedom to users and developers. Firefox OS is being launched in two phones this month. The first two phones to launch Firefox OS are ZTE Open and Alcatel One Touch. ZTE Open is being launched in Spain today for a price of $90. The devices are being launched in Central

Fedora 19 [codename: Schrodinger's cat ] final release in a few couple of hours

Image
Fedora is a free and open source Linux operating system. The fedora project is sponsored by Redhat Inc. "Fedora has [...] released an amazingly rock-solid operating system."  − Jack Wallen,  TechRepublic.com Yes, After 7 months of continuous development and bug fixing over fedora 18. Fedora 19 is finally releasing today 10:00 A.M. Eastern US Time. Fedora 19 has a code-name " Schrodinger's Cat ". A brief timeline of fedora 19 development is as follows: 2013-01-15 Fedora 18 Release Planning & Development Begins 2013-01-29 Feature Submission Deadline 2013-03-12 Feature Freeze--Planning & Development Ends 2013-03-12 Branch Fedora 19 from Rawhide 2013-04-02 Software String Freeze 2013-04-02 Alpha Change Deadline 2013-04-23 Alpha Release 2013-05-07 Software Translation Deadline 2013-05-14 Beta Change Deadline Features 100% Complete 2013-05-28 Beta Release 2013-06-18 Final Change Deadline 2013-07-02 Fedora 19 Final Release Recomme

AirDroid Application for Download

Image
Air Droid Web Interface If you want to control your Android Device remotely from a computer through internet from somewhere anywhere then yes, this application is for you. AirDroid is thus an application that helps you access your Android Device remotely. The application can be downloaded from  http://adf.ly/ROlWU . And its web interface can be accessed from  http://web.airdroid.com/?source=chrome_app

Download 10000 Free eBooks Reader

Image
10000 Free eBooks Reader is an android application with access to thousands of eBooks for free. This application allows to browse by category and authors in the eBook Store. EBooks can be downloaded from the eBook Store and read offline. 10000 Free eBooks Reader also has a feature to request books that you want to read. Compared to other eBook formats and reader this is a very light weight application thus saves lots of your memory resouces. It does support *.epc file format for the text content, epc.xml file as configuration of the eBook and cover.png for the cover page of the eBook. The main location for the ebooks to be stored in SDCard is /mnt/sdcard/EbookReader/epb/ebook_Name. Once the books are downloaded they can be shared with friends too. Sorting eBooks and managing eBooks in different folder all can be done in 10000 Free eBooks Reader. The eBook Reader has a very cool interface with different themes, custom font sizes, bookmarks facility and really great animated page