Updated: 9 april 2020
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 selenium import webdriver | |
from tabulate import tabulate | |
# setting up driver and loading URL | |
driver = webdriver.Chrome('path/to/chromedriver') | |
driver.get('https://www.worldometers.info/coronavirus/') | |
Country_name = input('Enter Country Name: ') # asking user for country | |
# getting table out |
-
Show all users in the mysql database:
MariaDB [(none)]> select * from mysql.user;
-
Delete a null user:
Some of these can be tied together using a common credential object, but I seem to have trouble with the SharePoint Online connection using the -Credential parameter (pukes up the "the DTD is prohibited" error).
$creds = Get-Credential -Message "Cloud Credentials" -UserName "you@contoso.com"
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
# Delete Running pods | |
for pod in $(oc get pods | grep Running | awk '{print $1}'); do oc delete pod ${pod} --grace-period=1;done | |
# Delete Secrets | |
for secret in $(oc get secrets | awk '{if (NR!=1){print $1}}'); do oc delete secret ${secret};done |
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
Complete credit to http://Learn.SharjeelSayed.com //copied for myself. | |
Curated Self Study Guide for Computer Science and DevOps/SRE/SysAdmin | |
https://github.com/docker-training/orchestration-workshop | |
An always updated copy of this document can be found at http://Learn.SharjeelSayed.com | |
Fork this at https://github.com/SharjeelSayed/SharjeelSayed.github.io | |
Reach me at http://SharjeelSayed.com |
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 org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import org.openqa.selenium.chrome.ChromeOptions; | |
public class ChromeDriverTest { | |
// Configuration (CHANGE IT!): | |
private static final String ChromeDriverPath = "/Users/marcinf/bin/chromedriver/2.35/chromedriver"; // https://chromedriver.storage.googleapis.com/2.35/chromedriver_mac64.zip | |
private static final String ChromePath = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"; |
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 registry.access.redhat.com/ubi8/ubi-minimal:latest | |
USER root | |
RUN microdnf install tar gzip && \ | |
cd /tmp && \ | |
curl -SL -o client.tar.gz https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz && \ | |
tar --strip-components 1 -C /bin -xzf client.tar.gz openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc |
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
# This Python script connects to a PostgreSQL database and utilizes Pandas to obtain data and create a data frame | |
# A initialization and configuration file is used to protect the author's login credentials | |
import psycopg2 | |
import pandas as pd | |
# Import the 'config' funtion from the config.py file | |
from config import config | |
# Establish a connection to the database by creating a cursor object |
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
# This file was adapted from http://www.postgresqltutorial.com/postgresql-python/connect/ | |
# The following config() function reads in the database.ini file and returns the connection | |
# parameters as a dictionary. This function will be imported in to the main python script: | |
#!/usr/bin/python | |
from configparser import ConfigParser | |
def config(filename='database.ini', section='postgresql'): | |
# create a parser |