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:7099390
fin = open("input.xml", "r")
a = fin.readline()
l = ""
kk = False
while len(a)!=0:
a = fin.readline()
if a.find("<kernel>")!=-1 and kk==False:
p = a.find("<kernel>")
for i in range(0,p):
l+= " "
View gist:7511384
import tarfile, re
cpusage = re.compile ("sys/fs/cgroup/cpuacct/lxc/.*/cpuacct.usage$")
ainput = tarfile.open ("input.tgz","r:gz")
res_value = 0
for i in ainput:
if cpusage.search(i.name)!=None:
l = ainput.extractfile(i.name)
current = int(l.readline())
if (current > res_value):
View gist:7371644
#!/bin/bash
crsa=$(openssl rsa -noout -modulus -in input.txt | openssl md5)
ccer=$(openssl x509 -noout -modulus -in input.txt | openssl md5)
if [ "$crsa" == "$ccer" ]; then
echo "1"
else
echo "0"
fi
View gist:7371670
import subprocess
fout = open("output.txt","w")
s = subprocess.Popen (["openssl","verify","input.txt"], stdout=subprocess.PIPE)
out = s.stdout.read()
if "self signed certificate" in out:
r = 1
else:
r = 0
View gist:7371648
#!/bin/bash
check=$(openssl verify input.txt| grep "self signed certificate")
if [ -n "$check" ]; then
echo "1"
else
echo "0"
fi
View gist:7252422
import re
fr = open ("access.log", "r")
fw = open ("output.txt","w")
pipv4 = re.compile ("^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9][0-9]|[0-9])((\.25[0-5]|\.2[0-4][0-9]|\.1[0-9][0-9]|\.[0-9][0-9]|\.[0-9]){3}) ")
c = 0
l = fr.readlines()
for i in l: