Skip to content

Instantly share code, notes, and snippets.

View yuvadm's full-sized avatar

Yuval Adam yuvadm

View GitHub Profile
@yuvadm
yuvadm / embed.c
Created January 11, 2015 09:43
Small C program for liberating TTF fonts, fixes the `embed` flag
/*
* This program is for setting TTF files to Installable Embedding mode.
*
* Note that using this to embed fonts which you are not licensed to embed
* does not make it legal.
*
* This code was written by Tom Murphy 7, and is public domain. Use at your
* own risk...
*/
@yuvadm
yuvadm / ddns
Created January 2, 2015 12:25
zzzz.io OpenWRT DDNS script
config service "myddns"
option enabled "1"
option interface "wan"
option use_syslog "1"
option service_name "zzzz.io"
option domain "example.zzzz.io"
option force_interval "72"
option force_unit "hours"
@yuvadm
yuvadm / yaourt_install.sh
Last active October 5, 2015 08:20
Yaourt (AUR helper) Installation
sudo pacman -S --noconfirm base-devel yajl wget
cd /tmp
wget https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz
wget https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz
tar zxvf package-query.tar.gz
tar zxvf yaourt.tar.gz
cd package-query
makepkg -i
@yuvadm
yuvadm / 31c3
Last active August 29, 2015 14:11
31C3 netctl secure wireless configuration, usually goes in /etc/netctl/31c3
Description='31C3 secure WPA2 802.1X config'
Interface=wls1
Connection=wireless
Security=wpa-configsection
IP=dhcp
ESSID=31C3
WPAConfigSection=(
'ssid="31C3"'
'proto=RSN WPA'
'key_mgmt=WPA-EAP'
@yuvadm
yuvadm / keybase.md
Created December 16, 2014 17:54
Keybase update

Keybase proof

I hereby claim:

  • I am yuvadm on github.
  • I am yuvadm (https://keybase.io/yuvadm) on keybase.
  • I have a public key whose fingerprint is 7B40 CAB4 9DA9 9130 954A 47CF 2713 86AA 2EB7 672F

To claim this, I am signing this object:

@yuvadm
yuvadm / install.sh
Last active October 12, 2020 11:21
Arch Linux installation on Lenovo ThinkPad X200s
# Arch Linux installation procedure on a Lenovo ThinkPad X200s
# BIOS boot (no UEFI), SSD + LVM + LUKS + TRIM + discards
# Randomize (or zero) drive contents
dd if=/dev/urandom of=/dev/sda
# Create GPT and partitions
# Use gdisk to ensure proper partition alignment
gdisk /dev/sda
# 100MB boot partition on /dev/sda1 type 8300
@yuvadm
yuvadm / unsign.pl
Created November 28, 2014 10:35
Perl script for opening signed documents on http://www.mr.gov.il
#!/usr/bin/perl -w
use strict;
no strict 'refs';
use English;
use XML::Simple;
use Data::Dumper;
use MIME::Base64;
# use Crypt::OpenSSL::X509;
@yuvadm
yuvadm / models.py
Created September 26, 2014 09:09
Django 1.5+ username field length monkey patch
# https://stackoverflow.com/questions/25136282/what-is-the-right-way-to-extend-the-username-field-length-in-django-1-5
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import AbstractUser
class MyUser(AbstractUser):
pass
USERNAME_LENGTH = 50
@yuvadm
yuvadm / ga.py
Created September 21, 2014 09:22
Python Google Analytics full server-side integration flow
import httplib2
from apiclient.discovery import build
from oauth2client.client import SignedJwtAssertionCredentials
def build_google_analytics_service():
http = httplib2.Http()
credentials = SignedJwtAssertionCredentials(
GOOGLE_CLIENT_EMAIL,
@yuvadm
yuvadm / dump1090
Created April 24, 2014 16:04
OpenWrt dump1090 init script
#!/bin/sh /etc/rc.common
START=95
start() {
screen -S dump1090 -h 20 -d -m -L dump1090 --net >> /dev/null
}
stop() {
screen -r dump1090 -X quit