Skip to content

Instantly share code, notes, and snippets.

View humboldt's full-sized avatar

Alexander humboldt

View GitHub Profile
@humboldt
humboldt / .bashrc
Created July 30, 2018 23:46 — forked from franga2000/.bashrc
My awesome .bashrc - feel free to steal stuff
# franga2000's .bashrc of awesomness
# Human-readable units
alias ll='ls -alh'
alias l='ls -CF'
alias du='du -h'
alias df='df -h'
alias free='free -h'
# Disaster prevention
@humboldt
humboldt / Xiaomi YI.md
Created July 30, 2018 23:44 — forked from franga2000/Xiaomi YI.md
Xiaomi Yi

#Xiaomi Yi camera

##General info

  • OS: Buildroot
  • CPU: ARMv6-compatible processor rev 5 (v6l)
  • BogoMIPS: 524.28
  • Memory: 37MB

The root filesystem is rootfs, which is stored in memory and therefore wiped on reboot. The Micro SD card is mounted at /tmp/fuse_d/. Something is also mounted at /tmp/fuse_a and /tmp/fuse_z.

@humboldt
humboldt / gist:ac5e81274412fcea420696bc54b49a97
Created July 30, 2018 23:37 — forked from cr3ative/gist:8337446
Drift HD Ghost WiFi Application API

Drift HD Ghost WiFi Application API

See my technical notes here, which include how to get root on a Drift HD Ghost with no modifications to the unit.

The following is a list of URLs which might be handy if you connect your machine to the Drift HD Ghost's WiFi network.

Live Video URL (works great in VLC)

rtsp://192.168.42.1/AmbaStreamTest
@humboldt
humboldt / Hugin-Mi-Sphere-Template.pto
Created July 30, 2018 23:30
Hugin template for Xiaomi Mi Sphere
# hugin project file
#hugin_ptoversion 2
p f2 w6912 h3456 v360 E13.7052 R0 n"TIFF_m c:NONE r:CROP"
m g1 i0 f0 m2 p0.00784314
# image lines
#-hugin cropFactor=1
i w6912 h3456 f2 v396.635230442757 Ra0 Rb0 Rc0 Rd0 Re0 Eev13.70516 Er1 Eb1 r0.00825082164820041 p1.44530867102748 y-179.842406724096 TrX0 TrY0 TrZ0 Tpy0 Tpp0 j0 a0 b0 c0 d-1664.3727797412 e0 g0 t0 Va1 Vb0 Vc0 Vd0 Vx0 Vy0 S90,3367,92,3369 Vm5 n"image.jpg"
#-hugin cropFactor=1
i w6912 h3456 f2 v388.424297290832 Ra0 Rb0 Rc0 Rd0 Re0 Eev13.70516 Er1 Eb1 r0.385796738657643 p-0.968200655049642 y-7.3874167823502 TrX0 TrY0 TrZ0 Tpy0 Tpp0 j0 a0 b0 c0 d1652.13282606849 e0 g0 t0 Va1 Vb0 Vc0 Vd0 Vx0 Vy0 S3555,6828,100,3373 Vm5 n"image.jpg"
@humboldt
humboldt / xiaomiprotocol.md
Created July 30, 2018 23:22 — forked from pbaja/xiaomiprotocol.md
Xiaomi Yi JSON Protocol Reverse Enginnering

Xiaomi Yi JSON Protocol Reverse Engineering

First, connect to your camera via WiFi. Then you can send data to 192.168.42.1:7878

HELP IS APPRICIATED

Get token

Request:

{"msg_id":257,"token":0}
#!/usr/bin/env python
import paho.mqtt.client as mqtt
import RPi.GPIO as GPIO
def on_connect(client, userdata, rc):
#print ("Connected with rc: " + str(rc))
client.subscribe("kwf/demo/led")
def on_message(client, userdata, msg):
@humboldt
humboldt / friendly_urls.markdown
Created February 13, 2017 17:14 — forked from cdmwebs/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

@humboldt
humboldt / si7021.c
Created February 1, 2017 15:39 — forked from user890104/si7021.c
Si7021 Linux app
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <linux/i2c-dev.h>
#define BYTES2SHORT(X) (X[0] << 8 | X[1])
@humboldt
humboldt / report.c
Created February 1, 2017 15:38 — forked from user890104/report.c
Si7021 collecting and reporting data to thingspeak.com
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/i2c-dev.h>
@humboldt
humboldt / autostart
Created February 1, 2017 09:32 — forked from gestadieu/autostart
Kiosk Mode for Raspbian Jessie (2017-01-11) with PIXEL, using Chromium browser
# autostart file in ~./.config/lxsession/LXDE-pi/
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
#@point-rpi
@xset s off #no screensaver
@xset -dpms #no energy saving
@xset s noblank
@sed -i 's/"exited_cleanly":false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences
@chromium-browser --incognito --noerrdialogs --disable-translate --kiosk {{your-url-here}}