Skip to content

Instantly share code, notes, and snippets.

View kometchtech's full-sized avatar
🏠
Working from home

kometchtech kometchtech

🏠
Working from home
View GitHub Profile
#!/bin/sh -e
# EDIT: /etc/rc.local
# /usr/bin/nohup /usr/bin/systemd-run --nice=19 --scope -p CPUQuota=1% /usr/local/bin/nic_irq_balance.sh &
# cpu core check
CORE=`echo $(grep -c ^processor /proc/cpuinfo)`
if [ ${CORE} = 1 ]; then
MASK="1"
elif [ ${CORE} = 2 ]; then
MASK="1 2"
#!/bin/sh
DATE=`date '+%Y%m%d%H%M%S'`
DUMPCMD="/usr/bin/mysqldump"
INNOBACKUPEX="/usr/bin/innobackupex"
BACKUP_DIR="/root/db_backup/"
USER="root"
PASS="zabbix"
@kometchtech
kometchtech / unbound
Created October 6, 2015 01:26
logrotate unbound
/var/log/unbound/*.log {
weekly
rotate 7
missingok
notifempty
compress
delaycompress
sharedscripts
create 644
postrotate
@kometchtech
kometchtech / conf_backup
Last active August 29, 2015 14:22
mikrotik config backup script
log info "///---->backup"
global backupfile ([/system identity get name]. ".backup")
if ([/file find name=$backupfile] != "") do={/file rem $backupfile}
delay 5s
global logMessages;
set logMessages ""
foreach i in=[/log find ] do={
set logMessages ($logMessages. [/log get $i time ]. " ");
set logMessages ($logMessages. [/log get $i message ]);
set logMessages ($logMessages. "\n") }
[Unit]
Description=Open vSwitch Internal Unit
PartOf=openvswitch-switch.service
Wants=openvswitch-switch.service
Before=networking.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/default/openvswitch-switch
@kometchtech
kometchtech / networking
Last active August 29, 2015 14:22
openvswitch conf for ubuntu 15.04
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: networking ifupdown
# Required-Start: mountkernfs $local_fs urandom
# Required-Stop: $local_fs
# Should-start: openvswitch-nonetwork.service openvswitch-switch.service
# Should-stop: openvswitch-nonetwork.service
# Default-Start: 1 2 3 4 5
# Default-Stop: 0 6
# Short-Description: Raise network interfaces.
@kometchtech
kometchtech / gist:a7deb0bf59906fd9ba87
Last active August 29, 2015 14:21
openvswitch for ubuntu 15.04
$ diff /etc/init.d/networking{,.org}
6c6
< # Default-Start: 1 2 3 4 5
---
> # Default-Start: S
$ diff /etc/init.d/libvirt-bin{,.org}
@kometchtech
kometchtech / mackerel-agent.conf
Last active March 3, 2018 14:01
mackerel.io agent for Ubuntu 15.04
# pidfile = "/var/run/mackerel-agent.pid"
# root = "/var/lib/mackerel-agent"
# verbose = false
# apikey = ""
# Configuration for connection
# [connection]
# post_metrics_dequeue_delay_seconds = 30 # delay for dequeuing from buffer queue
# post_metrics_retry_delay_seconds = 60 # delay for retring a request that causes errors
# post_metrics_retry_max = 10 # max numbers of retries for a request that causes errors
@kometchtech
kometchtech / my.cnf
Last active August 29, 2015 14:20
CentOS 6.6 x64 for zabbix 2.4.4 (MariaDB 10)
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
tmpdir = /tmp/mysqltmp
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
innodb_file_per_table=1
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 0
net.ipv6.conf.all.accept_ra = 0
net.core.somaxconn = 4096
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216