This file contains 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
// ==UserScript== | |
// @name TooltipRemover | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-01-17 | |
// @description Removing all simple (title) tooltips | |
// @author Albert KhorAMus Khoroshun | |
// @match *://*/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// ==/UserScript== |
This file contains 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
+-----------------------------------------------------------------------------------+ | |
| *** Exercises *** | | |
+-----------------------------------------------------------------------------------+ | |
| Assuming this table: | | |
| | | |
| CREATE TABLE employee ( | | |
| emp_id INTEGER PRIMARY KEY, | | |
| emp_name VARCHAR(30) | | |
| } | | |
| | |
This file contains 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
1-ЫЙ ЗАПРОС | |
Исходный код: | |
from webob import Request, Response | |
environ = { | |
"SERVER_NAME": "httpbin.org", | |
"SERVER_PORT": "80", | |
"PATH_INFO": '/ip', | |
'REQUEST_METHOD': "GET", | |
'SCRIPT_NAME': '', |
This file contains 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
В 17-ой строке мы вставляем в ответ кодировку, иначе при обращении к полю text объекта Response | |
выбросится ошибка: AttributeError: You cannot access Response.text unless charset is set. Обращение к нему происходит в функции print. |
This file contains 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 requests | |
payload = { | |
"github": "MyNickName", | |
"Name": "MyName", | |
"Surname": "MySurname" | |
} | |
resp = requests.post('http://httpbin.org/post', | |
headers={ |
This file contains 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
Сперва проделаем все запросы с помощью библиотеки socket языка python 3.4.4 | |
1 запрос-ответ | |
import socket | |
message_to_send = b'''GET /ip HTTP/1.1 | |
Host: httpbin.org | |
Accept: */* | |
This file contains 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
Отправляем запрос с использованием python 3.4.4 и библиотеки socket | |
Исходный код программы: | |
import socket | |
message_to_send = b'''GET /news/ HTTP/1.1 | |
Host: www.e1.ru | |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9b5) Gecko/2008050509Firefox/3.0b5 | |
Accept: text/html | |
Connection: close |
This file contains 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
1 запрос/ответ | |
telnet httpbin.org 80 | |
Trying 54.175.219.8... | |
Connected to httpbin.org. | |
Escape character is '^]'. | |
GET /ip HTTP/1.1 | |
Host: httpbin.org | |
Accept: */* |
This file contains 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
khoramus@khoramus-VirtualBox:~$ telnet e1.ru 80 | |
Trying 212.193.163.6... | |
Connected to e1.ru. | |
Escape character is '^]'. | |
GET /news HTTP/1.1 | |
Host: e1.ru | |
User-Agent: Mozilla/5.0 (x11; U; Linux i686; ru;rv:1.9b5)G | |
Firefox/3.0b5 | |
Accept: text/html | |
Connection: close |