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
# Importing the json module to be able to work with json data more easily. | |
import json | |
# Importing "Request" and "urlopen" from urllib.request module to be able | |
# to make a remote call to fetch the remote json data. | |
from urllib.request import Request, urlopen | |
# Build the request that will later be made to remote server. | |
# In this case, the server is a fake json data service. | |
# Using the "GET" method here because we are fetching data from remote |
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
<html> | |
<head> | |
<title>Example</title> | |
</head> | |
<body> | |
What is your favorite season? | |
<input type="radio" id="answer_1a" name="answer_1" value="Fall" /> | |
<label for="answer_1a">Fall</label> | |
<input type="radio" id="answer_1b" name="answer_1" value="Winter" /> | |
<label for="answer_1b">Winter</label> |
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
<html> | |
<head> | |
<title>Example</title> | |
</head> | |
<body> | |
Question: <input id="question" /><br><br> | |
<button onclick="getAnswer()">Get Answer</button><br><br> | |
Answer: <textarea id="answer"></textarea><br><br> | |
<script> | |
function getAnswer() { |
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
To fix the following error: | |
<<< TLS 1.2 Alert [length 0002], fatal unknown_ca | |
02 30 | |
SSL3 alert read:fatal:unknown CA | |
SSL_connect:error in SSLv3 write certificate verify A | |
write:errno=104 | |
DigiCert: | |
1. Download certifcate files (PEM format) |
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
/usr/local/lib/python3.5/site-packages/requests/cacert.pem | |
Traceback (most recent call last): | |
File "test.py", line 24, in <module> | |
ssl_keyfile = '/home/summersan/kafka-ssl/nocrypt-key.pem') | |
File "/usr/local/lib/python3.5/site-packages/kafka/producer/kafka.py", line 334, in __init__ | |
**self.config) | |
File "/usr/local/lib/python3.5/site-packages/kafka/client_async.py", line 199, in __init__ | |
self._bootstrap(collect_hosts(self.config['bootstrap_servers'])) | |
File "/usr/local/lib/python3.5/site-packages/kafka/client_async.py", line 229, in _bootstrap | |
bootstrap.connect() |
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
<# | |
zip-files | |
========= | |
Gather a list of text files in a directory | |
and archive the files in a .zip file. | |
#> | |
$zipfile_folder = "files-for-backup" | |
$zipfile = "${zipfile_folder}.zip" |
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
<# | |
txt2html | |
======== | |
Gather a list of text files in a directory | |
and convert the text files to html files. | |
#> | |
$list = ls *.txt | |
foreach ($item in $list) { | |
$filename = $item.name | |
$new_filename = $filename + ".html" |