Showing posts with label technology. Show all posts
Showing posts with label technology. Show all posts

Tuesday, September 4, 2018

My startup is serving half a PB a month

In 2016, I founded GC GROUP, LLC; a lawful American startup handling few websites. Today, we're managing around 20 websites, many of which are highly trafficked. We serve around 2,000 users a second and use many cloud providers including Google Cloud Platform, Highwinds and Amazon Web Services.

Our stats show that we have been delivering around half a PB a month; that's around 500TB a month and 6PB a year!

Stats for August 2018:


Stats for July 2018:




We use many technologies to optimize and cache our content properly; but most importantly, we ensure downtimes are never acceptable.
Share:

Tuesday, September 5, 2017

iCloud Trauma: 13,625 images and videos disappear and how I recovered them

Imagine that you wake up one day to find out that 13,625 images and videos have disappeared from your iPhone, iPad, and iCloud.com.

This is exactly what happened to my iCloud and specifically iCloud Photo Library. I woke up one day to find out that all of my old images from March 2014 till March 2017 now have disappeared.

I kept refreshing icloud.com/#photos, changing browsers, and researching. The "Deleted Photos" folder was empty. I was screwed.

I even waited a day to check back iCloud.com and still images didn't show up.

Exact thoughts 

"Fuck you Apple, literally fuck you". I couldn't process it. I trusted iCloud and I thought my data was safe there but apparently, it wasn't. Those images were important to me and only some images from 2014 were backed up. The rest weren't.

First attempt to contact Apple Support 

The first attempt to contact their support was an utter failure. I was barely hearing the support personnel (who was located in Egypt and speaking Arabic). The call disconnected before I articulated my problem and they didn't bother to call me back, they instead sent me this: 


An empty email with a header message saying contact us. Not even a body message. 

Using forensic tools

At that point, I completely gave up on Apple and I started looking for online help to fix my issue. I found a great forensic tool called Elcomsoft phone breaker for Mac:

 What this tool claimed to do was:


"Elcomsoft Phone Breaker can extract photos and videos stored in the user’s iCloud Photo Library. In addition to existing files, Elcomsoft Phone Breaker can extract media files that have been deleted from the Library during the past 30 days. Selective downloads are possible by specifying which user-created albums to download."



Exploring Elcomsoft PhoneBreaker

I was really skeptical about this software so  I decided to give it a try, I have turned off two step authentication temporarily and logged in via their program to see this interface:


I was really happy that now my missing images are appearing in "Deleted". On icloud.com, the deleted folder was empty. However, they were being displayed in this software.



Purchasing Elcomsoft PhoneBreaker

At that point, Elcomsoft has proven to be working (by allowing me to recover only up to 10 pictures). I had to purchase the software for USD200.  



After a few minutes, I received my registration code:

Starting the Download:

This was the most chaotic part. The download took almost a day despite having an internet speed of 1.5 MB/s. The download has interrupted at least 20 times (due to poor internet connectivity or iCloud issues/restrictions).



However, I realized later that the download is resumable because the pictures are downloaded in chunks inside a hidden folder called .chunks. The contents of the folder look similar to this:



So every time the download interrupted, I re-downloaded it using the same directory that had .chunks, so the download resumed instead of restarting. At the end of the day, I had my images downloaded. 


Images had no timestamp

Images were mixed without a date, so they lost they lost their chronological order. I realized that at that point, I have to contact Apple again.

Another attempt to contact Apple 

This time I couldn't even submit a request:

Final attempt to contact Apple 

The next day, I kept trying to contact support until they managed to call me. This time, finally, I was able to talk to a support technician from Apple. Apple performed their security checks and when they have done that, they have informed me that they will be able to recover them.

Their support was really great. 

Images reappear in Recently Deleted

After the call ended, support was able to restore images to "Recently Deleted" but not to "All Photos".





Support attempts to call me again 

