Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

dotsky sathishjayapal

🎯
Focusing
View GitHub Profile
@sathishjayapal
sathishjayapal / ParseFile.java
Last active February 26, 2023 00:03
Boiler plate for Parsing filr
View ParseFile.java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
class Scratch {
private static final Logger logger = LoggerFactory.getLogger(Scratch.class);
@sathishjayapal
sathishjayapal / dockerissue-md
Last active February 8, 2023 04:07
Docker startup issues -mac
View dockerissue-md
* With the mac OS Monterey, there is an issue when Docker startup from a startup, which is not a one-off issue for me. With the latest docker desktop, when Docker tries to startup, this is the error that I get.
Creating "rootNode" subnodes: constructing "BackendServices" in "rootNode": doing migrations: migrating daemon.json: invalid character '{' after top-level value
* There was no specific issue/answer I could get from the community, so I looked up the daemon.json file, and there that led me to this folder in my machine, /Users/<mymacid>/Library/Group Containers/group.com.docker.
* To start the daemon, I deleted the folder
* Restart the Docker desktop.
Things are working well. Hopefully, this gist helps.
@sathishjayapal
sathishjayapal / multiple-providers-sample
Created October 6, 2022 02:02
sample for multiple providers template
View multiple-providers-sample
terraform {
#Required Terraform version
required_version = "~>1.3.1"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=3.0, <=3.24.0"
}
}
View gist:a647d51eb810319722aaf4204ccba0f3
azure
account
list [options] #List the imported subscriptions
show [options] [subscriptionNameOrId] #Show details about a subscription
set [options] <subscriptionNameOrId> #Set the current subscription
clear [options] #Remove a subscription or environment, or clear all of the stored account and environment info
import [options] <file> #Import a publishsettings file or certificate for your account
download [options] #Launch a browser to download your publishsettings file
env... #Commands to manage your account environment
View some204notes.md

AZ- Service principal commands

Loging with service principal credentials. Remember the tenant parameter

az login --service-principal -u -p --tenant

List the role definitions - List all the role definitions

az role definition list --all

List the role assignments - Lists all the role assignments

az role assignment list --all

You can find the same information by running the following command in the Cloud Shell. They are listed in the Additional Outbound IP Addresses field.

az webapp show \

@sathishjayapal
sathishjayapal / Main.java
Created March 24, 2022 04:11
Java 18 JSON String
View Main.java
package me.sathish;
public class Main {
public static void main(String[] args) {
String simpleJSONData = """
{
"fullName": "%s",
"aadress": "%s",
"title": "%s"
View CSVFileParserCDKInterface.java
package me.sathish.aws.common;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awscdk.core.Tags;
import software.amazon.awscdk.services.s3.Bucket;
import java.io.IOException;
import java.io.InputStream;
import java.time.LocalDateTime;
@sathishjayapal
sathishjayapal / Secondfile.txt
Created August 28, 2021 04:57
Secondfile.txt
View Secondfile.txt
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE log SYSTEM "logger.dtd">
<log>
<record>
<date>2021-08-28T04:37:53.555130Z</date>
<millis>1630125473555</millis>
<nanos>130000</nanos>
<sequence>3</sequence>
<logger>me.sathish.package</logger>
<level>SEVERE</level>
View mylog.txt
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE log SYSTEM "logger.dtd">
<log>
<record>
<date>2021-08-28T04:37:27.363135Z</date>
<millis>1630125447363</millis>
<nanos>135000</nanos>
<sequence>0</sequence>
<logger>me.sathish.package</logger>
<level>SEVERE</level>
@sathishjayapal
sathishjayapal / LoggingSample.java
Created August 28, 2021 04:52
Java16 Logging Gist
View LoggingSample.java
package me.sathish;
import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
public class LoggingSample {
private static Logger logger = Logger.getLogger("me.sathish.package");
private static FileHandler fh;