Skip to content

Instantly share code, notes, and snippets.

View ketankr9's full-sized avatar

Utsav Krishnan ketankr9

  • Google
  • Indian Institute of Technology (BHU), Varanasi,India
View GitHub Profile
@redmcg
redmcg / kubedf
Last active May 6, 2024 02:40
Bash script to show k8s PVC usage
#!/usr/bin/env bash
NODESAPI=/api/v1/nodes
function getNodes() {
kubectl get --raw $NODESAPI | jq -r '.items[].metadata.name'
}
function getPVCs() {
jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\
# pylint: skip-file
import time
import re
import md5
import requests
import json
INSTAGRAM_URL = "https://www.instagram.com"
HASHTAG_ENDPOINT = "/graphql/query/?query_hash={}&variables={}"
@tomconte
tomconte / send_iot-hub_paho_mqtt.py
Created May 12, 2016 09:32
This is a simple example showing how to use the [Paho MQTT Python client](https://eclipse.org/paho/clients/python/) to send data to Azure IoT Hub. You need to assemble the rights credentials and configure TLS and the MQTT protocol version appropriately.
#!/usr/bin/python
import paho.mqtt.publish as publish
import paho.mqtt.client as mqtt
import ssl
auth = {
'username':"ciscohackhub.azure-devices.net/lora1",
'password':"SharedAccessSignature sr=ciscohackhub.azure-devices.net%2Fdevices%2Flora1&sig=xxxx&se=1463048772"
}
@Lewiscowles1986
Lewiscowles1986 / rPi3-ap-setup.sh
Last active July 16, 2023 15:33
Raspberry Pi 3 access-point-setup
#!/bin/bash
#
# This version uses September 2017 august stretch image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
@kebunit
kebunit / KaratsubaMultiplication.cpp
Created February 26, 2016 10:41
FAST C/C++ Implementation of the Karatsuba Multiplication algorithm. This is the only C++ implementation that I found online that uses straight C++ primitives to store data instead of std::vector or std::string objects. Because of this, it's pretty speedy. You can use this file in your program
//============================================================================
// Name : KaratsubaMultiplication.cpp
// Author : Evin Ugur (http://evinugur.com)
// Version : 1.0
// Copyright : Copyright 2015. You can use this code however and wherever you want no strings attached
// Description : C++ Functions to Perform Karatsbuba Multiplications
//============================================================================
#include <iostream>
#include <math.h>
@0mkara
0mkara / Ethereum_private_network.md
Last active April 19, 2024 00:09
Ethereum private network configuration guide.

Create your own Ethereum private network

Introduction

Used nodes:

Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux
Linux localhost.localdomain 4.14.5-200.fc26.x86_64 #1 SMP Mon Dec 11 16:29:08 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
@beugley
beugley / httplib_proxy.py
Last active February 22, 2023 12:21
Python: use httplib with proxy authentication
import urlparse
import httplib
import base64
proxy_uri = "http://user:password@proxy_host:proxy_port"
host = 'www.google.com'
port = 443
url = urlparse.urlparse(proxy_uri)
conn = httplib.HTTPSConnection(url.hostname, url.port)