Skip to content

Instantly share code, notes, and snippets.

View mmanylov-zz's full-sized avatar

Maxim Manylov mmanylov-zz

View GitHub Profile
# нужно поставить kubectl и kuebectx+kubens
kubectl get pod # Получить поды из текущего нейспейса
kubectl get pod -n <namespace > # Получить под из заданного неймспейса
kubectl exec -it {pod_name} bash # зайти внутрь контейнера с башем
kubectl logs {pod_name} # логи пода
@mmanylov-zz
mmanylov-zz / multiple_ssh_setting.md
Created August 22, 2021 17:09 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@mmanylov-zz
mmanylov-zz / README.md
Created March 31, 2021 17:45 — forked from djfdyuruiry/README.md
WSL 2 - Enabling systemd

Enable systemd in WSL 2

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

    cd /tmp
@mmanylov-zz
mmanylov-zz / wsl2-network.ps1
Created March 18, 2021 10:32 — forked from xmeng1/wsl2-network.ps1
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
@mmanylov-zz
mmanylov-zz / portainer.md
Created March 18, 2021 08:15 — forked from SeanSobey/portainer.md
Portainer Setup on Windows 10

Portainer on Windows 10

Here I have 2 methods for running portainer on windows, a quick, preferred method only requiring a fairly recent version of docker, or a more complicated method to try if that does not work.

Using host.docker.internal

This setup will let you run Portainer on windows by using the host.docker.internal (docker.for.win.localhost is depricated) endpoint.

Please note:

import click
@click.group()
def greet():
pass
@greet.command()
import click
@click.group()
def greet():
pass
@greet.command()
def hello(**kwargs):
@mmanylov-zz
mmanylov-zz / main.py
Created August 5, 2020 07:30
Utilization of multiprocessing in processing large log files
# see https://www.blopig.com/blog/2016/08/processing-large-files-using-python/
import multiprocessing as mp
import os
import re
from datetime import datetime, timedelta
RESULT_FILENAME = 'result.csv'
FILENAME_TEMPLATE ='log-{date}'
CHUNK_SIZE = 1024*1024
log_pattern = re.compile(r'^SEVERITY.*(?<=first param in quotes\s")(.*)(?=").*(?<=second param\s)(\w+).*?(third param)?$')
import secrets
import string
length = 0
while(length < 1):
length = int(input("Input pass length: "))
alphabet = string.ascii_letters + string.digits
password = ''.join(secrets.choice(alphabet) for i in range(length)) # for a 20-character password
print(password)
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
var header = require('gulp-header');
var cleanCSS = require('gulp-clean-css');
var rename = require("gulp-rename");
var uglify = require('gulp-uglify');
var pkg = require('./package.json');