Skip to content

Instantly share code, notes, and snippets.

<?xml version='1.0' encoding='utf-8' standalone='no' ?>
<opml version="1.1">
<head>
<title>Akiva Podcasts</title>
<dateCreated>Tue, 05 Nov 2013 19:52:28 EST</dateCreated>
<dateModified>Tue, 05 Nov 2013 19:52:28 EST</dateModified>
</head>
<body>
<outline text="Podcasts">
<outline text="קטעים בהיסטוריה" type="rss" xmlUrl="http://feeds.feedburner.com/ktaim"/>
#!/bin/bash
SCRIPTNAME=$HOSTNAME
rm -rf ~/projects/$SCRIPTNAME
mkdir -p ~/projects/$SCRIPTNAME
cd ~/projects/$SCRIPTNAME
git clone git@bitbucket.org:akiva_bloch/${HOSTNAME}.git .
./launch
FROM alpine:3.2
MAINTAINER <Akiva Bloch "akiva@atar.me">
RUN apk add --update python py-pip
RUN pip install --upgrade pip
[ 380.746702] ------------[ cut here ]------------
[ 380.746732] WARNING: at mm/page_alloc.c:6148 free_contig_range+0xa4/0xb4()
[ 380.746736] 4 pages are still in use!
[ 380.746740] Modules linked in: bnep hci_uart bluetooth zram(C) vfe_v4l2 w1_gpio wire vfe_io ir_lirc_codec lirc_dev videobuf2_dma_contig videobuf2_memops ir_sanyo_decoder ir_sony_decoder ir_rc6_decoder ir_rc5_decoder ir_mce_kbd_decoder ir_nec_decoder ir_jvc_decoder videobuf2_core sunxi_ir_rx ss cedar_ve mali(O) 8723bs cfg80211 sunxi_sndcodec sunxi_i2s sunxi_codec
[ 380.746806] CPU: 0 PID: 4499 Comm: pulseaudio Tainted: G C O 3.10.104-2-pine64-longsleep #113
[ 380.746811] Call trace:
[ 380.749602] [<ffffffc000088388>] dump_backtrace+0x0/0x118
[ 380.749612] [<ffffffc0000884c4>] show_stack+0x24/0x30
[ 380.750223] [<ffffffc000717c84>] dump_stack+0x20/0x28
[ 380.750234] [<ffffffc0000addb8>] warn_slowpath_common+0x80/0xa8
#!/usr/bin/env python3
import requests
import json
import pprint
from datetime import datetime
pp = pprint.PrettyPrinter(indent=4)
def get_station(station_id):
@abloch
abloch / msn.py
Created July 9, 2017 00:33
msn scraping example
from lxml import html
import requests
# get alert info
url = 'https://www.msn.com/en-us/weather/weatheralerts/Beverly%20Hills,California,Unite%20d%20States/we-city?weadegreetype=F&day=1&ocid=ansmsnweather'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 4.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36'}
page = requests.get(url, headers)
tree = html.fromstring(page.content)
@abloch
abloch / recurrent example.py
Created December 7, 2017 09:56
recurrent example
import recurrent
from dateutil import rrule
sched_string = 'at 8:00 PM of the 15th of every month'
[runtime.strftime("%D %T") for runtime in rrule.rrulestr(recurrent.parse(sched_string))[0:5]]
@abloch
abloch / word.json
Created June 14, 2019 11:23
json representation
{
"T": [
"O",
"P",
" ",
{
"S": [
" ",
{
"y": [
@abloch
abloch / tool.py
Created June 14, 2019 11:26
a tool to create an object from a reader string
from collections.abc import Iterable
from util.tree.list import List
def tree_to_obj(tree):
if hasattr(tree, 'head') and hasattr(tree, 'children'):
return {
tree.head: tree_to_obj(tree.children)
}
if isinstance(tree, str):
return tree
verse: Particle, Verb, Noun, Suffix, Pronoun, Adjective, Paragraph, Noun
pos: noun, verb, particle, adjective
number: singular, plural
gender: masculine, feminine
tense: perfect, imperfect
person: first, second, third
binyan: qal, piel, hifil, nifal, pual, hitpael, hofal, passiveqal, polel, hitpolel
other: absolute, adverb, aphel, apocopated, article, both, cardinal, cohortativeHeh, common, compoundPrepositionArticle, conjunction, consecutive, construct, copulative, determined, directionalHeh, dual, gentilic, hishtafel, hithpaal, hitpalpel, hotpaal, imperative, independent, infinitiveAbsolute, infinitiveConstruct, interjection, interrogative, ithpeel, negative, nitpael, nitpalpel, nitpoel, object, ordinal, pael, paragogicHeh, paragogicNun, participle, passiveImperfect, passiveParticiple, passiveQal, peal, pilpel, poel, polpal, preposition, pronominal, properName, relative, tifil, wawConsecutive