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 shutil | |
import os | |
def main(): | |
for root, dirs, files in os.walk(".", topdown=False): | |
for name in files: | |
if name.endswith('.bmp'): | |
thefile = os.path.join(root, name) | |
current_dir = os.getcwd() | |
shutil.move(thefile, current_dir) |
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 urlparse | |
import urllib2 | |
import os | |
import sys | |
from bs4 import BeautifulSoup | |
import requests | |
import shutil | |
# url = raw_input("[+] Enter the URL: ") | |
url = "https://www.artic.edu/collection/more?is_public_domain=1" |
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 urlparse | |
import urllib2 | |
import os | |
import sys | |
from bs4 import BeautifulSoup | |
url = raw_input("[+] Enter the URL: ") | |
download_path = raw_input("[+] Enter the full download path: ") |
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 subprocess | |
import re | |
from optparse import OptionParser | |
def last_commit(): | |
p = subprocess.Popen(["git", "log", '-1', '--date=iso'], stdout=subprocess.PIPE) | |
out, err = p.communicate() | |
m = re.search('\d{4}-\d{2}-\d{2}\s', out) | |
return m.group(0) |
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
#!/bin/sh | |
# Convert rtsp stream to hls and write to file | |
ffmpeg -i "rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0" -c copy -hls_time 2 -hls_wrap 10 "/var/www/html/streaming.m3u8" |
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
[Unit] | |
Description=Web Client Service | |
After=multi-user.target | |
[email protected] | |
[Service] | |
Type=simple | |
# optional environment variable location which will be converted to variables readable by this file | |
# in this case $FLAGS | |
EnvironmentFile=/etc/default/webclient |
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 | |
janus_ip = '192.168.2.48' | |
msg = { | |
'janus': 'create', | |
'transaction': 'test' | |
} | |
r = requests.post('http://%s/janus' % janus_ip, json=msg) | |
d = r.json() |
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 decode from "jwt-decode" | |
import jwt from "jsonwebtoken" | |
class AuthHandlder { | |
// Get a token from the server | |
login(username, password) { | |
const data = { | |
username, | |
password, | |
} |
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 logging | |
FORMAT = "%(asctime)s:%(levelname)s:%(name)s:%(message)s" | |
datefmt = "%Y-%m-%d-%H:%M:%S" | |
log = logging.getLogger(__name__) | |
logging.basicConfig(filename="output.log", level=logging.INFO, | |
format=FORMAT, datefmt=datefmt) |
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
#include <Arduino.h> | |
#include <ArduinoJson.h> | |
void setup() | |
{ | |
Serial.begin(115200); | |
} | |
void loop(){ | |
const size_t bufferSize = JSON_OBJECT_SIZE(5); |
OlderNewer