Skip to content

Instantly share code, notes, and snippets.

View notthetup's full-sized avatar
🔊

Chinmay Pendharkar notthetup

🔊
View GitHub Profile
// Enable GPIO D
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
// Initialize GPIO for PD15 (DAC Clear Pin)
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
@notthetup
notthetup / uc.md
Created November 13, 2016 01:40
Hackware Nov 2016 Favourite micro-controller
# micro-controller favourites
1 Arduino 13
2 RPi 4
3 STM32 3
4 Particle Photon 2
5 PIC32 1
6 PC104 1
7 Intel 8080 1
8 ESP32 1
#! /bin/sh
# /etc/init.d/autoconnectnet
### BEGIN INIT INFO
# Provides: noip
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Simple script to start a program at boot
@notthetup
notthetup / sakis3g.conf
Created September 12, 2016 13:36
sakis3g.conf for Singtel hiCard! using a Prolink PSH600
OTHER="USBMODEM"
USBMODEM="19d2:1545"
USBINTERFACE="2"
CUSTOM_APN="internet"
APN_USER="0"
APN_PASS="0"
NOSMART
@notthetup
notthetup / wvdial.conf
Last active September 24, 2017 03:18
Prolink PHS600 network
[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 460800
ISDN = 0
Phone = *99#
Stupid Mode = 1
Username = 0
Password = 0
@notthetup
notthetup / beaglebone.md
Last active August 24, 2016 00:51
Setting up Beaglebone

Setting up the Beagle Bone from Scratch

Install Debian.

  • Get latest Debian (8.4) from BeagleBone latest images.
  • Flash the .img onto the SDCard using dd if=bone-debian-8.4-lxqt-4gb-armhf-2016-05-13-4gb.img of=/dev/rdisk2 bs=64m
  • Restart the BB and connect over USB. It should as USB Mass Storage
  • Install the RNDIS drivers from the mounted USB Mass Storage.
  • If you are on OSX El Capitan, you might need to use this RNDIS driver
  • Restart the Host machine and BB and it will enumerate as a Network interface.
  • SSH to the BB using ssh root@192.168.7.2
@notthetup
notthetup / shannontalks.md
Last active May 5, 2016 12:20
Talk related to Shannon and Information Theory happening in SG, May 2015
@notthetup
notthetup / onboot.sh
Last active March 17, 2016 03:37
Measuring boot time.
echo "$(date +"%Y-%m-%d %H:%M:%S") Booted. Uptime : $(cat /proc/uptime | cut -d' ' -f 1)" >> /home/odroid/boottime.log
java -jar /home/odroid/unetsim-1.3-SNAPSHOT/lib/groovy-all-2.4.4.jar /home/odroid/unetsim-1.3-SNAPSHOT/samples/boottime/boottime.groovy
@notthetup
notthetup / runstream.sh
Last active March 7, 2017 15:30
SAUVC Streaming
#!/bin/bash
echo ".. waiting for network .."
while ! ping -c1 8.8.8.8 &>/dev/null; do sleep 1; done
export domain='sauvc2017-lab1'
# export domain='sauvc2017-lab2'
echo ".. fetching script .."
@notthetup
notthetup / mqtt.py
Created January 16, 2016 10:55
mqtt with piglow on RPi
import mosquitto as mqtt
from piglow import PiGlow
piglow = PiGlow()
# The callback for when the client receives a CONNACK response from the server.
def on_connect(client, userdata, rc):
print("Connected with result code "+str(rc))
# Subscribing in on_connect() means that if we lose the connection and