Skip to content

Instantly share code, notes, and snippets.


Alexander Klimenko meteozond

Block or report user

Report or block meteozond

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
meteozond /
Last active Jan 1, 2016
Create mysql replication
#! /bin/bash
# Usage <db root password> <remote host_name>
# Just run on future slave machine:
# cd /var/lib/mysql/; nc -l -p 8888 | pigz -d | tar xvf - -C .; chown -R mysql:mysql .
mkdir -p $backup
path="$backup/`date "+%Y-%m-%d-%H-%M"`/";
meteozond / eth_int_balance
Last active Dec 23, 2015
By default all interrupts of multi interrupts network cards are linked to the first core. This script will uniformly spread interrupts between cores.
View eth_int_balance
cores=$(grep -c proc /proc/cpuinfo);
irqs=$(grep eth /proc/interrupts | cut -d: -f1)
for irq in $irqs; do
mask=`echo "obase=16; \$[2 ** $core]" | bc`;
mkdir -p "/proc/irq/$irq/"
echo $core, $irq
meteozond / Django Bootstrap paginator
Last active Dec 23, 2015
Django Bootstrap paginaton
View Django Bootstrap paginator
<ul class="pagination">
{% if prev %}
<li><a href="{% page_url prev %}">&laquo;</a></li>
{% else %}
<li class="disabled"><span>&laquo;</span></li>
{% endif %}
{% if show_first %}
<li><a href="{% page_url 1 %}">1</a></li>
<li class="disabled"><span>...</span></li>
View Django Flup FastCGI Init script
SAFE_NAME=`echo "$NAME" | sed 's/\./_/g'`
You can’t perform that action at this time.