Skip to content

Instantly share code, notes, and snippets.

View npatta01's full-sized avatar
💭
Coding Some Deep Learning Projects

Nidhin Pattaniyil npatta01

💭
Coding Some Deep Learning Projects
View GitHub Profile
@why-not
why-not / stop-idle-azure-aws.py
Last active March 4, 2024 19:49
Automatically Shutting Down and Deallocating an AZURE or AWS VM (when idle AND no one is logged in via SSH)
#!/usr/bin/env python
# shell commands being automated.
# w
# aws ec2 stop-instances --instance-id INSTANCE_ID
# az vm deallocate --name NAME --resource-group RESOURCE_GROUP
"""
The script is the easy part, installing it into the unfriendly(imo) cron system and
@Philmod
Philmod / gcb-kubernetes.yaml
Last active July 25, 2021 05:34
Deploy a new image from Google Cloud Container Builder to Kubernetes, by storing GKE credentials in GCS.
steps:
- name: 'gcr.io/cloud-builders/npm'
args: ['install']
- name: 'gcr.io/cloud-builders/npm'
args: ['test']
- name: 'gcr.io/cloud-builders/docker'
args: ["build", "-t", "gcr.io/$PROJECT_ID/frontend:$REVISION_ID", "."]
- name: 'gcr.io/cloud-builders/docker'
args: ["push", "gcr.io/$PROJECT_ID/frontend:$REVISION_ID"]
- name: 'gcr.io/cloud-builders/gcloud'
@Philmod
Philmod / google-container-kubernetes.js
Last active November 26, 2018 18:10
Deploy a new image from Google Cloud Container Builder to Kubernetes, using Google Cloud Functions.
const async = require('async');
const google = require('googleapis');
const k8s = require('kubernetes-client');
const container = google.container('v1');
const PROJECT_ID = 'node-example-gke';
const ZONE = 'us-east1-b';
const CLUSTER_ID = 'node-example-cluster';
const NAMESPACE = 'default';
@luiscape
luiscape / install_packages.sh
Created January 16, 2017 14:36
Install Python dependency packages from requirements.txt using conda.
#
# Original solution via StackOverflow:
# http://stackoverflow.com/questions/35802939/install-only-available-packages-using-conda-install-yes-file-requirements-t
#
#
# Install via `conda` directly.
# This will fail to install all
# dependencies. If one fails,
# all dependencies will fail to install.
@alysonla
alysonla / active-issues.sql
Last active September 19, 2023 11:21
Queries that power the open source section of the 2016 Octoverse report https://octoverse.github.com/2016/
-- Active issues
-- Count of total active issues in the specified time frame
-- Source: githubarchive public data set via Google BigQuery http://githubarchive.org/
SELECT
COUNT(DISTINCT JSON_EXTRACT_SCALAR(events.payload, '$.issue.id')) AS events_issue_count
FROM (SELECT * FROM TABLE_DATE_RANGE([githubarchive:day.],TIMESTAMP('2015-09-01'),TIMESTAMP('2016-08-31')))
AS events
-- 10,723,492 active issues
@erikbern
erikbern / install-tensorflow.sh
Last active June 26, 2023 00:40
Installing TensorFlow on EC2
# Note – this is not a bash script (some of the steps require reboot)
# I named it .sh just so Github does correct syntax highlighting.
#
# This is also available as an AMI in us-east-1 (virginia): ami-cf5028a5
#
# The CUDA part is mostly based on this excellent blog post:
# http://tleyden.github.io/blog/2014/10/25/cuda-6-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/
# Install various packages
sudo apt-get update
@terranware
terranware / snsToSlack.js
Last active March 7, 2024 14:47
AWS Lambda function to Slack Channel hookup
var https = require('https');
var util = require('util');
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var postData = {
"channel": "#aws-sns",
"username": "AWS SNS via Lamda :: DevQa Cloud",
@jibs
jibs / gcloud-port-forward.md
Created April 25, 2015 15:57
port forwarding with a google cloud instance

Google cloud's ssh command lets you pass standard ssh flags. To, for example, forward local port 8088 to port 8088 on a vm instance, all you need to do is:

gcloud compute  ssh --ssh-flag="-L 8088:localhost:8088"  --zone "us-central1-b" "example_instance_name"

Now browsing to localhost:8088 works as it would with standard ssh.

@thvasilo
thvasilo / lzo.sh
Last active October 10, 2015 04:25
Script to install components needed to read LZO-compressed files in Apache Spark
#!/bin/bash
# Step 1: Install LZO dependencies
yum -y install lzo lzo-devel lzop
# Step 2: Install maven
MVN_VERSION=3.2.5
MVN_MD5=b2d88f02bd3a08a9df1f0b0126ebd8dc
# wget http://www.apache.org/dyn/closer.cgi/maven/maven-3/$MVN_VERSION/binaries/apache-maven-$MVN_VERSION-bin.tar.gz
wget http://apache.claz.org/maven/maven-3/$MVN_VERSION/binaries/apache-maven-$MVN_VERSION-bin.tar.gz