Skip to content

Instantly share code, notes, and snippets.

@jyio
jyio / Makefile
Created December 19, 2011 23:01
build the CyanogenMod 9 preview for NOOK Color
## Copyright (c) 2011 Jiang Yio, http://inportb.com/
##
## Permission is hereby granted, free of charge, to any person obtaining
## a copy of this software and associated documentation files (the
## "Software"), to deal in the Software without restriction, including
## without limitation the rights to use, copy, modify, merge, publish,
## distribute, sublicense, and/or sell copies of the Software, and to
## permit persons to whom the Software is furnished to do so, subject to
## the following conditions:
##
@jyio
jyio / musl-0.8.6-android.patch
Created February 25, 2012 06:43
libmusl, an extension wrapper around android's bionic, based on musl
--- arch/arm/bits/limits.h
+++ arch/arm/bits/limits.h
@@ -1,6 +1,5 @@
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
-#define PAGE_SIZE 4096
#define LONG_BIT 32
#endif
--- arch/arm/bits/mman.h
@jyio
jyio / mkicon.sh
Created April 10, 2012 04:11
generates png icons for android from svg
#!/bin/sh
# usage:
# ./mkicon.sh <input> <purpose>
# example:
# ./mkicon.sh icon.svg launcher
mkicon() {
file_in="$1"
file_out="$2"
@jyio
jyio / index.html
Created April 13, 2012 04:59
demonstration of bottle.py + subprocess
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>SCP</title>
<meta name="generator" content="Bluefish 2.0.1" >
<meta name="author" content="adam" >
<meta name="date" content="2011-01-15T09:39:02-0600" >
<meta name="copyright" content="">
<meta name="keywords" content="">
<meta name="description" content="Santa Clause Web Interface">
#!/system/bin/sh
set -e
DB=/botbrew/var/lib/system-alternatives
HASHDB="${DB}/md5"
str_hash() { # <string>
echo "$1" | md5sum | awk '{ print $1 }'
}
file_hash() { # <path>
md5sum "$1" | awk '{ print $1 }'
}
@jyio
jyio / config.sh
Created April 22, 2012 03:30
PengDroid: a healthy fusion of Debian and Android
#!/bin/sh
set -e -x
export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
mkdir -p /usr/share/man/man1
/var/lib/dpkg/info/dash.preinst install || true
dpkg --configure -a
ln -sf update-rc.d-insserv /usr/sbin/update-rc.d
@jyio
jyio / autobuild.sh
Created August 5, 2012 01:10
continuous CyanogenMod rebuilds using AndBot
#!/bin/bash
mkdir -p ~/zip
cd ~/android/system
while ! [ -f ~/stop ]; do
DATESTR=$(date -u)
DATETIME=$(date -u +%Y%m%d-%H%M%S)
(
echo "=============================="
echo " * STARTING BUILD * "
/*
ionic-rem.css
based on ionic 1.0.0-beta.11
makes it easy to scale all the things, e.g.
html {
font-size: 150%;
}
*/
@jyio
jyio / acme-autocert.sh
Last active February 18, 2020 06:32
Automatic SSL certificates from Let's Encrypt using Nginx and acme.sh in webroot mode
#/bin/sh
get_domains()
{
cat /etc/nginx/sites-enabled/* \
| sed 's/^[[:blank:]]*//' \
| grep ^server_name \
| grep -v '# NOSSL' \
| cut -d';' -f1 \
| awk '{for(i=2; i<=NF; i++) print $i}' \