Showing posts with label code programming. Show all posts
Showing posts with label code programming. Show all posts

Wednesday, August 30, 2017

How-To: Schedule Full Automatic cPanel Backups for MySQL Databases and Files using the Cron

Update Oct. 2012!

This script has been thoroughly revised and updated and works with the latest version of cPanel and WHM. And it’s still free! Also, a new version of the WHM reseller backup script has been released.
The guide in this video is for version 1.0 of the script. It has since be updated significantly – you should edit config.php instead
Ensuring your website and data are safe in the event of a disaster can be a tricky and time consuming task.
Have you recently made a complete backup of your website?
“No” is not a option any more – it’s easy with the right tools.
For those of you who don’t have professional grade Managed WordPress Hosting that handles all this for you, we have built a script that will completely automate your daily/weekly backups.
We have built it for those out there that use cPanel (so we don’t support Plesk, sorry).

Schedule automatic web hosting backups for your MySQL and file Data

Of course, this automation script is completely free and we encourage you do to download it and set it up.
Further, to make it easy we have provided a clear step-by-step how-to video so you can implement it yourself in about 5 minutes without any hassle whatsoever.

Automatic backups in 4 easy-to-follow steps

  1. Download the script that we wrote.
  2. Edit the script with your web hosting details
  3. Upload the script to your web hosting using your FTP client
  4. Setup the automation (“cron” job)
You can download the cPanel backup script written in PHP here.

Easy to follow Video guide on how to setup the CPanel automatic backup

To make things super easy for you, I have put together a 4 minute video that outlines all you need to get the automation script installed on your web hosting site.
If you have any issues, please feel free to write a comment below, or on the Video on YouTube.

What Next?

If you’re having hassles with your web hosting and would prefer someone look after your website ensuring that you’re secure and your data is always backed up, please have a look at our Managed WordPress Hosting option.
Of course, if you’re just starting out, remember you can get a brand new, top-class website based on WordPress for only 100!

Use the form below to join our Developer Channel

Do you need an automated CPanel web hosting backup script? There is that and more in the Developer Channel

source : https://www.hostliketoast.com/2011/09/how-to-schedule-full-automatic-cpanel-backups-mysql-databases-files-cron/

Saturday, June 9, 2012

การใช้ syntax highlighter in blogger

      " ผมเริ่มต้นการเขียน blog บทความนี้ก็เป็นบมความแรกๆของการเขียน blog ขึ้นมาเลยครับ อืมรู้สึกว่าเขียนไม่ค่อยจะเป็น ใช้คำไม่ค่อยจะถูกยังงัยไม่รู้อะ (copy เนี้อหาของคนอื่นซะจนเคนตัวครับ 555 เนี่ยละครับเด็กไทย เลยคิดไม่ค่อยเป็น) จะพยายามเขียนให้ได้วันละเรื่องให้ได้ครับ ขอบคุณทุกคนที่เข้ามาเยียมชมใน blog ของผมนะครับ "
             ผมเคยเห็นโค้ดที่แสดง โค้ดของโปรแกรม รู้สึกว่ามันมีประโยชน์เวลาที่เราจะเอาcode ที่มีแสดงไว้ในบล็อกของผมเอง เผื่อว่าวันใดที่เราต้องการเอาCode มาใช้ภายหลังครับ วันนี้ผมลองเข้าไปใน blogger ทางด้าน IT มีการแสดง sourcecode ที่blog เลยสนใจที่จะลองใช้งานดูเผื่อว่าให้blogger นี้สามารถแสดง code ได้ โดยใช้ plugin SyntaxHighlighter โดยเจ้าตัว SyntaxHighlighter มีประโยชน์มากในการแสดงผลของcode programing ที่ต้องการจะแสดงไว้บน webserver หรือ ถ้ามีใช้งานเว็บ blogger ไว้ก็สามารถใช้งานได้โดยตรง

            สามารถ Download Systaxhighlighter ได้จากที่เว็บไซต์
                           Site:http://alexgorbatchev.com/wiki/SyntaxHighlighter:Download
                           Configuration Steps:http://alexgorbatchev.com/wiki/SyntaxHighlighter:Configuration
                           Brush Aliases:http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes

แต่รู้สึกว่าถ้าเราโหลด v.ใหม่มาใช้อะครับ เวลาจะcopy code ที่โชว์อยู่มันจะไม่ขึ้นให้copy โหลดไปอะครับ แล้วแต่เว็บที่เคยเห็นมันมีให้ก็อบได้อะดิทำงัยดีวะ ก็เสียใช้เวลาคนหาวิธีการทำมาจนได้

ขั้นตอนการใช้งานมีขั้นตอนดังนี้

  • Login เข้าไปในเว็บblogerของเราเองแล้ว
  • ไปที่  Blogger Dashboard --> Design --> Edit HTML  เพื่อทำการแก้ไขหน้า template ของblog ให้สามารถแสดง  SyntaxHighlighter ได้ทุกเพจ

  • แก้ไข Template ในส่วนที่อยู่ใน tag  <head>...</head> เพื่อประกาศไว้ใช้ทุกเพจของเว็บโดยเพิ่ม code เข้าไป 





  • เมื่อต้องการแสดง code โดยใช้ SyntaxHighlighter ให้ขึ้นตั้นด้วยคำสั่ง <pre> แล้วตามด้วยcode ที่ต้องการแสดง แล้วปิดด้วย </pre> ในtag pre ระบุ ภาษาของ code ที่ต้องการแสดงไว้ด้วย <pre class="brush: c#">เพื่อให้  SyntaxHighlighter แสดงผลได้ถูกต้อง
<pre class="brush: BRUSH-NAME">

Paste Your Code Here

</pre>

Ex. C#
using System;
public class HelloWorld
{
    public static void Main(string[] args) {
 Console.Write("Hello World!");
    }
}

  • code ที่อยุ่ใน tag <pre></pre>จะต้อง Encoded string เพื่อแก้ปัญหาcode ที่แสดงเป็นภาษาต่างดาว

สามารถแปลงเป็นencode ได้จากเว็บไซต์ http://www.string-functions.com/htmlencode.aspx

 SyntaxHighlighter รองรับภาษา

LanguageAliases
C++cppcc++
C#c#c-sharpcsharp
CSScss
Delphidelphipascal
Javajava
Java Scriptjsjscriptjavascript
PHPphp
Pythonpypython
Rubyrbrubyrailsror
Sqlsql
VBvbvb.net
XML/HTMLxmlhtmlxhtmlxslt