Skip to content

Instantly share code, notes, and snippets.

View sshravan's full-sized avatar

Shravan Srinivasan sshravan

View GitHub Profile
rcParams = {'font.size': 30,
            'font.weight': 'bold',
            'font.family': 'sans-serif',
            'text.usetex': True,
            'ps.useafm': True,
            'pdf.use14corefonts': True,
            # 'sans-serif': ['Helvetica'],
            # 'text.latex.preamble': ['\usepackage{helvet}'],
            'axes.unicode_minus': False,
@sshravan
sshravan / .screenrc
Last active July 10, 2019 20:26 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# Forked from https://gist.github.com/joaopizani/2718397
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 200000
# no welcome message
# https://stackoverflow.com/questions/390250/elegant-ways-to-support-equivalence-equality-in-python-classes
class Number:
def __init__(self, number):
self.number = number
def __eq__(self, other):
"""Overrides the default implementation"""
if isinstance(other, Number):
@sshravan
sshravan / Makefile
Created November 5, 2018 20:08
My sample Makefile
CXX=g++
CXXFLAGS=-g -std=c++11 -Wall -Wextra -Wcast-align -pedantic
LDFLAGS :=
SRC_DIR := src
OBJ_DIR := bin
SRC_FILES := $(wildcard $(SRC_DIR)/*.cpp)
OBJ_FILES := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRC_FILES))
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
// "command": "sh",
// "type": "shell",
// "args": ["-c"],
"options": {
"cwd": "${workspaceRoot}/build"
},
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",

gdb self signed certificates

# https://gist.github.com/hlissner/898b7dfc0a3b63824a70e15cd0180154
# https://sourceware.org/gdb/wiki/PermissionsDarwin

Opera + Widevine + Netflix

  • Here is a hack to watch Netflix on Opera with Widevine DRM support.
  • Download official Opera DEB and, weirdly, remove it after installation.
     cd ~/Downloads
     sudo dpkg -i opera-stable_*.deb
     sudo apt-get autoremove opera-stable
     sudo rm -rf /usr/lib/x86_64-linux-gnu/opera