Skip to content

Instantly share code, notes, and snippets.

@jyio
jyio / acme-autocert.sh
Last active Feb 18, 2020
Automatic SSL certificates from Let's Encrypt using Nginx and acme.sh in webroot mode
View acme-autocert.sh
#/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}' \
View ionic-rem.css
/*
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 / autobuild.sh
Created Aug 5, 2012
continuous CyanogenMod rebuilds using AndBot
View autobuild.sh
#!/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 * "
@jyio
jyio / config.sh
Created Apr 22, 2012
PengDroid: a healthy fusion of Debian and Android
View config.sh
#!/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
View system-alternatives
#!/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 / index.html
Created Apr 13, 2012
demonstration of bottle.py + subprocess
View index.html
<!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">
@jyio
jyio / mkicon.sh
Created Apr 10, 2012
generates png icons for android from svg
View mkicon.sh
#!/bin/sh
# usage:
# ./mkicon.sh <input> <purpose>
# example:
# ./mkicon.sh icon.svg launcher
mkicon() {
file_in="$1"
file_out="$2"
@jyio
jyio / musl-0.8.6-android.patch
Created Feb 25, 2012
libmusl, an extension wrapper around android's bionic, based on musl
View musl-0.8.6-android.patch
--- 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 / Makefile
Created Dec 19, 2011
build the CyanogenMod 9 preview for NOOK Color
View Makefile
## 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:
##