Skip to content

Instantly share code, notes, and snippets.

View kartikv11's full-sized avatar
🎯
Ducks Quack, Eagles Soar

Kartik Verma kartikv11

🎯
Ducks Quack, Eagles Soar
View GitHub Profile
@kartikv11
kartikv11 / github-actions-push-to-protected-branch.yml
Created October 31, 2023 08:28
Github Push Commit in Github Actions to a Protected Branch
...
..
# Use-case here is update version of a Java Application in pom.xml
# You can change the below code as per your need.
# Branch: develop (protected branch)
# User to Push with: has owner/maintain permissions
#
# Variables:
# BUILD_TOKEN : user to commit & push with is set in Github environment Secrets as BUILD_TOKEN
# REPO_NEW_VERSION: is new version value from a previous step (example: 1.0.1)
@kartikv11
kartikv11 / README-tomcat-as-systemd-service.md
Created November 9, 2022 07:36 — forked from drmalex07/README-tomcat-as-systemd-service.md
An example configuration for Tomcat as systemd service. #tomcat #systemd #systemd.service

README

Let Tomcat is download and installed under /opt/tomcat. Also, let tomcat be a non-provileged user under which the server will be running.

We assume that we keep server's binaries under /opt/tomcat and we will create a server instance named foo under /var/tomcat/ (carrying its own conf, logs, webapps, work, lib directories). See also https://dzone.com/articles/running-multiple-tomcat.

Create a template service unit file at /etc/systemd/system/tomcat@.service:

@kartikv11
kartikv11 / Activate Office 2019 for macOS VoL.md
Created January 28, 2021 08:24 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDVXh+LFV1zU8SJVj7DLRhc+k8gNOwTHQ0QsrJsoSH1YsHLpEQI1RtKC6Re2mlOf6JLkFPfykC0EcSuTnFVTfoviiBPn69iN2x0PzeQwHos+Is9y8ZkwHdA/u0oPHMruasdM02ZvP3/g8/sbEzpOvPZCSkmY5ITYPH+Q01ZbCK/gHB59efpbpCGELUtRyrlkoRVc9yqU8WNb5rEI2gB5dRv3OHEVKzDN01um++9SwdDDN6ZcIrlHBWD5EJ+psfBlGdjquq7sXbajv9bBTWAmsVztPXPnTAgBB2KPX5HJb9GfOOCa3wj5sOy18vtR6dn4HT65Nz0IAOlFUxKyka2p5l8EFjkTtWk6DCenlc4BbyCG8uv0s6ZcLF+Ez9gAwPXgTIgYSub6t3Idary1mbzTMm7bve2+Btd/lqDeuant6ERnMC6+cBYJeoab0N5NO+CvwAdQ1aUX5KJ6xMh2o5JR4dGi+RXlm5Z/e7oLShYYmCtOZdMD3BIe8yaw4L+3pueBFHR6bua8N/1s/5xadv82tRzIppmmyygHCM/dLvO+4/SjFl8CEwGcqYQhD/hB8iU9uFeuF50K6k4RYeivKemJd5jgO4W1ZNAP1OC08jIKFQOWvp8b+2L6UouU+q6JFg0F5keeYyVk0hv07yI3+Uyj64AGa/pYEXX64HOBAMM/lUYJw== kartx111@gmail.com
@kartikv11
kartikv11 / signAndVerifySecp256K1Util.java
Last active October 22, 2022 13:36
Signing & Verification of secp256k1 in Java
/*
Create Keys using:
Private Key(2 Step: Create & convert to newer PEM format):
openssl ecparam -name secp256k1 -genkey -out privateKey.pem
openssl pkcs8 -topk8 -inform pem -in privateKey.pem -outform pem -nocrypt -out privateKeyv2.pem
Public Key(using Private Key):
openssl ec -in privateKeyv2.pem -pubout -out publicKeyv2.pem
*/
@kartikv11
kartikv11 / keybase.md
Created May 18, 2020 10:08
Keybase Proof

Keybase proof

I hereby claim:

  • I am kartikv11 on github.
  • I am kartikv11 (https://keybase.io/kartikv11) on keybase.
  • I have a public key ASA08D2fcSHAhnzJj1ALYPsFVnfVlLBneWjlfHBXmxVMxwo

To claim this, I am signing this object:

@kartikv11
kartikv11 / bobp-python.md
Created January 17, 2019 12:50 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@kartikv11
kartikv11 / echo_server.py
Created March 15, 2018 12:19
Python Echo server for light-weight tasks ('cos you don't need frameworks to build APIs always)
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Kartik Verma
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@kartikv11
kartikv11 / tmux-cheatsheet.markdown
Created November 14, 2017 10:26 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@kartikv11
kartikv11 / gcp_signed_url_util.py
Created October 20, 2017 08:51
Python3 Utility to create Signed URLs for Google Cloud Storage File Upload (with expiry)
"""
Code to create a signed URL to upload a file using that signed URL to Google Cloud Storage
Constants to be present in settings module or can be defined locally:
- GCP_CRED_FILE_PATH (JSON file where the GCP credentials are present)
- GCP_PROJECT (GCP Project name)
- GCP_STORAGE_BASE_URL (Base Url of GCP, usually https://storage.googleapis.com)
- GCP_SIGNED_URL_TIMEOUT (Timeout in seconds for which the signed URL is valid)
- GCP_BUCKET (Google Cloud Bucket Name)
"""
import logging