Skip to content

Instantly share code, notes, and snippets.

View msampathkumar's full-sized avatar

Sampath Kumar msampathkumar

View GitHub Profile
@msampathkumar
msampathkumar / 2024-03-Duet-AI-Roadshow-Event-Useful-Links.md
Last active March 14, 2024 20:15
2024-03 Gen AI Labs: Duet AI for Developers - Warsaw - Useful links
@msampathkumar
msampathkumar / gist:05c92262e69cab11336ffd11addc4431
Created May 26, 2023 14:39 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@msampathkumar
msampathkumar / Python_ed25519.py
Created May 19, 2022 18:41
How to generate Ed25519 Key Pairs in Python
import base64
from cryptography.hazmat.primitives.asymmetric import ed25519
from cryptography.hazmat.primitives import serialization
private_key = ed25519.Ed25519PrivateKey.generate()
public_key = private_key.public_key()
private_key_str = private_key.private_bytes(
encoding=serialization.Encoding.Raw,
format=serialization.PrivateFormat.Raw,
@msampathkumar
msampathkumar / main.tf
Created December 14, 2021 05:32 — forked from saranshdhingra/main.tf
Terraform script to create multiple Google Cloud VM instances with different machine types and a custom docker container.
#
# Copyright 201 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# Testing https://github.com/GoogleCloudPlatform/magic-modules/pull/5448/files
# Step by Step - Instructions
- Step1: Download files
```
wget https://github.com/GoogleCloudPlatform/magic-modules/raw/e8d547a02b95d7a1a650b52c5968404ee57a7b14/mmv1/products/compute/terraform.yaml
wget https://github.com/GoogleCloudPlatform/magic-modules/raw/e8d547a02b95d7a1a650b52c5968404ee57a7b14/mmv1/templates/terraform/examples/external_ssl_proxy_lb_mig_backend_custom_header.tf.erb
@msampathkumar
msampathkumar / PySparkCommandsNotes.md
Last active June 30, 2020 07:33
PySpark Commonly Used Commands

Setup a Spark Context

spark = SparkSession.builder.appName('Magic').getOrCreate()

File IO

df = spark.read.format("csv").option("multiline", True).option("delimiter", ",").load(file_path)
@msampathkumar
msampathkumar / inspections.txt
Created January 30, 2020 10:05 — forked from pylover/inspections.txt
PyCharm inspections
# Extracted using: $ unzip -p lib/pycharm.jar com/jetbrains/python/PyBundle.properties | grep -B1 INSP.NAME | grep '^#' | sed 's|Inspection||g' | sed -e 's|#\s\{,1\}|# noinspection |'
# noinspection PyPep8
# noinspection PyPep8Naming
# noinspection PyTypeChecker
# noinspection PyAbstractClass
# noinspection PyArgumentEqualDefault
# noinspection PyArgumentList
# noinspection PyAssignmentToLoopOrWithParameter
# noinspection PyAttributeOutsideInit
@msampathkumar
msampathkumar / glue_job.py
Created October 31, 2019 06:53
Read & Write data from S3 AWS Python Glue
import io
import pandas as pd
def split_s3_name(s3_path):
bucket, key = s3_path.strip('s3://').split('/', 1)
return (bucket, key)
def read_from_s3(file_name):
@msampathkumar
msampathkumar / airflow_json_variables.py
Created September 20, 2019 06:38 — forked from kaxil/airflow_json_variables.py
Using Airflow Json Variables
from airflow.models import Variable
# Common (Not-so-nice way)
# 3 DB connections when the file is parsed
var1 = Variable.get("var1")
var2 = Variable.get("var2")
var3 = Variable.get("var3")
# Recommended Way
# Just 1 Database call