Skip to content

Instantly share code, notes, and snippets.

@root42
root42 / # guile - 2019-01-15_05-52-06.txt
Created Jan 15, 2019
guile on "CentOS release 6.9 (Final)" - Homebrew build logs
View # guile - 2019-01-15_05-52-06.txt
Homebrew build logs for guile on "CentOS release 6.9 (Final)"
Build date: 2019-01-15 05:52:06
@root42
root42 / # shellcheck - 2018-12-20_14-24-55.txt
Created Dec 20, 2018
shellcheck on Ubuntu 18.04.1 LTS - Homebrew build logs
View # shellcheck - 2018-12-20_14-24-55.txt
Homebrew build logs for shellcheck on Ubuntu 18.04.1 LTS
Build date: 2018-12-20 14:24:55
@root42
root42 / silent-night-omega2.py
Last active Dec 18, 2018
Plays "silent night" on a piezo buzzer attached to pin 18 of the Onion Omega2
View silent-night-omega2.py
#!/usr/bin/env python
# Plays "silent night" on a piezo buzzer attached to pin 18 of the Onion Omega2
# Things required: python lite, pwm needs to be enabled via:
# omega2-ctrl gpiomux set pwm0 pwm
from time import sleep
exportStr="/sys/class/pwm/pwmchip0/export"
periodStr="/sys/class/pwm/pwmchip0/pwm%s/period"
dutyStr="/sys/class/pwm/pwmchip0/pwm%s/duty_cycle"
@root42
root42 / silent-night-pi-buzzer.c
Last active Dec 18, 2018
Playing "Silent Night" on a piezo buzzer attached to RasPi pin 35 (GPIO19/PWM1)
View silent-night-pi-buzzer.c
// compile and run using (requires root access):
// gcc -W -Wall buzzer.c -o buzzer -lpigpio -lpthread && sudo ./buzzer
#include <pigpio.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
// GPIO19 is PWM1
View fire.c
#include <stdio.h>
#include <stdlib.h>
#include <alloc.h>
#include <conio.h>
#include <dos.h>
#include <mem.h>
#define VIDEO_INT 0x10
#define SET_MODE 0x00
#define VGA_256_COLOR_MODE 0x13
@root42
root42 / ws2812_plasma.py
Last active Jan 21, 2019
rpi_ws218x example program: plasma effect
View ws2812_plasma.py
#!/usr/bin/env python
import time
import math
import colorsys
from neopixel import *
# LED strip configuration:
LED_COUNT = 128 # Number of LED pixels.
LED_PIN = 18 # GPIO pin connected to the pixels (must support PWM!).
LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz)
View README.md

Coredump contains stack information as well. If you can use this stack information along with the EBP and EIP register values in the coredump file, you can print the stack trace. I had written a program to do this. You can find the program in the following link.

https://gist.github.com/root42/c979b037f85dc4b2be1f3735afedeb1d

Usage: Compile the above program and give the corefile when you execute it.

   $corestrace core

If you want symbols also to be printed, you do like this: Let's assume the program that generated the core is 'test'.

You can’t perform that action at this time.