Only to inform me this time that images have been recovered but they are in the "Recently Deleted" folder and I had no move them back to other folders to prevent the permanent deletion of them in 30 days. 



Case Closed

Images have been recovered. I moved on. 

So, what caused this?

It is not really known what caused the images to be removed. But I believe, when I have switched from my old to my new mac, I used Apple's Migrate Assistant, which moved the old Macbook data to the new Macbook. Later on, I activated iCloud Photos. So the contents of the Photos app were synced (Which had few images only).

I think that iCloud Photo Library thought that I have removed the images and thus removed them from iCloud Photo Library and consequently all of my devices.

What is the lesson?

Never trust the cloud and specifically iCloud. Your data isn't safe and might be removed forever. Physical encrypted backups for everything are a must.

Final thoughts

It was important to deal with this situation calmly, I will not stop using iCloud Photo Library even though it fucked up; but I will increase my backups with those photos. I have already downloaded Google Photos and I will be allowing the app to store all of those images. I will be also having physical and encrypted backups of those images.
Share:

Friday, June 30, 2017

How to get the url of the currently playing video of a playlist in JWPlayer 7?

In case you are a JWPlayer fan (like me), you will most probably reach a point where you'd have to use their API. I am talking mostly about the "JW Player JavaScript API Reference".

I have recently been trying to get all of the sources (.mp4 files of the same video, each with different quality) of the currently playing video item from a playlist with multiple videos (2 or more video items). I have searched a lot online no how to do that but no real help was provided as you see in the link below:

How do I get the filename of the currently playing item from a playlist containing more than one?

But nothing was helpful, so I had to dig through JWPlayer's API and find out myself how to do it in the Playlist section here. It is definitely very easy and the trick is to simply under their API and use it properly. The code uses JQuery so make sure you import it.

Here is the full code (playlistVideoLinks.js):


Here is the minified code (playlistVideoLinks-min.js):



Share:

Tuesday, June 27, 2017

Serving one billion monthly requests online

Today, I will blog about serving one monthly billion requests from a huge website of mine. I will speak about the architecture and network used to it. As it was recently reported on Cloudflare:



That makes around 37 million total requests per 24 hours and around 428 requests per second.


Half of the requests are cached through CloudFlare and the rest are served from Highwinds CDN. CloudFlare CDN directly is configured on top of Highwinds CDN. While this may sound vague, this means all of the website requests are passed through CloudFlare's CDN. CloudFlare's system is able to filter requests and they deliver .js and .css files from their network; the rest of the files (.jpg, .mp4 and .webm) are served from Highwinds. Reports from their Highwind's phenomenal interface SiteTracker 3.0: 


Highwinds is configured on top of Leaseweb's dedicated servers. Leaseweb is my favorite server provider. They are extremely reliable and operate their own solid network which is configured on top of Highwinds server. Traffic from one main server: 
Load on the server is tolerable (Around 800GB of bandwidth daily) due to Highwind's efficient caching. A quota of 34TB is served on that server (whether they are being used or not). They are never fully being consumed so I always pay for the reserved bandwidth that is never used.  I am bit stingy so I don't want anyone sharing the bandwidth, I don't want any competition.

I also occasionally use Google Cloud Console to deliver .json files

What is remarkable and common about Highwinds, Cloudflare and Leaseweb is that all they all operate their own networks.

Cloudflare owns 115 datacenters worldwide, and the number changes every one or two weeks whereas Leaseweb has a 5.5 Tbps bandwidth capacity and Highwinds operates multiple 10GigE backbones with stable PoP houses solid state drives (SSDs).

So, if I have to sum up the architecture used, it would look like this:


Share:

Sunday, April 30, 2017

I just recieved one of the most sophisticated phishing attacks ever

I am not a fan of hijackers and phishing criminals. But social engineering has become the most common to crack, target and steal any online account. Those hijackers either lack the sufficient skills to penetrate a system or the system is too tedious to penetrate or hack; thus they resort to sending phishing attacks. When you send a phishing attack, you can creative as much as you want and the limit would be just the sky. In this case, they started by creating extremely identical pages which is an easy step:

    Real Apple Login Page:


    Fake Apple Login Page:


