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 -*- | |
""" | |
Created on Fri Jan 17 2020 | |
@author: [email protected] | |
Connect to Cisco with telnet and run any command | |
(show startup-config by default). | |
login, password and enable password is same for all devices. | |
Ip addresses reads from json config file. |
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 -*- | |
import re | |
import sqlite3 | |
import os | |
db_filename = "dbase.db" | |
db_exists = os.path.exists(db_filename) | |
query_schema = "create table if not exists tasks(\ |
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
""" | |
Example application. | |
httpsrv - wsgi compatible class. | |
Debug internal server - wsgiref. | |
""" | |
from httpsrv import Application | |
app = Application() |
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 -*- | |
''' | |
Small wsgiref based web server. Takes a path to serve from and an | |
optional port number (defaults to 8000), then tries to serve files. | |
Mime types are guessed from the file names, 404 errors are raised | |
if the file is not found. Used for the make serve target in Doc. | |
''' | |
import sys | |
import os | |
import mimetypes |
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
# viewed in https://www.thepythoncode.com/article/download-web-page-images-python | |
# for example (be attention 18+ :) ): python image-scraper.py -o boobs -p 1000 http://oboobs.ru | |
import requests | |
import os | |
from tqdm import tqdm | |
from bs4 import BeautifulSoup as bs | |
from urllib.parse import urljoin, urlparse | |
from concurrent.futures import ThreadPoolExecutor | |
from itertools import repeat |
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
<!DOCTYPE html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Voice comments</title> | |
<style> | |
* { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
} |
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
package main | |
import ( | |
"errors" | |
"fmt" | |
"log" | |
) | |
func binsearch(data []int, item int) (int, error) { | |
start, end := 0, len(data)-1 |
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
package main | |
import "fmt" | |
func selection_sort(data *[]int) { | |
l := len(*data) | |
for i := 0; i < l; i++ { | |
min_element := i | |
for j := i + 1; j < l; j++ { | |
if (*data)[min_element] > (*data)[j] { |
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
package main | |
import "fmt" | |
func eucl_alg(width int, length int) int { | |
var min_side int | |
if width < length { | |
min_side = width | |
} else { | |
min_side = length |
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
package main | |
import "fmt" | |
func quick_sort(arr []int) []int { | |
if len(arr) < 2 { | |
return arr | |
} | |
pivot := arr[0] |