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
meteozond / rpl.sh
Last active Jan 1, 2016
Create mysql replication
View rpl.sh
#! /bin/bash
# Usage rpl.sh <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 .
backup=/var/lib/mysql/backup
mkdir -p $backup
path="$backup/`date "+%Y-%m-%d-%H-%M"`/";
@meteozond
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
#!/bin/bash
cores=$(grep -c proc /proc/cpuinfo);
irqs=$(grep eth /proc/interrupts | cut -d: -f1)
core=$(($cores-1));
for irq in $irqs; do
mask=`echo "obase=16; \$[2 ** $core]" | bc`;
mkdir -p "/proc/irq/$irq/"
echo $core, $irq
@meteozond
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
#!/bin/sh
NAME='example.com'
USER='example_user'
PROJDIRPRE="/sites/"
PYTHON="/sites/envs/project/bin/python"
SAFE_NAME=`echo "$NAME" | sed 's/\./_/g'`
PROJDIR="$PROJDIRPRE/$SAFE_NAME"
You can’t perform that action at this time.