This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author - Rajathithan Rajasekar | |
import base64 | |
import json | |
from datetime import datetime | |
from google.cloud import storage | |
import requests | |
def process_log_entry(data, context): | |
data_buffer = base64.b64decode(data["data"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author - Rajathithan Rajasekar | |
import base64 | |
import json | |
from datetime import datetime | |
from google.cloud import storage | |
import requests | |
def process_log_entry(data, context): | |
data_buffer = base64.b64decode(data["data"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author - Rajathithan Rajasekar | |
import base64 | |
import json | |
from datetime import datetime | |
from google.cloud import storage | |
import requests | |
def process_log_entry(data, context): | |
data_buffer = base64.b64decode(data["data"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Author - Rajathithan Rajasekar | |
# install gcp logging agent | |
curl -sSO https://dl.google.com/cloudagents/install-logging-agent.sh | |
sudo bash install-logging-agent.sh | |
# setup a configuration for startup-script logs only | |
sudo cat > /etc/google-fluentd/config.d/service-now-test.conf <<- EOM | |
<source> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script to retrieve compute engine details. | |
# Author - Rajathithan Rajasekar - 03/03/2020 | |
from pprint import pprint | |
from googleapiclient import discovery | |
from oauth2client.client import GoogleCredentials | |
import re | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to retrieve compute engine details. | |
# Author - Rajathithan Rajasekar - 03/03/2020 | |
echo "PROJECT NAME, INSTANCE NAME , ZONE , MACHINE-TYPE , OPERATING SYSTEM , CPU , MEMORY , DISK SIZE" > compute-engine-details.csv | |
prjs=( $(gcloud projects list | tail -n +2 | awk {'print $1'}) ) | |
for i in "${prjs[@]}" | |
do | |
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" >> list.txt | |
echo "Setting Project: $i" >> list.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import imutils | |
cap = cv2.VideoCapture(0) | |
t = cv2.getTickCount() | |
count = 0 | |
fps = 60.0 | |
while(True): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import imutils | |
import dlib | |
import sys | |
from renderface2 import renderFace2 | |
# Capture the webcam feed | |
cap = cv2.VideoCapture(0) | |
# 68 point face model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def drawPolyline(im, landmarks, start, end, isClosed=False): | |
points = [] | |
for i in range(start, end+1): | |
point = [landmarks.part(i).x, landmarks.part(i).y] | |
points.append(point) | |
points = np.array(points, dtype=np.int32) | |
cv2.polylines(im, [points], isClosed, (255, 200, 0), thickness=2, lineType=cv2.LINE_8) | |
# Use this function for 68-points facial landmark detector model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to retrieve GCP IAM roles, users and serviceaccounts | |
# Author - Rajathithan Rajasekar - 03/03/2020 | |
# Update - 07/12/2023 | |
gcloud config set accessibility/screen_reader False | |
echo 'project-name,roles/rolename,user:username-and-serviceaccounts' > iamlist.csv | |
prjs=( $(gcloud projects list | tail -n +2 | awk {'print $1'}) ) | |
for i in "${prjs[@]}" | |
do | |
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" |
OlderNewer