Skip to content

Instantly share code, notes, and snippets.

@pmav99
pmav99 / Scala.For.The.Impatient.md
Created October 19, 2018 10:03 — forked from hhimanshu/ Scala.For.The.Impatient.md
Scala for the Impatient Exercises

This gist will contain all the exercises from the book

@pmav99
pmav99 / skylake-tuning-linux.md
Created September 28, 2018 13:25 — forked from Brainiarc7/skylake-tuning-linux.md
This gist will show you how to tune your Intel-based Skylake, Kabylake and beyond Integrated Graphics Core for performance and reliability through GuC and HuC firmware usage on Linux.

Tuning Intel Skylake and beyond for optimal performance and feature level support on Linux:

Note that on Skylake, Kabylake (and the now cancelled "Broxton") SKUs, functionality such as power saving, GPU scheduling and HDMI audio have been moved onto binary-only firmware, and as such, the GuC and the HuC blobs must be loaded at run-time to access this functionality.

Enabling GuC and HuC on Skylake and above requires a few extra parameters be passed to the kernel before boot.

Instructions provided for both Fedora and Ubuntu (including Debian):

Note that the firmware for these GPUs is often packaged by your distributor, and as such, you can confirm the firmware blob's availability by running:

@pmav99
pmav99 / app.py
Created September 4, 2018 22:46
Flask + datatables + ajax
import numpy as np
import pandas as pd
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
MY_DATA = pd.DataFrame(np.random.random((10000, 3)), columns=["a", "b", "c"])
@app.route('/index')
@app.route('/')
@pmav99
pmav99 / pysync
Last active September 2, 2018 17:08
pysync - A wrapper around `rsync`.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#author: Panagiotis Mavrogiorgos
#email: gmail, pmav99
"""
A wrapper around ``rsync``.
If the ``source`` or the ``destination`` directories are on a remote host
then you must specify the user and ip. E.g.
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@pmav99
pmav99 / correlation_calculations2.ipynb
Created August 20, 2018 12:08
Correlation calculations.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pmav99
pmav99 / balance.py
Created March 2, 2018 17:05 — forked from bbengfort/balance.py
Database transactions blog post.
#!/usr/bin/env python3
import os
import logging
import psycopg2 as pg
from decimal import Decimal
from functools import wraps
from psycopg2.pool import ThreadedConnectionPool
@pmav99
pmav99 / vtk-unstructuredgrid-to-stl.py
Created February 26, 2018 11:57 — forked from thewtex/vtk-unstructuredgrid-to-stl.py
Convert a .vtk UnstructuredGrid file to .stl file.
#!/usr/bin/env python
"""Convert UnstructuredGrid in .vtk files to STL files."""
import sys
import vtk
if len(sys.argv) < 2 or sys.argv[1] == '-h' or sys.argv[1] == '--help':
print('Usage: vtk-unstructuredgrid-to-stl.py <input.vtk> <output.stl>')
sys.exit(1)
@pmav99
pmav99 / vtk_python_mesh.py
Created February 26, 2018 11:57 — forked from Hodapp87/vtk_python_mesh.py
Simple VTK example in Python to load an STL mesh and display with a manipulator.
#!/bin/env python
"""
Simple VTK example in Python to load an STL mesh and display with a manipulator.
Chris Hodapp, 2014-01-28, (c) 2014
"""
import vtk
def render():
@pmav99
pmav99 / gist:e643646f8df816373dd75a911fc93a36
Created February 16, 2018 14:58 — forked from ymirpl/gist:1052094
Python unicode e-mail sending
#coding: utf-8
from cStringIO import StringIO
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
from email import Charset
from email.generator import Generator
import smtplib
# Example address data