Skip to content

Instantly share code, notes, and snippets.

View pandax381's full-sized avatar

YAMAMOTO Masaya pandax381

View GitHub Profile
@pandax381
pandax381 / softfloat_test2.c
Created August 17, 2017 04:02
Berkeley SoftFloat test 2
#include <stdio.h>
#include "softfloat.h"
int
main (void) {
float32_t a = {0x3F800000};
float32_t b = {0x40000000};
float32_t c = f32_add(a, b);
fprintf(stderr, "0x%x (%ld) + 0x%x (%ld) = 0x%x (%ld)\n",
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat
group: compat
shadow: compat
gshadow: files
@pandax381
pandax381 / arduino-esp-mruby.ino
Created June 21, 2018 07:11
mruby on arduino-esp32
#include <stdint.h>
#include "sdkconfig.h"
#include "mruby.h"
#include "mruby/irep.h"
#include "mruby/compile.h"
#include "mruby/error.h"
#include "mruby/string.h"
const uint8_t mrbcode[] = {
0x45,0x54,0x49,0x52,0x30,0x30,0x30,0x34,0x4f,0x5a,0x00,0x00,0x01,0x47,0x4d,0x41,
@pandax381
pandax381 / arduino-esp32-mruby.md
Last active June 25, 2018 01:33
arduino-esp32 に mruby を組み込む手順

mruby本体の準備

$ export ARDUINO_ESP32_ROOT=$HOME/Documents/Arduino/hardware/espressif/esp32
$ cd $ARDUINO_ESP32_ROOT
$ mkdir mruby
$ cd mruby
$ git clone https://github.com/mruby/mruby.git
$ cd mruby 
$ git checkout 1.4.1
@pandax381
pandax381 / image
Created July 10, 2018 09:47
/usr/share/initramfs-tools/scripts/image
# -*- shell-script -*-
image_mount_storage()
{
local mnt="$1"
local_top
local_device_setup "${ROOT}" "usb storage"
ROOT="${DEV}"
@pandax381
pandax381 / tcptwreuse.py
Last active April 18, 2019 10:15
Trace reuse TCP connection in TIME_WAIT state
#!/usr/bin/python
from __future__ import print_function
from bcc import BPF
from socket import inet_ntop, ntohs, AF_INET, AF_INET6
from struct import pack
b = BPF(text="""
#include <uapi/linux/ptrace.h>
#include <net/sock.h>
@pandax381
pandax381 / ipmond.c
Created May 17, 2019 09:18
Detect add/delete IP address to interface on Linux
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <linux/rtnetlink.h>
#include <linux/if.h>
function FindProxyForURL(url, host){
return "SOCKS5 127.0.0.1:8080; DIRECT";
}
@pandax381
pandax381 / matrix_test.ino
Created September 16, 2020 11:00
FastLED_NeoMatrix Test
#include <M5StickC.h>
#include <Adafruit_GFX.h>
#include <FastLED.h>
#include <FastLED_NeoMatrix.h>
#define PIN 26
#define mw 18
#define mh 7
#define NUMMATRIX (mw*mh)
@pandax381
pandax381 / ix2215.txt
Created February 26, 2023 19:19
MAP-E Gateway for use with UniFi UDM
ip ufs-cache max-entries 20000
ip ufs-cache enable
ip route default Tunnel0.0
!
ipv6 ufs-cache enable
!
ipv6 dhcp client-profile dhcpv6-cl
information-request
option-request dns-servers
!