This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| # Нанян Саркис АК5-81 | |
| # Вариант 11, 5 субъектов 3 объекта | |
| # Функция вывода списка файлов с правами | |
| def sprint(sb,objects,ss=-1): | |
| print "\nСписок файлов для пользователя %s: " % subjects[sb] | |
| si = 0 | |
| while si<3: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/expect | |
| spawn mount.davfs https://webdav.yandex.ru/RPI /home/sarkisn/webdav/yandex | |
| expect "Username:" | |
| send "[email protected]\r" | |
| expect "Password:" | |
| send "PASSWORD\r" | |
| expect eof | |
| #sudo apt-get install expect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import urllib2 | |
| def internet_on(): | |
| try: | |
| response=urllib2.urlopen('http://74.125.228.100',timeout=1) | |
| return True | |
| except urllib2.URLError as err: pass | |
| return False | |
| print internet_on() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import smtplib | |
| import sys | |
| from email.mime.text import MIMEText | |
| def mail(motion,smoke): | |
| me = '[email protected]' | |
| you = ['[email protected]', '[email protected]','[email protected]'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <nav class="navbar navbar-default" role="navigation"> | |
| <div class="container"> | |
| <div class="navbar-header"> | |
| <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> | |
| <span class="icon-bar"></span> | |
| <span class="icon-bar"></span> | |
| <span class="icon-bar"></span> | |
| </button> | |
| <a class="navbar-brand" href="{{ root_url }}/">{{ site.title }}</a> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| check=$(openssl verify input.txt| grep "self signed certificate") | |
| if [ -n "$check" ]; then | |
| echo "1" | |
| else | |
| echo "0" | |
| fi | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: |