But moving on, surprisingly, the phishing link was appleid.apple.com. Yes, I was extremely surprised but it turns out that their phishing attack had used unicode characters.

    Real Apple Phishing Link:


    Fake Apple Phishing Link:


Ironically, the phishing website was linking non-https images but it was detectable by chrome and not only that, they could not fake the EV Certificate which says "Apple Inc.". Looking at both source codes and comparing them confirmed the phishing attack.

After adding dummy data, a two-step authentication page was opened where the attackers have assumed I have set it up. They did not have my mobile number or my devices so they asked me to add a mobile number (which doesn't happen on a real apple login page). If I had inserted correct login information, their system would have sent me the verification code and I would have given it to them and bingo they would have accessed my Apple ID.

This is one of the best phishing attacks I have ever received, I was really impressed by it. Even the spoof email (support@apple.com) had bypassed Outlook's spam filters and went into my inbox. But the formatting of the email really looked suspicious. They succeeded in gaining my attention by saying that a purchase has been made from my account.

Share:

Tuesday, April 11, 2017

How I built an .exe program that secretly copies source code in the clipboard

My friend recently asked me to create for him a .exe program that downloads the source code from the internet and copies it to the clipboard. Source code can be anything such as Java, PHP or Python. Without doubt, the program would only work on Windows machine. My friend also wanted:

1. The program to retrieve the code from an URL which links to a text file.
2. The program should work silently, doesn't print anything on success.
3. The program should handle and catch exceptions.
4. The program should select one out of three.txt files based on users keystroke.
5. The program should be compatible with Windows 10.
6. The program should look like a calculator.

I have found the request very fun and decided to do it. C# would be a great and excellent tool for this, so I have download Microsoft Visual Studio C# 2008 for this task. I was taught C# and C++ on Visual Studio 2005 and 2008, so I really do not know the recent versions of Visual studio.


First, I have downloaded from the internet three sources codes for my friend in Java: BucketSort, RadixSort, and MergeSort. And I have uploaded them into my Google Cloud bucket.

So, I have three public URLs.

https://cdn.georgechalhoub.com/api/blogger/ewoe120asdo12eqweasdf/BucketSort.java
https://cdn.georgechalhoub.com/api/blogger/ewoe120asdo12eqweasdf/MergeSort.java
https://cdn.georgechalhoub.com/api/blogger/ewoe120asdo12eqweasdf/RadixSort.java

Then, I have started by downloading and installing a Visual Studio C# 2008 from this link and created a new project. On my machine, it was installed in French for some reason, but I was too lazy to fix it.

A default form is created by Visual Studio, so I had to rename it to form to Calculator and changed its icons. I also made sure the form doesn't resize by twisting the settings. So, it looked like the image you see on the left.


Now the fun part, our program. In the source of your form, I imported the necessary libraries.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Windows;

Then, inside the constructor of the Calculator, I have created a key event listener. What this means is that if you press any key while the .exe is running, the event listener will be called. So the constructor looked like this:

public Calculator()
{
    InitializeComponent();
    this.KeyDown += new KeyEventHandler(tb_KeyDown);
}

What's left now,  doing creating the function tb_KeyDown and making it accept some arguments. Function looked like: tb_KeyDown(object sender, KeyEventArgs e).

Now, that code is inside the function, I have captured the keystroke, then decide to which links it belongs. So, if user presses on B, the BubbleSort.java would be copied; similarly for M (MergeSort) and R (RadixSort).

string dumb_key = e.KeyCode + "";
string link = "";
if (dumb_key == "B")
     link = "https://cdn.georgechalhoub.com/api/blogger/ewoe120asdo12eqweasdf/BucketSort.java";

if (dumb_key == "M")
    link = "https://cdn.georgechalhoub.com/api/blogger/ewoe120asdo12eqweasdf/MergeSort.java";

if (dumb_key == "R")
    link = "https://cdn.georgechalhoub.com/api/blogger/ewoe120asdo12eqweasdf/RadixSort.java";

Now, I had to download to URL and put it in the clipboard. For that, you need to create an object of the WebClient class:

WebClient client = new WebClient();

Then download the link:
Byte[] pageData = client.DownloadData(link);

And put in a string (With the formatting and breaks):
string pageHtml = Encoding.ASCII.GetString(pageData);

Then, put it in the clipboard:
Clipboard.SetText(pageHtml);

Then, the annoying part for me was handling exceptions, so I encapsulated the code in a try/catch clause. Inside the catch clause I handled errors:
//Couldn't connect to the internet.
if (webEx.Status == WebExceptionStatus.ConnectFailure) {
    Clipboard.SetText("Couldn't connect to a network.");
}

//Catching errors such as: 404, 403 and 400.
if (webEx.Status == WebExceptionStatus.ProtocolError) {
    var response = webEx.Response as HttpWebResponse;
   
    if (response != null) 
{
         Clipboard.SetText(response.StatusCode + "");
    }
    else {
         Clipboard.SetText(webEx + "");
    }
}

else 
{
    //An unknown error has occurred, just print to the clipboard.
    Clipboard.SetText(webEx + "");
}

Then, I compiled and ran the program, and everything was working correctly. On keystrokes, the code was copied to the clipboard. I have included the .exe in case you wish to test it. Download it at your own risk.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Windows;
namespace WindowsFormsApplication1 {
 public partial class Calculator: Form {
  public Calculator() {
   InitializeComponent();
   this.KeyDown += new KeyEventHandler(tb_KeyDown);
  }
private void Calculator_Load(object sender, EventArgs e) {
  }
  static void tb_KeyDown(object sender, KeyEventArgs e) {
   string dumb_key = e.KeyCode + "";
   string link = "";
   if (dumb_key == "B")
    link = "https://cdn.georgechalhoub.com/api/blogger/ewoe120asdo12eqweasdf/BucketSort.java";
   if (dumb_key == "M")
    link = "https://cdn.georgechalhoub.com/api/blogger/ewoe120asdo12eqweasdf/MergeSort.java";
   if (dumb_key == "R")
    link = "https://cdn.georgechalhoub.com/api/blogger/ewoe120asdo12eqweasdf/RadixSort.java";
   WebClient client = new WebClient();
   try {
    Byte[] pageData = client.DownloadData(link);
    string pageHtml = Encoding.ASCII.GetString(pageData);
    Clipboard.SetText(pageHtml);
   } catch (WebException webEx) {
    //Couldn't connect to the internet.
    if (webEx.Status == WebExceptionStatus.ConnectFailure) {
     Clipboard.SetText("Couldn't connect to a network.");
    }
    //Catching erros such as: 404, 403 and 400.
    if (webEx.Status == WebExceptionStatus.ProtocolError) {
     var response = webEx.Response as HttpWebResponse;
     if (response != null) {
      Clipboard.SetText(response.StatusCode + "");
     } else {
      Clipboard.SetText(webEx + "");
     }
    } else {
     //Unknown error just print to clipboard.
     Clipboard.SetText(webEx + "");
    }
   }
  }
  private void Form1_Load(object sender, EventArgs e) {
  }
 }
}


Share:

Thursday, March 16, 2017

Trimming videos via FFMPEG

After continuous insisting from my friends, I have recently set up my Steam account and purchased two games, Portal and Portal 2. And I have also been recording the screen and audio while playing just for archival and other purposes such as uploading them to YouTube and profit from videos that get high hits.

Portal 2, for example has many chapters and in each chapter you have a singnificant set of levels to finish to levels. Chapter 1 of Portal 2 has 19 levels. Nonetheless, after recording one hour session, I had to split them later.

I found intially an excellent trimmmer that is really useful in QuickTime: 


However, the process was incredibly time-consuming. So, I thought I want to do it via coding and it was easier than I imagined.

Indeed, the first library that came was FFmpeg: the revolutionary and prominent and useful and capabable video editing software on existence.

FFmpeg is way more capable than just trimming videos, so trimming via FFmpeg was very easy. Searching through their official documentation, I was able to find this link.

In short the ffmpeg command needed for trimming is this:
ffmpeg -i input.mp4 -ss 00:01:40 -to 00:02:12 -c copy output.mp4

I have tested it tons of times and found out it is the fastest and safest way to trim videos. Here are the parameters in short: 
  • -i: This specifies the input file. In that case, it is (input.mp4).
  • input.mp4: This your input file. You can name it as anything you want.
  • --s: Used with -i, this seeks in the input file (input.mp4) to position. 
  • 00:01:00: This is the time your trimmed video will start with.
  • -to: This specifies duration from start (00:01:40) to end (00:02:12).
  • 00:02:00: This is the time your trimmed video will start with.
  • -c copy: This is an option to trim via stream copy.
  • output.mp4: This your output file. You can name it as anything you want.
You can run the ffmpeg command on any bash terminal and it will run smoothly. Nonetheless, if you want to trim around 13 videos you'd have to write the command 13 times, which left me annoyed. So, I had to write a small python script take care of it.

You can run this code by simply calling python ffmpegTrim.py and indeed you have to change the arguments.
Share:

Tuesday, January 3, 2017

Starting 2017 with the "Nordic" template on this blog


I have recently realized how much I started to hate complicated blogging themes that are full of animations, design and javascript loaded that slows down the page, although I used them for years.



But I have recently realized I want something very simple, a clean cut design that lets u focus on content instead of anything else. I have been very lucky to find "Nordic" template, an immaculate template that was originally designed for Wordpress (a PHP-based slow and vulnerable blogging platform that I dislike) but later converted to Blogger (the robust and secure cloud blogging platform hosted and acquired by Google Inc.)

What I really liked about the Blogger version of the template is that pictures do not show on the main page (which has been an issue in the past).


Simplicity is key. As you see on the right, it is incredibly simple, clean and symmetric. Extremely useful to look at as well it looks well organized. 

By default, around 13 posts are originally posted on the main page, and they're all taking the same size (unlike what you see with other templates).

The share buttons are clean and work efficiently as well.  In some other models, they used to cause lots of headaches because they needed confirmation; and some templates required external add-on libraries.




The search bar looks decent and is hidden by default. But you can toggle it from the button on the right and the search page results. Social media icons are also provided by default on the right.



The page is responsive as well, and it can quickly shrink. There is no need to upload a separate template for mobile (as the option is already provided by Blogger). So the work that needs to be done is minimal.

The hamburger icon automatically appears on the left which is vital to use on the mobile.

Checking the publicly available blog on the service "Am I responsive?" illustrates that the blog looks incredible well on most major portable devices. 

It is worth mentioning that half of the internet's traffic comes from mobile. The mobile may and most likely will be the dominant source of traffic in the future as the people tend to visit websites from mobile devices instead of laptops.

Mobile responsiveness is not luxury but a prerequisite. 

Other than that: individual blog post pages - comments, footer, and other stuff are very well made.

According to a prominent speed test tool Pingdom, the site's load time is on average 1.11s (which is not really excellent but average). The template has no dependencies and doesn't request any additional external libraries.





Share:

Thursday, March 17, 2016

It is 2016 and Payoneer still does not offer two-step authentication

In summary, this blog post is about Payoneer not offering two-step authentication for its members despite numerous requests.

As of March 17, 2016, Payoneer, a world-renowned company with more than 3 million customers, does not offer a two-step authentication protection for its members.

Founded in 2005, Payoneer provides financial services and online money transfer services worldwide. It is available in more than 200 countries and supports more than 150 currencies. 

Payoneer's concept is simple: you get an international credit card from Payoneer that allows you to get paid from any valuable american company. You will be able to use the credit card literally on any ATM machine anywhere in the world and withdraw the funds. You don't have to deal with banks, their headaches and contracts.

Payoneer had extreme success in the past and recently posted those stats on their website:


After massive success and being 10 years in business, the security department at Payoneer still doesn't get it: two-step authentication matters; all large and small tech giants include it such as: Apple, Amazon, Google, Amazon, Microsoft, etc...

Apparently, Payoneer is not aware that it is a company that handles financial accounts, not a social media accounts. Would thieves and hackers be interested to hack or hijack a simple social media account or a financial account that lets you gain access to a decent amount of cash? 

Computersolving.com said

Here goes my first criticism for Payoneer, besides no 2 factor authentication being available, I find it unbelievable that a company processing payments will not allow me to use special characters in my password, only letters and numbers are allowed, this will greatly help malicious hackers trying to break into my account using a brute force attack.

What Payoneer doesn't understand is that is not difficult to get to know someone's password, whether be it: installing some spyware on the victim's machine, standing behind the victim while s/he types  the password, or any type security vulnerability in the service's website and database. In addition to that, Payoneer does not force members to add characters in their passwords.

The community has been asking for this feature since forever, for example:




4. November, 2015: Security at Payoneer


I have personally contacted Payoneer's customer support team and this is the response I have received from them:

Thank you for contacting us. We understand your concern. Unfortunately the service is not available at present. We are working hard to make this available in future.

From this blog, I send a wake-up call to the security department of Payonner- it is time to fall out of the coma and straighten-up the security department.


Share:

Friday, September 4, 2015

Remove duplicate lines from a file using python


In case you have a file "input.txt" with duplicate lines and you would like to remove duplicate lines from it, and have the result put in "output.txt" all you have to do is execute
this python script, be careful and use the same indentation (space):


lines_seen = set() # holds lines already seen
outfile = open("out.txt", "w")
for line in open("input.txt", "r"):
    if line not in lines_seen: # not a duplicate
        outfile.write(line)
        lines_seen.add(line)
outfile.close()

This will execute in less than a 1 second, no matter how big is the file. Have a nice day.
Share:

Tuesday, May 5, 2015

Text Mechanic.co - Keyword Suggestion Generator tool

Today, I came accross the greatest keyword suggestion generator tool which is Text Mechanic's Keyword Suggestion Generator tool. It works great, it is efficient, and extremely helpful.

According to textmechanic.co,


The Text Mechanic's "Keyword Suggestion Generator" will retrieve Google.com auto suggest results* for your entered seed text in an easy to investegate format. Seed text can be a letter, number, word, phrase, related to what you (and others) are querying to find in Google search results.

Enter seed text into the seed text field and click "Submit" button. Results will load here. Click on a result to open a Google.com search window for that result. Can't think of anything for seed text? Just click the "Random" button for a random seed word.

Click "Prefix" or "Suffix" button to prefix/suffix exisiting seed text with the letters a to z. Query rate will vary between 2.5 to 4.5 seconds. When suffix seeding, place a space at the end of exisiting seed text to query last word as a full word. Prefix seeding is tricky and only gives numerous results on web search. Seeding a single word use no front space. Seeding two words or a partial phrase, place a space before the first word. Trial and error is a must.

Screenshot:

Keyword Suggestion Generator

Share:

How to redirect the whole page when you submit a form in an iframe

Thanks to this post on StackOverflow, I found to redirect the whole page when you submit the form with an iframe inside.


Problem: You have an iframe which got a form, when you use the iframe to submit the form, the page will not redirect normally and this might cause some behavior which you don't like.

Solution: Add target='_parent' to the form.

Example:  <form action="/signup" method="post" enctype="multipart/form-data" target='_parent'>

You don't have to add anything to the iframe. This should work.
Share:

12 reasons you should always use CloudFlare

Who would have thought that in this huge internet revolution, there would be a free unlimited CDN service? No one! Today, in 2015 there is a free CDN service and it works great.

It is the one and only... CloudFlare.

CloudFlare, a US-based company headquartered in California, which provides a content delivery network service. Its network protects, speeds up, and improves availability for a website or mobile application with a simple change in DNS.

Here are 10 reasons why you should consider linking your website to CloudFlare.

-1- It's free.
You already knew that from the introduction. Cloudflare could save you hundreds of TBs, millions of requests, provides you security and protection and boost up your site and it's all absolutely for free. This is the first reason why you should consider CloudFlare. While more advanced options cost money, it isn't really important for you can run your website with a free version of CloudFlare.

CloudFlare has many competitors like MAXCDN and others, but they charge you per TB whereas on CloudFlare it is free.

-2- It is easy to setup
Here is an experiment you should do, say those words loudly:
  • One, two, three, one, two, three, drink
  • One, two, three, one, two, three, drink
How hard was that? Yeah, exactly. CloudFlare is as easy to setup as singing those words. No rocket science needed, no programming skills needed, no credit card needed, get started in less than 5 minutes.

All you have to first is input your domain in the text field, then you can follow easy instructions, and change the nameservers in your registrar; heck even CloudFlare will copy your DNS settings automatically. You site will be running through CloudFlare and boosted up in less than 5 minutes.


-3- It protects you against attacks
CloudFlare does automatically protect you against any a denial-of-service (DoS) or distributed
denial-of-service (DDoS) attack. You will sleep at night knowing that threats will be handled and blocked by CloudFlare.

CloudFlare on the next day will show you all the threats they have blocked. Imagine if you were actually unprotected and you suffer from a DDoS attack. Dog help you then.

CloudFlare reported that it uses the collective intelligence of its community to get smarter. CloudFlare’s network learns from every new attack and then shares that information with the rest of the CloudFlare community. That means new threat gets recognized in CloudFlare for future attacks.

-4- It speeds up your website
On average, a website on CloudFlare loads twice as fast, uses 60% less bandwidth and has 65% fewer requests. 

It automatically activates asynchronous resource loading, force aggressive GZIP, auto-minimize HTML, CSS, and JavaScript files everywhere.

It also distribute all your tiny files to all their servers around the globe (CDN), speeding your website to the extreme maximum, all that for free.

-5- It has great and reliable analytics
You think Google Analytics are the best and the most efficient way to track your analytics? Think again! CloudFlare analytics simply rock and they overcome normal analytics like Google Analytics.

Cloudflare are 100% confident in the hits and unique visitors numbers on CloudFlare are better than Google Analytics, and have the raw logs to back them up. 

-6- One-Click install app
You can install many apps for me within one-clikc, for example you can install Google Analytics, submit your site to webmasters.

Some apps include: Infolinks, Pingdom, Vukkle, Smart Errors, Panopta, GamaSec, Dakwak, CodeGuard, Better Browser, etc...


-7- Your server's IP will be hidden
Many of you would like to have their privacy, right? There are 59,423 services online which are dedicated in revealing who is the server company hosting your content. 



Without CloudFlare, assuming you've turned on the gray tick, no one will reveal your true server's IP or your server's host

-8- Your site will stay online when your server goes offline
Unless you're Google, Facebook or Amazon, your server will go down; there is no escape about it.

Cloudflare's Always Online keeps your site available even if your server goes down. If your server goes down, CloudFlare will serve your site's most popular pages from their cache. As soon as your server comes back online, CloudFlare will move users back to regular browsing.

-9- Free, secured, updated, one-click install HTTPS certificate
Would you believe it if I tell you with one-click you can install and activate the https certificate? You don't need to configure anything with your server, nor install or uninstall anything. Your site will have a working and fast https certificate which gets automatically updated online.

You can also choose between Flexible SSL, Full SSL, Full SSL (Strict).
Cloudflare also uses Universal SSL.



-10- Set page rules easily in your website 
You can forward, set a custom cache level and exclude certain CloudFlare settings and apps. You can force https on certain links, bypass cache on other links, and change hundreds of settings like forwarding, custom caching, expire TTL, always online, apps, performance, mirage 2, rocket loader, security, SSL, security check, browser integrity check, etc...

-11- Get help when you're under attack
While CloudFlare automatically blocks normal attacks and normal threats. Some users target you, and they won't stop until they exhaust your website and turn it down. CloudFlare helps you with the "Under Attack Mode".  Advanced and complicated security features you find them on Amazon and Google only. This feature is really great, though you might have to upgrade your account. 

-12- Take CloudFlare anywhere with you
With the unofficial app iFlare, available on the App Store, you can configure your account,  view analytics and take CloudFlare with you wherever you go. It costs only 1$ but it is all worth it.

iTunes description for the app is: iFlare for CloudFlare™ makes it easy to manage your CloudFlare™ account with your iPhone.
Share:

Sunday, May 3, 2015

Display number of subscripers on a video page in ClipBucket

ClipBucket is the fastest growing video script which was first started as Youtube Clone, it is not that excellent but it the best around here.

Developed by Arslan Hassan originally, a brilliant programmer who later turned the project into tune.pk, an unblocked YouTube clone in pakistan, Arslan made a fortune out of his projects. 

One of clipbucket problems is that it doesn't show the number of subscribers on a video page.

Many users who are cloning YouTube or would like to create a script similar to YouTube would love to show the number of subscribers in the script.

Fortunately, since I examined every piece of code in clipbucket, I easily know how to do it, it is extremely simple.

First go to watch_video.php and add the following:

//Getting the user information - Read more: BLOG.GEORGECHALHOUB.COM
echo $u = $vdo['username'];
$u = mysql_clean($u);
$udetails = $userquery->get_user_details($u);
assign("u",$udetails);
//End Getting the user information

Then go to watch_video.html and add the following smarty line where you want to display the number:

{$u.subscribers|number_format}

That's it. It is pretty simple. The code should any version of clipbucket: 2.0 - 2.1 - 2.6 - 2.7.
Share:

Wednesday, April 29, 2015

How to copy files/folders from a server to another server using SSH

I bought a new server for my programming site ifelse.tv, the server company who was renting me their servers has promised to partition my server in a way I could have 2TB of data storage.  I only had 1TB of data storage. I messaged them and they broke the news, they made a mistake and they need to re-format and repartition the server.



I have had uploaded already 150GB of video files, but I wasn't ready to give them up. I wanted a fast, quick and efficient solution.

The quickest and cheapest solution was to copy the 150GB of video files to another server, then add them back when they fix your server.

Both servers had a 100Mbps unmetered internet. That would make on average 14MB/sec. Not bad for 150GB of content files.

The only question was how to do it? Google helped me find my solution and this is how I did it.

1. Login to the server which has files you need backup via SSH. It doesn't matter if you have root access or not:























2. Execute this command (some changes need to be made):
scp -r --ignore-existing /home/admin/domains/s1.ifelse.tv/public_html/ifelse george@5.199.168.114:/home/george/ifelse


scp (constant): This will copy files from server to server.
 --ignore-existing (contsant): This will sometimes ignore the existing files.
-r (constant): means, recursive, it will copy all subfiles and files inside the folder.
/home/admin/domains/s1.ifelse.tv/public_html/ifelse (variable): The folder or file you need to backup.
george@5.199.168.114 (variable): The destination server. As you see, I didn't enter the root account.

/home/george/ifelse (variable): The destination folder on the other server (make sure you create one). 

3. It will ask for the other server's password, enter it:
4. It will begin copying files:

You should leave it for work, as it might take a lot of time. This works pretty well.

Good luck!
Share: