Skip to content

Instantly share code, notes, and snippets.

View akhilman's full-sized avatar
☮️
Peace and Love

AkhIL akhilman

☮️
Peace and Love
View GitHub Profile
@akhilman
akhilman / ssh proxy
Last active April 17, 2018 15:20
ssh proxy с ограниченным дооступом
создаем пользователя pxy
adduser pxy
закрываем ему доступ к locahost, eth0 заменить на интерфейс смотрящий в интернет
iptables -A OUTPUT -m owner --uid pxy -p tcp -o lo --dport 53 -j ACCEPT # allow dns
iptables -A OUTPUT -m owner --uid pxy -o !eth0 -j DROP # deny localhost
ip6tables -A OUTPUT -m owner --uid pxy -p tcp -o lo --dport 53 -j ACCEPT # allow dns
ip6tables -A OUTPUT -m owner --uid pxy -o !eth0 -j DROP # deny localhost
генерируем ssh ключи, добавляем публичный ключь в ~pxy/.ssh/authorized_keys вставив перед ним:
@akhilman
akhilman / controller.py
Created July 21, 2016 19:04
Controller that creates window
class TKViewController(CementBaseController):
class Meta:
label = "tkview"
stacked_on = 'base'
stacked_type = 'nested'
arguments = [
(['dataset'],
dict(help='dataset to show',
action='store', metavar='DATASET', nargs='?')
@akhilman
akhilman / window.py
Created July 21, 2016 18:50
Tk main window with cement framework
import tkinter as tk
from . import darktheme
class MainWindow(tk.Tk):
def __init__(self):
super().__init__()