Skip to content

Instantly share code, notes, and snippets.

View tquoc229's full-sized avatar

tquoc229

View GitHub Profile
@jaygooby
jaygooby / percona-xtrabackup.sh
Last active May 9, 2022 15:43
Call via crontab on whatever schedule suits you; keep n full mysql Percona xtrabackups of your mysql database, with binary logs applied. Also does a full mysqldump that can then have the binary logs applied to restore to a point-in-time backup via the binlogs. Copy all of this (backup, mysqldump, binlogs) to S3.
#!/bin/bash
#
# Carries out a full mysqldump, calls percona-xtrabackup and then
# copies the sql dump, the percona backup and your mysql bin logs
# to S3 using s3cmd http://s3tools.org/s3cmd
#
# TODO: extract out the S3 backup stuff to make it optional, and so
# other s3 programs can replace the s3cmd call.
# TODO: the if [ $? == 0 ] alert blocks should be a function
# TODO: make the if [ $? == 0 ] if [ $? != 0 ] more consistent - test
@wojtha
wojtha / page.tpl.php
Created December 14, 2012 12:43
Drupal - add floating left and right banner regions
<div id="main">
<?php if (!empty($banner_left)) { print '<div id="banner-left" class="scrollable">' . render($banner_left) . '</div>'; } ?>
<?php if (!empty($banner_right)) { print '<div id="banner-right" class="scrollable">' . render($banner_right) . '</div>'; } ?>
<!-----8<-----SNIP----------------------------------------------------------------->
</div>
@pascalduez
pascalduez / html.tpl.php
Created December 1, 2011 16:47
Drupal 7 — Move $scripts at page bottom
<!DOCTYPE html>
<html<?php print $html_attributes; ?>>
<head>
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<?php print $styles; ?>
<?php print $head_scripts; ?>
</head>
<body<?php print $body_attributes;?>>