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
local sampleSpringBootAppDeployment = import "samplespringbootapp-deployment.jsonnet.template"; | |
sampleSpringBootAppDeployment.samplespringbootapp() |
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
#!/bin/bash | |
# define our new port number | |
API_PORT=8080 | |
# update kube-apiserver args with the new port | |
# tell other services about the new port | |
sudo find /var/snap/microk8s/current/args -type f -exec sed -i "s/8080/$API_PORT/g" {} ';' | |
# create new, updated copies of our kubeconfig for kubelet and kubectl to use | |
mkdir -p ~/.kube && microk8s.config -l | sed "s/:8080/:$API_PORT/" | sudo tee /var/snap/microk8s/current/kubelet.config > ~/.kube/microk8s.config |
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
apiVersion: networking.k8s.io/v1beta1 | |
kind: Ingress | |
metadata: | |
name: kibana-ingress | |
annotations: | |
kubernetes.io/ingress.class: nginx | |
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" | |
nginx.ingress.kubernetes.io/secure-backends: "true" | |
nginx.ingress.kubernetes.io/ssl-redirect: "false" | |
nginx.ingress.kubernetes.io/rewrite-target: /$1 |
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
#First install beautiful soup. Example | |
# pip3 install beautifulsoup4 | |
import requests | |
from bs4 import BeautifulSoup | |
url = 'https://azure.microsoft.com/en-gb/services/' | |
response = requests.get(url) | |
soup = BeautifulSoup(response.text, "html.parser") | |
for service in soup.find_all("div", class_="column medium-6 end"): |
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
import com.fasterxml.jackson.databind.ObjectMapper; | |
import java.io.File; | |
import java.sql.*; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class DatabaseToJson { | |
private static final String DB_URL = "jdbc:mysql://localhost:3306/mydatabase"; |
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
import java.io.FileWriter; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import org.json.simple.JSONArray; | |
import org.json.simple.JSONObject; |
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
import java.io.BufferedWriter; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.io.Writer; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.util.concurrent.ExecutorService; |
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
import java.io.BufferedWriter; | |
import java.io.FileWriter; | |
import java.sql.*; | |
import org.json.*; | |
public class DatabaseToJson { | |
private static final String DB_URL = "jdbc:mysql://localhost/mydatabase"; | |
private static final String DB_USER = "myusername"; | |
private static final String DB_PASSWORD = "mypassword"; | |
private static final int FETCH_SIZE = 1000; |
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
import java.io.BufferedWriter; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.sql.*; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class DatabaseToJson { | |
private static final int PAGE_SIZE = 10000; | |
private static final String DB_URL = "jdbc:mysql://localhost:3306/mydatabase"; |
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
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import java.io.BufferedWriter; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStreamWriter; | |
import java.sql.*; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; |