Skip to content

Instantly share code, notes, and snippets.

View ekapujiw2002's full-sized avatar

Eka Puji Widiyanto ekapujiw2002

View GitHub Profile
@ekapujiw2002
ekapujiw2002 / bootstrap-tabs.html
Created May 23, 2016 05:05 — forked from mnewt/bootstrap-tabs.html
bootstrap tabs example
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Le styles -->
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
</head>
<body>
@ekapujiw2002
ekapujiw2002 / netflix-rpi.md
Created August 1, 2016 02:53 — forked from jesstelford/netflix-rpi.md
Netflix on Raspberry Pi (incomplete)

Note: as @clibois mentioned below, due to the DRM Netflix uses, all decoding has to be done in CPU, making it somewhat choppy.

Note 2: Even the RPi 3 suffers from these CPU limitations. There is the potentially risky option of overclocking your RPi 3, but I haven't tried this.

If you manage to get smooth playback, please contact me, or post your solution here

UPDATE: I can no longer get this method to work. I have tried using Chromium v47, and v48, and both result in Netflix error "Oops, something went wrong" / C7053-1807, for which I can find no description online. If you manage to get things up and running, please contact me!

OSMC

@ekapujiw2002
ekapujiw2002 / Tornado webserver MJPEG streamer
Created September 24, 2016 08:30 — forked from mstaflex/Tornado webserver MJPEG streamer
Python Tornado webserver that streams JPEGs (in img/) as MJPEG-Stream using asynchronous timed callbacks (yields), being able to handly many different streams at the same time
import tornado.ioloop
import tornado.web
import gen
import time
import os
import tornado
file_list = os.listdir("img")
counter = 0
@ekapujiw2002
ekapujiw2002 / archlinux-rpi3-serial-and-bluetooth.md
Created November 21, 2016 03:28 — forked from yeokm1/archlinux-rpi3-serial-and-bluetooth.md
Arch Linux Raspberry Pi 3 configuration to use both Serial Debug Port and Bluetooth

The new Raspberry Pi 3 released on 29 Feb 2016 has issues with its UART port as the pinout GPIO 14/15 on the pin header is now based on a low throughput mini-UART.

To understand the issue better than reading the wall of text below, you can see the talk I gave on this issue.

The actual hardware UART on the BCM2837 SoC has now been assigned to handle Bluetooth with the BCM43438 Wifi/Bluetooth chip. More details can be found here and here.

This mini-UART does not produce a stable baud rate as it fluctuates based on the Core clock speed whenever it rises or falls. The result is that the serial debug output is practically unusable. On Raspbian you may see garbage or nothing at all. The solution is simple, add core_freq=250 to /boot/config.txt to cap the core frequency to a constant value. This optio

@ekapujiw2002
ekapujiw2002 / Read-only FS on Raspbian.md
Created November 21, 2016 03:29 — forked from yeokm1/Read-only FS on Raspbian.md
Set up Raspbian on Raspberry Pi to boot from and use a read-only file-system
sudo apt-get update
sudo apt-get upgrade
sudo rm -rf opt
cd /var/log/ 
sudo rm `find . -type f`
sudo swapoff --all
sudo update-rc.d -f dphys-swapfile remove
sudo apt-get remove dphys-swapfile
sudo rm /etc/init.d/dphys-swapfile
@ekapujiw2002
ekapujiw2002 / Minimal Raspbian.md
Created November 21, 2016 03:29 — forked from yeokm1/Minimal Raspbian.md
Set of commands to strip down the default Raspbian installation as of 20 September 2014
rm -rf python_games
rm -rf Desktop

sudo apt-get --auto-remove --purge remove aptitude aptitude-common aspell aspell-en cifs-utils dbus dbus-x11 dconf-gsettings-backend:armhf dconf-service debconf-i18n debian-reference-common debian-reference-en desktop-base desktop-file-utils dictionaries-common dillo esound-common ed fbset firmware-atheros firmware-brcm80211 firmware-libertas firmware-ralink firmware-realtek fontconfig fontconfig-config fonts-droid fonts-freefont-ttf galculator gconf-service gconf2 gconf2-common gdb gdbserver gettext-base ghostscript gir1.2-glib-2.0 glib-networking:armhf glib-networking-common glib-networking-services gnome-icon-theme gnome-themes-standard-data gpicview groff-base gsettings-desktop-schemas gsfonts gsfonts-x11 gtk2-engines:armhf gvfs:armhf gvfs-backends gvfs-common gvfs-daemons gvfs-fuse gvfs-libs:armhf hicolor-icon-theme idle idle-python2.7 idle-python3.2 idle3 jackd jackd2 java-common krb5-locales leafpad lightdm lightdm-gtk-greeter lua5.1 luajit lxappearance lxde 
@ekapujiw2002
ekapujiw2002 / Octoprint on read-only Arch Linux ARM for Raspberry Pi.md
Created November 21, 2016 03:29 — forked from yeokm1/Octoprint on read-only Arch Linux ARM for Raspberry Pi.md
Use Octoprint on Arch Linux ARM with read-only file system for Raspberry Pi

I wanted Octoprint (a 3D-printer management software) to start up fast without the bloatness of using Raspbian. I also regularly forgot to shutdown the Raspberry Pi hosting Octoprint properly leading to file system corruption and unbootable SD card.

This set of instructions should provide all that is needed to use Octoprint without fear of improper shutdown with Arch Linux ARM by using a read-only file system.

This instructions does not have the webcam setup as I didn't intend to use it. If you wish to use the webcam, please consult and try to port the official Raspbian FAQ.

##Instructions

  1. Convert the Arch Linux ARM file system to read-only. Please follow the instructions from my previous gist. The following instructions assume you are logged into with the root account.
@ekapujiw2002
ekapujiw2002 / Read-only FS on Arch Linux ARM.md
Created November 21, 2016 03:29 — forked from yeokm1/Read-only FS on Arch Linux ARM.md
Set up Arch Linux ARM on Raspberry Pi to boot from and use a read-only file-system

##Read-only FS on Arch Linux ARM

Unlike your typical computer where you usually shutdown properly, I cannot rely on this during the use of my Raspberry Pi. If the Raspberry Pi is improperly shutdown too many times, data corruption in the file system leading to unbootable SD card may result. So we should use a read-only file system.

Full instructions and explanations are obtained from this link but you can run these commands directly. I modified some of the instructions for personal convenience.

Login with default username: alarm, password: alarm

#Optionally enable root over SSH. The rest of these instructions assume u are in root.
@ekapujiw2002
ekapujiw2002 / gist:19ec3df6f950528ddebfd40e82689625
Created January 18, 2017 06:56 — forked from jonaslejon/gist:4945730
Face recognition in Raspberry Pi with OpenCV and sound with espeak
#!env python
import cv,pprint,os
from datetime import datetime
HAAR_CASCADE_PATH = "/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml"
CAMERA_INDEX = 0
def detect_faces(image, last):
faces = []
@ekapujiw2002
ekapujiw2002 / crypto-pi-root.md
Created January 21, 2017 03:31 — forked from pezz/crypto-pi-root.md
Archlinux ARM encrypted root

Intro

Just some FYI, to get started:

  • I'm using a 16 GB Sandisk SD card.
  • I have a model B Pi, 512 MB RAM (not really relevant, thought I'd mention it).
  • Monitor and keyboard connected to the Pi itself, for now.
  • Network working, internet access.