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
Backup sql tables: | |
mysqldump asterisk endpointman_brand_list endpointman_custom_configs endpointman_global_vars endpointman_line_list endpointman_mac_list endpointman_model_list endpointman_oui_list endpointman_product_list endpointman_template_list > ossepm.sql | |
Remove endpointman | |
Upgrade Freepbx to v16 | |
Download zip from https://github.com/unex/endpointman | |
upload module, choose file, manage local, install | |
Restore sql tables: | |
mysql asterisk < ossepm.sql |
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
$apikey = "..." | |
$url = "https://..." | |
#Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | |
write-output "Install NuGet" | |
Install-PackageProvider NuGet -Force | |
if(-not (Get-Module SnipeitPS -ListAvailable)){ | |
write-output "Install SnipeitPS" | |
Install-Module SnipeitPS -Force | |
} |
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
from bs4 import BeautifulSoup | |
import urllib.request | |
import re | |
html = urllib.request.urlopen("https://www.cc.com/shows/the-daily-show-with-trevor-noah") | |
soup = BeautifulSoup(html,'html.parser') | |
for link in soup.findAll('a', text=re.compile(".*LATEST EPISODE.*")): | |
print(link.get('href')) |
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 itertools | |
cnts=[[0,0,0,25,0],[9,0,0,0,0],[0,0,32,0,0],[0,0,0,0,16],[0,0,14,0,0]] | |
def getTotal(col): | |
return cnts[0][col]+cnts[1][col]+cnts[2][col]+cnts[3][col]+cnts[4][col] | |
for r0 in itertools.permutations([17,21,8,29],4): | |
for r1 in itertools.permutations([30,26,13]): | |
for r2a in itertools.permutations([15,11]): |
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
# join.py | |
# CC-0 | |
# usage: python3 join.py filename | |
# all files that start with filename in the current dir will be found, sorted, and joined together with ffmpeg | |
# mp4 assumed | |
import os, glob, sys, subprocess | |
name = sys.argv[1] | |
print(name) | |
fileList = glob.glob(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
# See https://www.youtube.com/watch?v=L8egrL-WC-0 | |
import microbit | |
def pick_speed(speed): | |
while not microbit.button_b.is_pressed(): | |
microbit.display.show(str(speed)) | |
if microbit.button_a.is_pressed(): | |
speed -= 1 | |
if speed < 1: speed = 9 | |
microbit.sleep(200) |
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 microbit, random | |
# from Python 3 source | |
def shuffle(x): | |
for i in reversed(range(1, len(x))): | |
# pick an element in x[:i+1] with which to exchange x[i] | |
j = int(random.random() * (i+1)) | |
x[i], x[j] = x[j], x[i] | |
# correct viewport onto maze so the whole screen is always used |
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 microbit, random | |
# blank grid to start | |
gridImg = microbit.Image("00000\n" | |
"00000\n" | |
"00000\n" | |
"00000\n" | |
"00000\n") | |
def get_grid(): | |
return [[microbit.display.get_pixel(x,y) for y in range(5)] for x in range(5)] |
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 microbit, random | |
# background oxo grid at brightness 1 | |
gridImg = microbit.Image("00000\n" | |
"00000\n" | |
"00000\n" | |
"00000\n" | |
"00000\n") | |
# returns False is a square is blank | |
def check_squares_filled(): |
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
# put this file, and ffmpeg.exe in a folder, drop videos onto this file | |
# a version called filename-rotatedcounterclockwise.ext will be saved | |
# in the same folder as the original | |
import sys | |
import subprocess | |
import os | |
from pathlib import Path | |
i = sys.argv[1] | |
#print(i) |
NewerOlder