Skip to content

Instantly share code, notes, and snippets.

@rkhozinov
rkhozinov / cs
Created December 14, 2017 11:27
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using student;
namespace program
{
class Program
@rkhozinov
rkhozinov / keybase.md
Created November 21, 2017 11:49
keybase.md

Keybase proof

I hereby claim:

  • I am rkhozinov on github.
  • I am rkhozinov (https://keybase.io/rkhozinov) on keybase.
  • I have a public key ASA8GzcxmLAwgApBsclo9moXxA5O9lPovyGriePIsSBEaAo

To claim this, I am signing this object:

@rkhozinov
rkhozinov / card_number_splitter.py
Created October 11, 2017 13:18
use card number without delimiters as an argument
from sys import stdout, argv
if len(argv) <=1:
exit(1)
for i in range(len(argv[1])):
if (i % 4 == 0):
stdout.write('\t')
stdout.write(argv[1][i])
stdout.write('\n')
@rkhozinov
rkhozinov / vyos_sample_site-2-site_vpn.sh
Created May 16, 2017 08:04 — forked from RafPe/vyos_sample_site-2-site_vpn.sh
Vyos sample site-to-site vpn configuration
# Virtual Tunnel Interface
# 172.196.17.188 - 172.196.17.191
set interfaces vti vti0 address 172.196.17.190/30
set interfaces vti vti0 description 'Virtual tunnel interface for VPN tunnel'
# Phase 2
set vpn ipsec esp-group ESP-Default compression 'disable'
set vpn ipsec esp-group ESP-Default lifetime '3600'
set vpn ipsec esp-group ESP-Default mode 'tunnel'
set vpn ipsec esp-group ESP-Default pfs 'dh-group16'
@rkhozinov
rkhozinov / vyos-optimisations
Created May 16, 2017 08:03 — forked from RafPe/vyos-optimisations
vyos throughput optimizations
Server 2 sockets,6 cores each, 2.4ghz
# Set ixgbe options
# Limit RSS queues to the number of physical cores per cpu
# Disable offload
# When you change this, you need to run the command and reboot for it to take.
echo "options ixgbe LRO=0,0 MQ=1,1 RSS=6,6 VMDQ=0,0 vxlan_rx=0,0" > /etc/modprobe.d/ixgbe.conf
# Shut down HT cores
for i in $(seq 1 2 23); do
#include<stdio.h>
#include<stdlib.h>
#include<locale.h>
#include<string.h>
#include<windows.h>
void insertion_sort(int *a,int t) //сортировка вставками
{
int i,j,temp;
for (i=1;i<t;i++)
@rkhozinov
rkhozinov / ansible.cfg
Created May 3, 2017 14:43 — forked from krigar/ansible.cfg
Bastion Playbook
[ssh_connection]
ssh_args = -F ssh.cfg
control_path = ~/.ssh/mux-%r@%h:%p
@rkhozinov
rkhozinov / customization.md
Created April 27, 2017 14:57 — forked from j3tm0t0/customization.md
VyOS EC2 customization

VyOS AMI Customization

rl-system.init

comment-out followings

  • update_interface_config
    to prevent new interface is added when stop/start instance in EC2 classic or create imaage with existing interface

  • add_new_serial_if || log_failure_msg "can't add serial interfaces"
    no serial interface in EC2

vyatta-postconfig-bootup.script

@rkhozinov
rkhozinov / tutorial.md
Created April 21, 2017 07:22 — forked from winhamwr/tutorial.md
Creating a repeatable, dynamic site to site VPN with OpenSwan on Ubuntu 10.04 from Amazon EC2

Creating a dynamic site-to-site VPN with OpenSwan on Ubuntu 10.04 on EC2

Wes Winham [email protected]

There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.

# Glusterfs library: http://libgfapi-python.readthedocs.io/en/latest/
# Glusterfs library Volume API: http://libgfapi-python.readthedocs.io/en/latest/api-reference.html#volume-class
# Docker library: https://docker-py.readthedocs.io/en/stable/
# Testinfra docs: http://testinfra.readthedocs.io/en/latest/
# Pytest docs: https://docs.pytest.org/en/latest/example/simple.html
# Run pytest from python: https://docs.pytest.org/en/latest/usage.html#calling-pytest-from-python-code
# Pytest logging: http://pythontesting.net/framework/pytest/pytest-logging-real-time/
import testinfra
import pytest