Skip to content

Instantly share code, notes, and snippets.

View deebuls's full-sized avatar
🏠
Working from home

Deebul Nair deebuls

🏠
Working from home
View GitHub Profile
@deebuls
deebuls / plot multipl
Created May 24, 2015 10:37
Python snippets : usefull
fig, (ax1, ax2, ax3) = plt.subplots(nrows=1, ncols=3, figsize=(12,5))
@deebuls
deebuls / pdf to booklet
Last active August 29, 2015 14:21
Converting pdf to booklet from commandline
https://catdevblog.nickbair.net/2010/06/08/printing-in-booklet-format-from-the-linux-command-line/
@deebuls
deebuls / boston.json
Last active August 29, 2015 14:27 — forked from pprett/boston.json
Decision Tree Viewer (D3 and Sklearn)
{"error": 42716.2954, "samples": 506, "value": [22.532806324110698], "label": "RM <= 6.94", "type": "split", "children": [{"error": 17317.3210, "samples": 430, "value": [19.93372093023257], "label": "LSTAT <= 14.40", "type": "split", "children": [{"error": 6632.2175, "samples": 255, "value": [23.349803921568636], "label": "DIS <= 1.38", "type": "split", "children": [{"error": 390.7280, "samples": 5, "value": [45.58], "label": "CRIM <= 10.59", "type": "split", "children": [{"error": 0.0000, "samples": 4, "value": [50.0], "label": "Leaf - 4", "type": "leaf"}, {"error": 0.0000, "samples": 1, "value": [27.9], "label": "Leaf - 5", "type": "leaf"}]}, {"error": 3721.1632, "samples": 250, "value": [22.90520000000001], "label": "RM <= 6.54", "type": "split", "children": [{"error": 1636.0675, "samples": 195, "value": [21.629743589743576], "label": "LSTAT <= 7.57", "type": "split", "children": [{"error": 129.6307, "samples": 43, "value": [23.969767441860473], "label": "TAX <= 222.50", "type": "split", "children": [{"err
@deebuls
deebuls / gist:9ce6eaa94399a56adf52c1f46740d383
Created June 18, 2016 08:51
Unzip, untar recursively
find . -name "*.zip" | while read filename; do unzip -o -d "`dirname "$filename"`" "$filename"; done;
find . -name "*.tar*" | while read filename; do tar xvf "$filename" -C "`dirname "$filename"`"; done;
find . -name "*.ipynb" -execdir jupyter nbconvert --to html {} \;
@deebuls
deebuls / md
Created September 13, 2017 16:50
Pandas helpful
# Useful Scripts for Pandas
## Splitting a df whenever the value of a column changes
| 0 | 1 | 2|
|
@deebuls
deebuls / DeepLearningWorkshopMaterials.md
Last active January 15, 2018 13:34
Deep learning Workshops Materials
@deebuls
deebuls / MachineLearningCourseMaterials.md
Last active February 1, 2018 13:02
Materials for teaching Machine learning course
@deebuls
deebuls / regex.md
Last active February 1, 2018 12:42
Regex learnings

Regex used by me

  1. For searching lines with only a single word .
  • ^\h*\w+\h*$
  • ^ - Start of line
  • \h* - optional leading horizontal whitespac
  • \w+ - 1 or more word symbols You can use \S instead of \w to match any non-whitespace symbols.

To insert a linebreak, just replace with \r\n$0. You do not need any capturing groups since you can always reference the whole match with $0 (or $&amp;).

@deebuls
deebuls / train_cifar.py
Created September 2, 2020 12:16 — forked from y0ast/train_cifar.py
Getting high accuracy on CIFAR-10 is not straightforward. This self-contained script gets to 94% accuracy with a minimal setup. You can download a model trained with this script from: https://files.joo.st/cifar_model.pt
import argparse
from tqdm import tqdm
import torch
import torch.nn.functional as F
from torchvision import models, datasets, transforms
def get_CIFAR10(root="./"):
@deebuls
deebuls / [Ubuntu Blueman ERROR Fix] Failed to change profile to headset_head_unit.md
Last active March 19, 2021 12:52
[Ubuntu Blueman ERROR Fix] Failed to change profile to headset_head_unit

My earbuds SoundBuds Flow was connecting and audio working but microphone was not working.

It gets connected as A2DP audi sink, when you try to convert to Headset Head unit it gives the error "Failed to change profile to headset_head_unit".

The fix as per [1]

Install ofono:

sudo apt install ofono