Skip to content

Instantly share code, notes, and snippets.

Avatar

Sarkis Nanyan spellanser

View GitHub Profile
@spellanser
spellanser / Makefile
Created Apr 18, 2019 — forked from moloch--/Makefile
Basic cross-platform reverse shell in Go
View Makefile
EXE = shell
SRC = .
LDFLAGS = -ldflags="-s -w"
windows:
GOOS=windows go build -o $(EXE)_win.exe $(LDFLAGS) $(SRC)
macos:
GOOS=darwin go build -o $(EXE)_macos $(LDFLAGS) $(SRC)
View vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/vundle'
Plugin 'mileszs/ack.vim'
Plugin 'avakhov/vim-yaml'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
View join_csv.py
import csv
from collections import OrderedDict
with open('b.csv', 'rb') as f:
r = csv.reader(f)
dict2 = {row[0]: row[1:] for row in r}
with open('a.csv', 'rb') as f:
r = csv.reader(f)
dict1 = OrderedDict((row[0], row[1:]) for row in r)
View bjd.md

Часть 1 - Анализ негативных факторов на рабочем месте инженера исследователя

Документация (ссылки вида док. №):

  1. СанПин 2.2.2/2.4.1340-03 - нормы
  2. микроклимат: СанПин 2.2.4.548-96
  3. МУК 4.1.900-00 - требоваия к пластмассам
  4. ГН 2.1.6.1338-03 - ПДК
  5. ГН 2.1.6.1339-03 - ОБУВ
  6. ПУЭ-2007
View gist:01011fa9a88f8cb97998
#!/bin/bash
if [ -z "$1" ] ; then
echo "Usage: command interface "
else
sudo tcpdump -nn -v -i $1 -s 1500 -c 1 'ether[20:2] == 0x2000' | grep -E 'Device-ID|Port-ID'
fi
View gist:d8e549cab8140f5d1832
# -*- coding: utf-8 -*-
# Вариант 10. Нанян Саркис АК5-101
from math import exp
M = 25
Hf = 0.1
Gw_1 = 1
Gw_2 = 3
def st (e1,e2,d1,d2):
st = e1 * (M ** d1) + e2 * Hf * (M ** d2)
View gist:464fbb713af71c1b772d
PS1='\[\e[0;31m\]\u@\[\e[1;35m\]\h\[\e[m\] \[\e[1;36m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[m\]\[\e[0;37m\]'
View gist:c5ba18d4cdb046eee4ce
function pretty(input) {
return JSON.stringify(input, null, '\t');
}
function pp(input) {
console.log(pretty(input));
}
function output(input) {
$('.output').append('<p>' + input + '</p>');
View lab3_part2.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import copy
import sys
from pprint import pprint
max = 16
graf = {1: {4: 3, 'v': 1}, 2: {5: 1, 'v': 3}, 3: {13: 3, 'v': 2},
View lab3.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import copy
import sys
from pprint import pprint
#max = 16
m = 23