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 <[email protected]> | |
# | |
# 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 |
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
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-ipv6 | |
'./configure' '--prefix=/usr/local/php' '--enable-inline-optimization' '--disable-debug' '--disable-libgcc' '--disable-libtool-lock' '--disable-cgi' '--enable-safe-mode' '--with-libxml-dir' '--enable-dom' '--enable-libxml' '--with-bz2=shared' '--enable-calendar' '--with-zlib-dir=shared' '--with-ttf' '--with-freetype-dir' '--with-mysql=mysqlnd' '--with-mysql-sock' '--with-zlib-dir' '--enable-sockets' '--enable-zip' '--with-pear' '--enable-session' '--with-zend-vm=CALL' '--enable-mbstring' '--with-regex' '--with-openssl' '--with-expat-dir' '--with-pcre-regex' '--enable-xml' '--enable-ctype' '--enable-json' '--enable-pdo' '--with-curl' '--with-pdo-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-gd' '--with-jpeg-dir' '--with-vpx-dir' '--with-xpm-dir=/usr' '--enable-opcache' --enable-fpm |
NewerOlder