Skip to content

Instantly share code, notes, and snippets.

@tearitco
tearitco / cross-compiler.sh
Created March 6, 2022 09:33 — forked from bijanebrahimi/cross-compiler.sh
build a linux cross compiler for FreeBSD targets
#!/bin/bash
export TARGET=amd64-marcel-freebsd9.2
export PREFIX=/usr/cross-build
export TARGET_PREFIX=$PREFIX/$TARGET
export PATH=$PATH:$PREFIX/bin
mkdir -p $TARGET_PREFIX{,/lib,/include}
mkdir build-{binutils,gmp,mpfr,mpci,gcc}
@tearitco
tearitco / gist:937018bca3e34f194a85fb3535053723
Created February 26, 2022 00:15 — forked from gtklocker/gist:3848312
Minimal Greek to Greeklish converter (capital letters only)
# coding: utf-8
import sys
alphabet = {
'Α': 'A',
'Β': 'B',
'Γ': 'G',
'Δ': 'D',
'Ε': 'E',
'Ζ': 'Z',
@tearitco
tearitco / t9.md
Created February 23, 2022 10:41 — forked from cijogeorge/t9.md
T9 Predictive Text Implementation in C

T9 Predictive Text Implementation in C

Note: This piece of code was written and tested in 2008.

/* =================

Dependency: This program needs a file called t9.dic, A file with lots of words to populate our t9 trie structure. All in small letter no spaces no other characters Terminated by a line with only a 0 (zero)
@tearitco
tearitco / 4.12 vanilla L2. L1 crash
Created February 18, 2022 06:00 — forked from soccertack/4.12 vanilla L2. L1 crash
L2 crash during boot.. Even with EL1 to EL2 conv.
[L1 ~]#
[L1 ~]# Internal error: Oops: 86000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 1529 Comm: qemu-system-aar Tainted: G W 4.12.0+ #10
Hardware name: linux,dummy-virt (DT)
task: ffff80007d6df080 task.stack: ffff80007b630000
PC is at 0x0
LR is at 0x0
pc : [<0000000000000000>] lr : [<0000000000000000>] pstate: 60400145
sp : ffff80003e86fc80
@tearitco
tearitco / JB-SON with JS.md
Created November 21, 2021 06:03 — forked from laurenancona/JSON with JS.md
Access local JSON data with Javascript

What

An updated guide/collection of guides on how to access JSON data with JavaScript

Original Question on Stack Exchange.


Example 1

For reading the external Local JSON file (data.json) using java script

@tearitco
tearitco / start.asm
Created November 15, 2021 21:46 — forked from olsner/start.asm
; vim:ts=8:sts=8:sw=8:filetype=nasm:
; This is the real bootstrap of the kernel, and
; it is this part that is loaded by the boot sector (boot.asm)
org 0
bits 16
%macro define_descriptor 6 ; 0-6 0,0,0,0,0,0
dw %1 ;seg_limit
dw %2 ;addr_00_15
@tearitco
tearitco / crc32-gm.asm
Created October 25, 2021 09:25 — forked from iamgreaser/crc32-gm.asm
self-CRC32, x86 asm, 81 bytes, 0x7FC6582F
bits 16
org 0x0100
cpu 8086
code_start:
; SI = start, CX = length, DX:BX = initial CRC
mov si, code_start
mov cx, code_end - code_start
xor bx, bx
dec bx
@tearitco
tearitco / crc32-gm.asm
Created October 25, 2021 09:25 — forked from iamgreaser/crc32-gm.asm
self-CRC32, x86 asm, 81 bytes, 0x7FC6582F
bits 16
org 0x0100
cpu 8086
code_start:
; SI = start, CX = length, DX:BX = initial CRC
mov si, code_start
mov cx, code_end - code_start
xor bx, bx
dec bx
@tearitco
tearitco / create_boot_usb_osx.md
Created October 16, 2021 14:21 — forked from jyap808/create_boot_usb_osx.md
Create a bootable USB stick on OS X

##Create a bootable USB stick on OS X

Convert the .iso file to .img using hdiutil

Note: OS X tends to put the .dmg ending on the output file automatically.

$ hdiutil convert -format UDRW -o target.img source.iso
Reading Master Boot Record (MBR : 0)…
Reading Ubuntu 13.10 i386                (Apple_ISO : 1)…
@tearitco
tearitco / Edit_Repack_ISO_tutorial.md
Created October 16, 2021 14:21 — forked from AkdM/Edit_Repack_ISO_tutorial.md
Edit and repack .iso bootable image

On Linux

Installing mkisofs

apt-get install mkisofs

Editing ISO image

mkdir /tmp/custom_iso