Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
..

magnus magnusja

👨‍💻
..
View GitHub Profile
@magnusja
magnusja / gen_mongooseim_scram.py
Last active Feb 26, 2016
This code snippet is able to generate a scram salted password 'hash' in the format and with the necessary information mongooseim expects when using http auth and scram. See http://stackoverflow.com/questions/35652435/mongooseim-ejabberd-http-auth-using-scram and http://mongooseim.readthedocs.org/en/1.6.1/advanced-configuration/HTTP-authenticatio…
View gen_mongooseim_scram.py
# https://tools.ietf.org/html/rfc5802
import base64
import hashlib
import hmac
import sys
from passlib.hash import scram
View rank_metrics.py
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
@magnusja
magnusja / CMakeLists.txt
Created Nov 2, 2015
Arduino CMake example (CLion)
View CMakeLists.txt
cmake_minimum_required(VERSION 2.8.4)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/ArduinoToolchain.cmake)
set(PROJECT_NAME ard)
project(${PROJECT_NAME})
set(ARDUINO_DEFAULT_PORT /dev/cu.usbmodemfd121)
set(${CMAKE_PROJECT_NAME}_SKETCH ard.ino)
generate_arduino_firmware(${CMAKE_PROJECT_NAME})
View keybase.md

Keybase proof

I hereby claim:

  • I am magnusja on github.
  • I am magnusja (https://keybase.io/magnusja) on keybase.
  • I have a public key ASB98UhZ7Xgqqp8_V2fNkKifhvQ8aVh39rGH5xtjhc0T1wo

To claim this, I am signing this object:

View gist:366076ae12aa456c7f5b0dea4693e249
[tool.poetry]
name = "document_classification"
version = "0.1.0"
description = "Generic (scanned) document classification"
authors = ["magnus <magnus@mgns.tech >"]
[tool.poetry.dependencies]
python = "^3.7"
jupyterlab = "^0.35.4"
click = "^7.0"
View gist:4a3c11b310d5e3a70e7186593310b5d5
[tool.poetry]
name = "ocr"
version = "0.1.0"
description = ""
authors = ["Magnus <magnus@jahnen.me>"]
[tool.poetry.dependencies]
python = "3.8.6"
pyocr = "^0.7.2"
Pillow = "^8.0.1"
View gist:f4f4eb73678103c3438139543c15685e
root@training-document-classification-4tvkc:/training# ray memory
2020-11-19 19:51:53,430 INFO scripts.py:1317 -- Connecting to Ray instance at 10.42.0.108:6379.
2020-11-19 19:51:53,431 INFO worker.py:633 -- Connecting to existing Ray cluster at address: 10.42.0.108:6379
-----------------------------------------------------------------------------------------------------
Object ID Reference Type Object Size Reference Creation Site
=====================================================================================================
; worker pid=136679
ffffffffffffffffffffffff0100000001000000 PINNED_IN_MEMORY 18808561 (deserialize actor creation task arg) abc.DynamicTrainable.__init__
ffffffffffffffffffffffff0100000002000000 PINNED_IN_MEMORY 5988152 (deserialize actor creation task arg) abc.DynamicTrainable.__init__
ffffffffffffffffffffffff0100000003000000 LOCAL_REFERENCE 15 (deserialize actor creation task arg) abc.DynamicTrainable._
View gist:b9e381ada542a471dd90b95dce3f02d1
root@training-document-classification-wdgc2:/training# ray memory
2020-11-20 15:09:56,419 INFO scripts.py:1340 -- Connecting to Ray instance at 10.42.0.130:6379.
2020-11-20 15:09:56,420 INFO worker.py:650 -- Connecting to existing Ray cluster at address: 10.42.0.130:6379
-----------------------------------------------------------------------------------------------------
Object ID Reference Type Object Size Reference Creation Site
=====================================================================================================
; worker pid=144014
ffffffffffffffffffffffff0100000002000000 PINNED_IN_MEMORY 5988152 (deserialize actor creation task arg) abc.DynamicTrainable.__init__
ffffffffffffffffffffffff0100000003000000 LOCAL_REFERENCE 15 (deserialize actor creation task arg) abc.DynamicTrainable.__init__
ffffffffffffffffffffffff0100000001000000 PINNED_IN_MEMORY 18808561 (deserialize actor creation task arg) abc.DynamicTrainable._
View gist:0bd1849b42d7e6cd940505e3c5b779f2
root@training-document-classification-8vdnj:/training# ray memory
2020-11-21 12:54:39,332 INFO scripts.py:1317 -- Connecting to Ray instance at 10.42.0.143:6379.
2020-11-21 12:54:39,332 INFO worker.py:633 -- Connecting to existing Ray cluster at address: 10.42.0.143:6379
-----------------------------------------------------------------------------------------------------
Object ID Reference Type Object Size Reference Creation Site
=====================================================================================================
; worker pid=200348
ffffffffffffffffffffffff0100000002000000 PINNED_IN_MEMORY 5988276 (deserialize actor creation task arg) abc.DynamicTrainable.__init__
ffffffffffffffffffffffff0100000003000000 LOCAL_REFERENCE 15 (deserialize actor creation task arg) abc.DynamicTrainable.__init__
ffffffffffffffffffffffff0100000001000000 PINNED_IN_MEMORY 18808997 (deserialize actor creation task arg) abc.DynamicTrainable._
View gist:6ce14e08a93864fed015bc4931877c63
root@training-document-classification-ls7b5:/training# ray memory
2020-11-23 06:27:45,222 INFO scripts.py:1042 -- Connecting to Ray instance at 10.42.0.147:6379.
WARNING: Logging before InitGoogleLogging() is written to STDERR
I1123 06:27:45.224284 114449 114449 global_state_accessor.cc:25] Redis server address = 10.42.0.147:6379, is test flag = 0
I1123 06:27:45.225081 114449 114449 redis_client.cc:141] RedisClient connected.
I1123 06:27:45.225144 114449 114449 redis_gcs_client.cc:88] RedisGcsClient Connected.
I1123 06:27:45.226150 114449 114449 service_based_gcs_client.cc:75] ServiceBasedGcsClient Connected.
-----------------------------------------------------------------------------------------------------
Object ID Reference Type Object Size Reference Creation Site
=====================================================================================================