Skip to content

Instantly share code, notes, and snippets.

View yogananda-muthaiah's full-sized avatar
🏠
Working from home

Yogananda Muthaiah yogananda-muthaiah

🏠
Working from home
View GitHub Profile
@yogananda-muthaiah
yogananda-muthaiah / RestAPI
Created August 10, 2019 22:57
SAP CPQ Rest API
https://sandbox.webcomcpq.com/setup/api/v1/admin/tenant
https://sandbox.webcomcpq.com/setup/api/v1/admin/users/current/data
https://sandbox.webcomcpq.com/api/rd/v1/Core/RefreshSession
https://sandbox.webcomcpq.com/api/v1/TenantResourceConsumption/GetResourceConsumptionInfoForCurrentTenant?_=1561904316235
https://sandbox.webcomcpq.com/api/v1/TenantResourceConsumption/GetBusinessPerformance?_=1561904892298
https://sandbox.webcomcpq.com/setup/api/v1/admin/translations/translate
https://sandbox.webcomcpq.com/setup/api/v1/admin/products?offset=0&limit=10
https://sandbox.webcomcpq.com/setup/api/v1/admin/users/current/data
https://sandbox.webcomcpq.com/setup/api/v1/admin/users?offset=0&limit=10
https://sandbox.webcomcpq.com/setup/api/v1/admin/permissionGroups?offset=0&limit=10
@yogananda-muthaiah
yogananda-muthaiah / HANA Tables
Created August 11, 2019 14:05
SAP HANA Important Queries
select * from tables
select * from public.tables
SELECT * FROM SYS.M_TABLES
SELECT * FROM SYS.TABLES
SELECT * FROM SYS.TABLE_COLUMNS
SELECT * FROM SYS.VIEWS
SELECT * FROM SYS.SYNONYMS
@yogananda-muthaiah
yogananda-muthaiah / HANA.sql
Created September 23, 2019 19:23
HANA Memory Consumption
select
c.host, c.user_name, c.connection_status, c.transaction_id, s.last_executed_time,
round(s.allocated_memory_size/1024/1024/1024,2) as "Alloc Mem (GB)",
round(s.used_memory_size/1024/1024/1024,2) as "Used Mem (GB)", s.statement_string
from
m_connections c, m_prepared_statements s
where
s.connection_id = c.connection_id and c.connection_status != 'IDLE'
order by
s.allocated_memory_size desc
@yogananda-muthaiah
yogananda-muthaiah / long running.sql
Created September 25, 2019 11:35
Oracle PL SQL - Identify top SQL statements causing long running
To find the top SQL statements that have caused most block buffer reads:
Select buffer_gets, sql_text
from v$sqlarea
where buffer_gets > 10000
order by buffer_gets desc;
To find the most frequently executed SQL:
@yogananda-muthaiah
yogananda-muthaiah / gist:339390e51018ce5942cb69d33f1935f5
Created February 15, 2020 13:06 — 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:
@yogananda-muthaiah
yogananda-muthaiah / 2fa
Created April 6, 2020 08:46 — forked from MineRobber9000/2fa
2-factor authentication terminal app in Python
#!/usr/bin/env python
import os, os.path, stat, sys, base64
# TOTP lib inlined
import time, hmac, base64, hashlib, struct
def pack_counter(t):
return struct.pack(">Q", t)
https://tools.ietf.org/pdf/rfc6750.pdf | RFC 6750 - The OAuth 2.0 Authorization Framework: Bearer Token Usage
https://blog.codeship.com/the-top-four-exception-tracking-services/?utm_campaign=Weekly%20Newsletters&utm_source=hs_email&utm_medium=email&utm_content=59985837&_hsenc=p2ANqtz-9eT2r5GjNRlu9O6bQSTDNEthAwMghv8ae5YEW698E8LMw1pGJ3dfWYt6GuaXH1JdBYuvsxZ7T_KEkRJ2b0XHz5X19A_g&_hsmi=59986787 | The Top Four Exception Tracking Services - via @codeship | via @codeship
https://about.mattermost.com/customer-stories/how-uber-uses-mattermost-to-enhance-enterprise-wide-communications/ | Why Uber switched from Slack to Mattermost for enterprise collaboration – Mattermost
https://github.com/aws/aws-lambda-go/tree/master/events | aws-lambda-go/events at master · aws/aws-lambda-go
https://courses.edx.org/dashboard | Dashboard | edX
https://github.com/dastergon/awesome-chaos-engineering | dastergon/awesome-chaos-engineering: A curated list of awesome Chaos Engineering resources.
http://blog.kubernetes.io/2018/01/kubernetes-
@yogananda-muthaiah
yogananda-muthaiah / SAPCloudIntegration.py
Created February 17, 2021 17:37
SAP Cloud Integration API
class SAPCloudIntegration:
def __init__(self, session, api_endpoint, base64AuthString):
self.sess = session
self.api_endpoint = api_endpoint
self.base64AuthString = base64AuthString
self.CSRF_Token = self.get_csrf_token()
print(f"Token {self.CSRF_Token}")

Go Cheat Sheet

Credits

Most example code taken from A Tour of Go, which is an excellent introduction to Go. If you're new to Go, do that tour. Seriously.

Go in a Nutshell

  • Imperative language
@yogananda-muthaiah
yogananda-muthaiah / slugify.sql
Created May 8, 2023 05:59 — forked from kez/slugify.sql
Generating Slugs in Postgres
CREATE EXTENSION IF NOT EXISTS "unaccent"
CREATE OR REPLACE FUNCTION slugify("value" TEXT)
RETURNS TEXT AS $$
-- removes accents (diacritic signs) from a given string --
WITH "unaccented" AS (
SELECT unaccent("value") AS "value"
),
-- lowercases the string
"lowercase" AS (