Skip to content

Instantly share code, notes, and snippets.

View poppingtonic's full-sized avatar
💭
I may be slow to respond.

Brian Muhia poppingtonic

💭
I may be slow to respond.
View GitHub Profile
Mar 22 09:13:30 metabox systemd-udevd[342]: seq 2902 queued, 'change' 'power_supply'
Mar 22 09:13:30 metabox systemd-udevd[342]: seq 2902 forked new worker [4117]
Mar 22 09:13:30 metabox systemd-udevd[4117]: seq 2902 running
Mar 22 09:13:30 metabox systemd-udevd[4117]: RUN '/usr/local/bin/aclidswitch AC' /usr/lib/udev/rules.d/98-aclidswitch.rules:5
Mar 22 09:13:30 metabox systemd-udevd[4117]: RUN 'lmt-udev auto' /usr/lib/udev/rules.d/99-laptop-mode.rules:1
Mar 22 09:13:30 metabox [4118]: starting '/usr/local/bin/aclidswitch AC'
Mar 22 09:13:30 metabox systemd-udevd[4117]: '/usr/local/bin/aclidswitch AC'(err) '/usr/bin/xbacklight: -set requires an argument'
Mar 22 09:13:30 metabox systemd-udevd[4117]: '/usr/local/bin/aclidswitch AC'(err) 'usage: /usr/bin/xbacklight [options]'
Mar 22 09:13:30 metabox systemd-udevd[4117]: '/usr/local/bin/aclidswitch AC'(err) ' where options are:'
Mar 22 09:13:30 metabox systemd-udevd[4117]: '/usr/local/bin/aclidswitch AC'(err) ' -display <display> or -d <display>'
from fastai.imports import *
from fastai.transforms import *
from fastai.conv_learner import *
from fastai.model import *
from fastai.dataset import *
from fastai.sgdr import *
from fastai.plots import *
sz=224 # image size
# architecture, from https://github.com/facebookresearch/ResNeXt
@poppingtonic
poppingtonic / Testing BLAS.ipynb
Created August 11, 2017 14:38
Wrapping BLAS/Fortran code in Cython
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@poppingtonic
poppingtonic / ranking.py
Created August 4, 2017 12:10 — forked from fabianp/ranking.py
Pairwise ranking using scikit-learn LinearSVC
"""
Implementation of pairwise ranking using scikit-learn LinearSVC
Reference:
"Large Margin Rank Boundaries for Ordinal Regression", R. Herbrich,
T. Graepel, K. Obermayer 1999
"Learning to rank from medical imaging data." Pedregosa, Fabian, et al.,
Machine Learning in Medical Imaging 2012.
@poppingtonic
poppingtonic / README
Created March 22, 2017 07:28 — forked from mikaelz/README
Fill MPC/MPD playlist with SoundCloud stream URLs
Options:
soundcloud.py --genre
soundcloud.py search
soundcloud.py user
soundcloud.py tracks
soundcloud.py url
soundcloud.py playlist
Usage:
-- defines a factorial function
function fact (n)
if n <= 0 then
return 1
else
return n * fact(n-1)
end
end
print(fact(5))
@poppingtonic
poppingtonic / wikidata2pgsql.py
Created March 2, 2017 18:55 — forked from mocobeta/wikidata2pgsql.py
Python script importing Wikipedia xml dump data to PostgreSQL
# -*- coding: utf-8 -*-
import psycopg2
import xml.sax
from xml.sax.handler import ContentHandler
from dicttoxml import dicttoxml
INSERT_STMT = "INSERT INTO pages (id, page) VALUES('%s', '%s')"
COMMIT_WINDOW = 10000
@poppingtonic
poppingtonic / pg-pong.py
Created February 6, 2017 20:05 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@poppingtonic
poppingtonic / ffmpeg-desktop-livestreaming-nvenc-and netcat.md
Created January 13, 2017 13:41 — forked from Brainiarc7/ffmpeg-desktop-livestreaming-nvenc-and netcat.md
This gist will show you how to livestream your Linux desktop to a client via FFMpeg using a GPU-accelerated video encoder (NVENC and VAAPI-based)

Low-Latency Live Streaming for your Desktop using ffmpeg and netcat

Preamble:

In this post I will explore how to stream a video and audio capture from one computer to another using ffmpeg and netcat, with a latency below 100ms, which is good enough for presentations and general purpose remote display tasks on a local network.

The problem:

@poppingtonic
poppingtonic / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Created January 13, 2017 13:40 — forked from Brainiarc7/VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".