Skip to content

Instantly share code, notes, and snippets.

Dheepak Krishnamurthy kdheepak

Block or report user

Report or block kdheepak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kdheepak
kdheepak / HELICS_GridLAB-D_GCC.md
Created Jan 17, 2019
Build GridLAB-D with HELICS, Boost and ZeroMQ using GCC on MacOSX
View HELICS_GridLAB-D_GCC.md

Install gcc

Install gcc using brew

brew install gcc

Install Boost

@kdheepak
kdheepak / paramiko_runner.py
Created Jan 2, 2019
paramiko non blocking example
View paramiko_runner.py
import sys
import paramiko
import os
import select
import getpass
import time
rpi = {
"username": getpass.getuser(),
"hostname": "hostname.of.server.here"
View log.py
import logging
log_format = (
"%(asctime)s - %(levelname)s [%(filename)s:%(lineno)d] : %(message)s"
)
logger = logging.getLogger(__name__)
s = logging.StreamHandler()
f = logging.Formatter(log_format)
s.setFormatter(f)
@kdheepak
kdheepak / pireceiver.py
Created Aug 24, 2018
ComboFederate Pi Exchange example
View pireceiver.py
import helics as h
fedinitstring = "--federates=1"
deltat = 0.01
helicsversion = h.helicsGetVersion()
print("PI RECEIVER: Helics version = {}".format(helicsversion))
# Create Federate Info object that describes the federate properties */
View .tmux.conf
# Change prefix key to `
unbind C-b
set -g prefix `
bind-key ` send-prefix
bind-key C-a set-option -g prefix C-a
bind-key C-b set-option -g prefix `
# we might need ` at some point, allow switching
bind-key C-a set-option -g prefix C-a
View logger.py
# Better Logging Format
## Author : Dheepak Krishnamurthy
## License : MIT
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
# create formatter and add it to the handlers
formatter = logging.Formatter('%(asctime)s - [%(module)s(%(lineno)d)] - "%(name)s".%(levelname)s - %(message)s', "%Y-%m-%d %H:%M:%S")
ch.setFormatter(formatter)
View hide_cells_in_notebook.py
from IPython.display import HTML
HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
@kdheepak
kdheepak / Py_Macro_PyCall.ipynb
Created Aug 30, 2017
A @py macro for Python-like syntax in Julia
View Py_Macro_PyCall.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View script.sh
Get-ChildItem HKLM:\Software\Classes -ErrorAction SilentlyContinue | Where-Object {
$_.PSChildName -match '^\w+\.\w+$' -and (Test-Path -Path "$($_.PSPath)\CLSID")
} | Select-Object -ExpandProperty PSChildName
View .bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# set -o errexit
# set -o pipefail
# set -o nounset
You can’t perform that action at this time.