Skip to content

Instantly share code, notes, and snippets.

View xeron's full-sized avatar

Ivan Larionov xeron

View GitHub Profile
@xeron
xeron / mpdas.service
Created July 15, 2020 05:26
mpdas systemd unit
[Unit]
Description=Last.fm scrobbler for MPD
After=multi-user.target
[Service]
Type=forking
ExecStart=/usr/bin/mpdas -c /etc/mpdasrc -d
[Install]
WantedBy=multi-user.target
@xeron
xeron / .bashrc
Last active July 14, 2016 03:39
bashrc for git
# ~/.bashrc: executed by bash(1) for non-login shells.
## Exports
# Common
HISTFILESIZE=1000000000
HISTSIZE=10000000
# HISTCONTROL=ignoreboth:erasedups
HISTCONTROL=ignorespace:erasedups
## Colors
@xeron
xeron / Preferences.sublime-settings.json
Last active March 5, 2016 06:32
Sublime Text 3 Material Theme w/ Appbar and Tomorrow Dark syntax theme
{
"bold_folder_labels": true,
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"fallback_encoding": "Cyrillic (Windows 1251)",
"font_face": "Monaco",
"font_options":
[
"gray_antialias"
],
"font_size": 12,
@xeron
xeron / zabbix.conf
Last active March 5, 2016 01:27
nginx php-fpm zabbix
server {
listen 80;
server_name zabbix.lan;
access_log /opt/brew/var/log/nginx/zabbix_access.log;
error_log /opt/brew/var/log/nginx/zabbix_error.log;
root /Users/xeron/workspace/devel/zabbix/frontends/php;
index index.php index.html index.htm;
ASRock H97M PRO4 (mATX DDR3 LGA 1150 Motherboard)
Intel Core i7-4790K 4.0 GHz LGA 1150 (BX80646I74790K)
Crucial 16GB Kit DDR3 1600 MT/s PC3-12800 CL11 Desktop Memory (CT2KIT102464BA160B)
Noctua CPU Cooler NH-U12P SE2
EVGA GTX 1080 Ti SC2 Graphics Card
Cooler Master V550 - Compact 550W 80 PLUS Gold Modular PSU
Fractal Design Define Mini System Cabinet Mini Tower Black
OLD REPLACED PARTS:
@xeron
xeron / bitrix_authorization.rb
Created January 6, 2012 22:06 — forked from dapi/bitrix_authorization.rb
1С-Битрикс авторизация на рельсах (ruby on rails)
# Расширение контроллера
#
module Bitrix::Authorization
def current_user
@current_user ||= find_from_cookie
end
def login_user(user)
logout_user if current_user
@current_user = user
@xeron
xeron / haproxy.cnf
Created September 21, 2011 16:50 — forked from asabirov/haproxy.cnf
haproxy.cnf
global
log 127.0.0.1 local0
log 127.0.0.1 local0 notice
maxconn 4096
nbproc 1
pidfile /var/run/haproxy.pid
user haproxy
group haproxy
#!/bin/sh
today=`date +%Y_%m_%d`
backdir=$HOME/mysql/$today
mkdir -p $backdir
for i in `echo "show databases" | mysql -uUser -pPassword | sed 1d`; do
mysqldump -uUser -pPassword $i | gzip > $backdir/$i.sql.gz;
done;
#!/bin/bash
USER=backups
REMOTE_SERVER=example.com
PORT=22
BACKUP_DIR=/home/backups
echo "rsync -a -r --delete $BACKUP_DIR/current/ $BACKUP_DIR/old" | ssh $USER@$REMOTE_SERVER
rsync -a -r --delete --rsh "ssh -p$PORT" /home/webmaster $USER@$REMOTE_SERVER:$BACKUP_DIR/current/
require 'rubygems'
require 'open-uri'
require 'nokogiri'
require 'iconv'
def download(url)
`wget -c --content-disposition http://slil.ru/#{url}`
end
if ARGV.length == 0 || ARGV[0].empty?