Skip to content

Instantly share code, notes, and snippets.

View click0's full-sized avatar

Vladyslav V. Prodan click0

View GitHub Profile
@click0
click0 / cbsdd
Created May 7, 2019 21:35
fix log warning
--- cbsdd.orig 2019-05-07 01:58:50.410050000 +0300
+++ cbsdd 2019-05-07 02:01:56.420224000 +0300
@@ -6,6 +6,12 @@
CBSDMODULE="taskd"
EXTHELP="wf_taskd.html"
+file_log=/var/log/cbsd/cbsd.log
+
+log123() {
+ echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $@" >> ${file_log}
@click0
click0 / install_factorio.sh
Created January 30, 2019 07:38
# Install Factorio server in Debian 8.x-9.x
#!/bin/sh
# Install Factorio server in Debian 8.x-9.x
apt-key update; apt-get update && apt-get -y install lsb-release ca-certificates
[ ! -d /opt ] && mkdir -p /opt;
cd '/opt'
apt-get -y install git mc screen
git clone https://github.com/Bisa/factorio-init.git
#!/usr/bin/env sh
set -e
#set -x
# ask user for password
read -p "Input password for check: " -t 30 passwd
# sha1sum replaced openssl sha1 | awk '{ print $2;}'
@click0
click0 / random-ipv6-address-generator.15.sh
Created June 8, 2011 11:36
random generator ipv6 address
#!/bin/sh
# Copyright Andrey Mitrofanov
# Copyright pavlinux http://pavlinux.ru
# 2011
MAXCOUNT=20
count=0
network_v6=2a01:7a0:2:12 # your ipv6 network prefix
@click0
click0 / zfs_start_transfer_backup.sh
Created May 13, 2011 20:37
Backup method of incremental transfer ZFS partitions from one pool to another within a single machine
#!/bin/sh
#The initial creation of ZFS partition for further incremental copying
pool=zroot #source distination
pool2=tank #recipient pool
volume2=$pool2/backup/$pool #recipient
fs_list='/mysql /usr /usr/ports /usr/src /usr/home /tmp /var /var/crash /var/db /var/db/pkg
/var/empty /var/imap /var/imap-cache /var/log /var/mail /var/run /var/tmp'"
"`zfs list | grep ^zroot/www | awk ' {print $5}' | tr "\r\n" " "`
@click0
click0 / incremental-backup.sh
Created April 24, 2011 18:01
Резервное копирование файлов, измененных с такой-то даты
echo "date +'%F %R:%S'" > /root/VPSbackups/last.timestamp.backup
tar czvf /root/VPSbackups/VPSbackup.tar.gz -N"$LAST" --exclude-from=/VPSbackups/tar.excludelist.txt /etc/ /root/exportdb/ /home/username/ > /root/VPSbackups/backup.log 2>&1
##где tar.excludelist.txt - список исключений;
##а LAST - файл с датой в формате date +'%F %R:%S'
LAST=`cat /root/VPSbackups/last.timestamp.backup`
#!/bin/sh
#
# zfs snapshot auto-rotation
#
# usage: zfs_snapshot.sh <mountpoint> <snapshot name> <number of keeping snapshots> [recursive]
#
# recursive option: Recursively create snapshot (zfs snapshot -r)
#
# for crontab
#