Skip to content

Instantly share code, notes, and snippets.

@pho
pho / README.md
Created April 14, 2020 22:01
Export a PNG of the cropped content of the view/selection

Put the python script in the GIMP plug-ins folder and restart GIMP

Find which folder that is in Edit / Preferences / Folders / Plug-ins

Re: Recipes for debugging exceptions ...
Postby ESP_Sprite » Mon Sep 26, 2016 4:03 am
You have a few methods to debug stuff like this. Three of them are:
1) You didn't know this was going to happen and just have the message you mentioned.
You can use gdb to figure out what PC and (sometimes) A0 refer to. PC is indeed the Program Counter and usually is the address of the instruction causing the exception. A0, if the compiler hasn't decide to overwrite its value with something else, is the address of the instruction calling the function that crashed. Take care that because of how the Xtensa core works, the leftmost digit of the hex number may be off and you have to manually correct it to '4'. For example, for A0 = 0x800D1234, you would want to look up 0x400D1234.
Okay, say you have a PC or A0 that seems valid, what now? You can use gdb to look up what it is. (given your source tree is in the same state as when you flashed your program. If you changed stuff in the mean time, results will be off.) Say you have
@pho
pho / debounce.c
Created July 19, 2017 12:16
CHIP Pro PIO Interrupt Debounce Register Clock select
/*
CHIP Pro PIO Interrupt Debounce Register Clock select
https://github.com/NextThingCo/CHIP-Hardware/blob/master/CHIP%5Bv1_0%5D/CHIPv1_0-BOM-Datasheets/Allwinner%20R8%20User%20Manual%20V1.1.pdf
Page 342
0: 32kHz
1: 24MHz
*/
@pho
pho / 50-vmmouse.conf
Created May 26, 2014 08:20
RAT5 XOrg config
[pho@asgard ~]$ cat /etc/X11/xorg.conf.d/50-vmmouse.conf
Section "InputDevice"
Identifier "RAT5"
Driver "evdev"
Option "Name" "Saitek Cyborg R.A.T.5 Mouse"
Option "Vendor" "0738"
Option "Product" "1705"
Option "Protocol" "auto"
Option "Device" "/dev/input/by-id/usb-Mad_Catz_Mad_Catz_R.A.T.5_Mouse-event-mouse"
Option "Emulate3Buttons" "no"
@pho
pho / keybase.md
Created May 17, 2014 18:24
keybase.md

Keybase proof

I hereby claim:

  • I am pho on github.
  • I am pho (https://keybase.io/pho) on keybase.
  • I have a public key whose fingerprint is DD59 5422 AFAD 5387 D168 DE5F 8ED6 8EF3 D5C7 8350

To claim this, I am signing this object:

@pho
pho / emokit_game.py
Created May 6, 2014 09:32
Pygame basics
import pygame
from time import sleep
pygame.init()
window = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Control Mental")
white = pygame.Color(255, 255, 255)
black = pygame.Color(0, 0, 0)
@pho
pho / FAQ
Last active August 29, 2015 13:58
Spanish SRL FAQ Rules
Preguntas Frecuentes
¿Qué es Speedrunning?
Speedrunning no es más que jugar un juego con la intención de terminarlo lo más rápido posible.
¿Qué es SpeedRunsLive?
SpeedRunsLive es una comunidad basada en speedrunning después de que la popularidad del livestreaming se diera a conocer.
Algunas cosas principales de SRL:
Un directorio de streams, para encontrar transmiciones en vivo de speedruns.
Una plataforma de carreras speedrun ricamente desarrollado.
Una comunidad popular de IRC
Estamos constantemente en desarrollo. La próxima mejora en la que estamos trabajando es en create un sistema de cuentas (para loguearse y editar tu perfil detalladamente), más formas de estar en la página de streams y una tabla de posiciones de SRL (un lugar para publicar carreras(runs) y estar en un ranking contra otros speedrunners).
@pho
pho / Wind Waker Hacking
Last active December 27, 2015 05:59
My Wind Waker romhacking notes
Tools:
Wind Viewer -> Edit game files
GCRebuilder -> Extract rom files
Rebuild rom from files
[!] Import a file with <2KiB changes directly into a rom, without rebuilding
Wind Viewer notes:
* 'Name' is relevant.
http://wiki.spinout182.com/w/Zelda_GCN:_DZx_files refears to it as 'type'
@pho
pho / PKGBUILD
Last active December 27, 2015 00:59
dianara-git PKGBUILD
# Maintainer: pho <pho@gatchan.org>
pkgname=dianara-git
pkgver=1059.4687ca1
pkgrel=1
pkgdesc="A Qt pump.io client"
arch=( 'i686', 'x86_64')
url="https://gitorious.org/dianara/dianara-dev/"
license=('GPL')
depends=('qjson>=0.7' 'qoauth>=1.0' 'qca-ossl')
makedepends=('git' 'qconf' 'qt4')
@pho
pho / gist:1016595
Created June 9, 2011 12:00
Dirty Pastebin script
import os
import re
import urllib2
import sys
import time
while True:
archive = urllib2.urlopen("http://pastebin.com/archive")
u = []