Skip to content

Instantly share code, notes, and snippets.

View Buttonwood's full-sized avatar

Buttonwood Buttonwood

View GitHub Profile
Restoring a MySQL Replication with corrupted binlogs!
Posted on December 30th, 2005 by Basil
Major assumption: you have a safe, but halted replication you want to restore from.
Situation — Your replication server is down or simply the MySQL slave has stopped, possible because the hard drive filled up and your binlogs got corrupted beyond repair? Some might have the luxury to start a new snapshot from the main DB server, lets call it the Master DB server. But what if you can’t afford to do a read-lock on the server? (Which would be most of the times for production servers with decent traffic). Well — since you planned ahead - you should have multiple replication servers running — it helps to reduce your read load with the round-robin method anyways.
Here’s some things I did to get our primary MySQL replication slave up to date using the planned, redundant replication server, secondary Slave.
So, on a regular day, Master DB replicates its binlog to Primary slave and Master DB replicates to secondatry slav
@dalecaru
dalecaru / innobackupex-restore.sh
Created April 20, 2011 13:42
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# This script is provided as-is; no liability can be accepted for use.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"
@gunnertech
gunnertech / centos_shebang.sh
Created August 27, 2011 01:14
CentOS Setup Script for Passenger/MySQL/Nginx/Rails
#!/bin/bash
#SCRIPT VARIABLES
interpreter=$1
user=$2
project=$3
mysql_root_password=$4
mysql_app_password=$5
environment=$6
@enjalot
enjalot / bar.js
Created December 2, 2011 23:51
[dd3] d3.js selection tutorial
//Simple d3.js barchart example to illustrate d3 selections
//other good related tutorials
//http://www.recursion.org/d3-for-mere-mortals/
//http://mbostock.github.com/d3/tutorial/bar-1.html
var w = 300
var h = 300
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@dsparks
dsparks / Heatmap.R
Last active August 19, 2022 06:54
ggplot2 heatmap with "spectral" palette
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("ggplot2", "reshape2", "RColorBrewer")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Generate a random matrix
# This can be any type of numeric matrix,
# though we often see heatmaps of square correlation matrices.
nRow <- 9
nCol <- 16
@JosefJezek
JosefJezek / how-to-use-pelican.md
Last active May 12, 2024 11:19
How to use Pelican on GitHub Pages
@v5tech
v5tech / Ganglia监控Hadoop及Hbase集群.md
Last active December 2, 2021 09:04
Ganglia监控Hadoop及Hbase集群性能(安装配置)

Ganglia监控Hadoop及Hbase集群性能(安装配置)

1. 在主节点上安装ganglia-webfrontend和ganglia-monitor

sudo apt-get install ganglia-webfrontend ganglia-monitor

在主节点上安装ganglia-webfrontend和ganglia-monitor。在其他监视节点上,只需要安装ganglia-monitor即可

将ganglia的文件链接到apache的默认目录下

@chenzx
chenzx / 20140724-web-operations-notes.txt
Last active December 22, 2021 10:34
网站运维技术与实践
网站运维技术与实践
跳转至: 导航、 搜索
目录
1 服务器监测
2 产品访问监测
3 数据采集、传输与过滤
4 数据分析与报警
5 测试评估
6 集群架构规划
@sayak-sarkar
sayak-sarkar / sublime-text-3.sh
Last active July 14, 2022 09:18
Gist to install Sublime Text 3 on RHEL 6 +
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=Sublime Text 3
Comment=Edit text files
Exec=/opt/sublime_text_3/sublime_text
Icon=/opt/sublime_text_3/Icon/128x128/sublime-text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"