This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # get the iso | |
| wget http://releases.ubuntu.com/14.04.3/ubuntu-14.04.3-server-amd64.iso | |
| # create the image disk | |
| qemu-img create -f qcow2 disk.qcow2 10G | |
| # launch the creation | |
| virsh create ubuntu.xml | |
| # you can connect to using vnc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -x | |
| set -e | |
| IMAGE="Докер образ с centos7, rpmbuild, fpm" | |
| # Докер-образ строится примерно такой командой (возможно что-то забыто): | |
| # RUN yum install -y rpm-build ruby ruby-devel rubygems && gem install fpm && yum clean all | |
| docker run --rm -ti $IMAGE bash -c ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bufio" | |
| "database/sql" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "path/filepath" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import redis | |
| import threading | |
| class Listener(threading.Thread): | |
| def __init__(self, r, channels): | |
| threading.Thread.__init__(self) | |
| self.redis = r | |
| self.pubsub = self.redis.pubsub() | |
| self.pubsub.subscribe(channels) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| ## Tiny Syslog Server in Python. | |
| ## | |
| ## This is a tiny syslog server that is able to receive UDP based syslog | |
| ## entries on a specified port and save them to a file. | |
| ## That's it... it does nothing else... | |
| ## There are a few configuration parameters. | |
| LOG_FILE = 'youlogfile.log' |