Skip to content

Instantly share code, notes, and snippets.

View parj's full-sized avatar
💭
I may be slow to respond.

Parjanya Mudunuri parj

💭
I may be slow to respond.
View GitHub Profile
@parj
parj / samplespringbootapp.jsonnet
Created October 26, 2019 05:28
Sample boot jsonnet
local sampleSpringBootAppDeployment = import "samplespringbootapp-deployment.jsonnet.template";
sampleSpringBootAppDeployment.samplespringbootapp()
#!/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
@parj
parj / ingress.yaml
Created May 15, 2020 18:34
Kibana ingress configuration on local kubernetes cluster
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
@parj
parj / scrape_azure_services.py
Created January 2, 2022 17:05
Scrape list of azure services
#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"):
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";
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;
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;
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;
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";
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;