Skip to content

Instantly share code, notes, and snippets.

View haggaie's full-sized avatar

Haggai Eran haggaie

View GitHub Profile
@haggaie
haggaie / extract-notes.ps1
Created February 22, 2022 14:18
Extract notes text from PowerPoint slides in PowerShell
$ErrorActionPreference = "Stop"
# Usage: extract-notes.ps1 <file>
$Filename = $args[0]
$Output = 'notes.md'
$Enc = 'Unicode'
Write-Host "Opening filename: '$Filename'"
Add-type -AssemblyName office
@haggaie
haggaie / android-log-keyboard-crash.txt
Created August 7, 2012 18:41
Android log for keyboard crash
W/InputManagerService( 164): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40f2d8a8
E/BinaryDictionaryGetter( 3372): Could not find a dictionary pack
E/ActivityThread( 3372): Failed to find provider info for com.android.inputmethod.latin.dictionarypack
F/libc ( 3372): Fatal signal 11 (SIGSEGV) at 0x0034dd44 (code=1)
I/DEBUG ( 2772): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 2772): Build fingerprint: 'Htc/cm_legend/legend:4.0.4/IMM76L/eng.zeubea.20120718.020845:userdebug/test-keys'
I/DEBUG ( 2772): pid: 3372, tid: 3372 >>> com.android.inputmethod.latin <<<
I/DEBUG ( 2772): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0034dd44
I/DEBUG ( 2772): r0 00018388 r1 00048aa7 r2 00030710 r3 00122a9c
I/DEBUG ( 2772): r4 0022b2a8 r5 0034dd38 r6 00018371 r7 0025da08
@haggaie
haggaie / heb.lyx
Created July 11, 2012 20:22
Hebrew LyX/XeTeX test
#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass book
\begin_preamble
\usepackage{a4wide}
\newfontfamily{\hebrewfont}[Script=Hebrew]{David CLM}
\end_preamble
\use_default_options false
@haggaie
haggaie / wii.sh
Created May 10, 2012 04:46
Script I use to show Wii input on mplayer using an easycap device, and connecting audio directly to line-in.
#!/bin/bash
AMIXER="amixer -q"
$AMIXER -c0 set Line unmute
/usr/bin/mplayer tv:// -tv driver=v4l2:norm=PAL_BGHIN:width=853:height=480:outfmt=uyvy:device=/dev/video1:input=0:fps=25:immediatemode=1 -hardframedrop -aspect 16:9
$AMIXER -c0 set Line mute
@haggaie
haggaie / unicode-conv.py
Created April 22, 2012 06:30
Convert \uDDDD sequences to unicode
#/usr/bin/env python
import sys, re
text = sys.stdin.read()
result = unicode()
unicode_char_re = re.compile(r'\\u[0-9a-fA-F]{4}')
prev_pos = 0
for m in unicode_char_re.finditer(text):
span = m.span()
result += text[prev_pos:span[0]]
@haggaie
haggaie / channels.conf
Created April 14, 2012 10:41
Israeli DVB-T channels configuration file.
Ch 1:538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2561:2562:1
Ch 2:538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2593:2594:2
Ch 10:538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2625:2626:3
Ch 33:538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2657:2658:4
Ch 99:538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2689:2690:5
Music:538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:0:2817:21
Music:538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:0:2993:32
Idan+ test_1:538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:Q
@haggaie
haggaie / random-dict-password.py
Created January 5, 2012 20:13
Generate random passwords from dictionary
#!/usr/bin/env python
# random-dict-password.py - Generate random passwords from a dictionary
# Copyright (c) 2012 Haggai Eran
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@haggaie
haggaie / record.sh
Created July 30, 2011 07:37
Script to record a stream at specific times
#!/bin/sh
if [ "$#" != 4 ] ; then
echo "Usage: $0 <url> <filename> <starttime> <endtime>"
exit 1
fi
URL="$1"
FILENAME="$2"
STARTTIME="$3"
@haggaie
haggaie / gist:25935
Created November 17, 2008 22:25
Test TM memory allocation
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#ifndef _TM
#error TM not enabled
#endif
int main(int argc, char** argv)
{