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 csv | |
import pandas as pd | |
import sys | |
import codecs | |
import re | |
def find_column(columns, pattern): | |
for col in columns: | |
if re.search(pattern, col): | |
return col |
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 csv | |
import sys | |
import re | |
def print_csv_info(file_path): | |
try: | |
with open(file_path, 'r', encoding='utf-8-sig') as csvfile: | |
dialect = csv.Sniffer().sniff(csvfile.read(1024)) | |
csvfile.seek(0) | |
reader = csv.reader(csvfile, dialect) |
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 | |
# SPDX-FileCopyrightText: 2017-2022 SanderTheDragon <sanderthedragon@zoho.com> | |
# | |
# SPDX-License-Identifier: MIT | |
curlExists=$(command -v curl) | |
echo "Testing Postman version" |
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
blueprint: | |
name: Door activated light (at night) | |
description: Turn the light on to brightness when door is open (depending on time interval) | |
domain: automation | |
input: | |
motion_entity: | |
name: Door Sensor | |
selector: | |
entity: | |
domain: binary_sensor |
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
blueprint: | |
name: Motion activated (switches) | |
description: Turn the light on to brightness when motion is detected, depending on the selected time period, different brightness and turn-on time. | |
domain: automation | |
input: | |
motion_entity: | |
name: Motion Sensor | |
selector: | |
entity: | |
domain: binary_sensor |
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/tcsh | |
# Shell script to update namecheap.com dynamic dns | |
# from a pfsense Firewall, had to be adapted from other bash solutions | |
set DOMAIN='' | |
set PASSWORD='' | |
set HOSTNAME='' | |
set EMAIL='' | |
set CACHED_IP_FILE='./namecheap_ddns_ip.txt' |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://old.domain/path', 'http://www.new.domain') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://old.domain/path','http://www.new.domain'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://old.domain/path', 'http://www.new.domain'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://old.domain/path','http://www.new.domain'); |
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 | |
url = "http://www.buscms.com/api/REST/html/departureboard.aspx?callback=&clientid=Unilink2015&stopid=90758&format=jsonp&servicenamefilder=&cachebust=123&sourcetype=siri&refresh=true" | |
contents = urllib.request.urlopen(url).read() | |
html = contents.decode('utf-8') | |
html = html.replace('\\',"") | |
soup = BeautifulSoup(html,'html.parser') | |
rows = soup.findAll("tr", {"class": "rowServiceDeparture"}) | |
for row in rows: | |
elements = row.findAll("td", {"title": "Mayflower Halls"}) |
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
adb -d shell pm grant com.nolanlawson.logcat android.permission.READ_LOGS |
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
adb shell am force-stop com.android.phone |
NewerOlder