Skip to content

Instantly share code, notes, and snippets.

Avatar

Serge Liskovsky prostosergik

View GitHub Profile
@prostosergik
prostosergik / Makefile
Last active May 4, 2019
TNE scooters controller via UART implementation
View Makefile
MCU=attiny13
FUSE_L=0x6A
FUSE_H=0xFF
F_CPU=1200000
CC=avr-gcc
LD=avr-ld
OBJCOPY=avr-objcopy
SIZE=avr-size
AVRDUDE=avrdude
CFLAGS=-std=c99 -Wall -g -Os -mmcu=${MCU} -DF_CPU=${F_CPU} -I. -I.. -DUART_RX_ENABLED -DUART_TX_ENABLED -DUART_BAUDRATE=19200
View main.c
#include "uart.h"
#include "rtc.c"
// Baud rate setting
#define BAUD 9600
void main(void) {
// Serial channel (9600, N,8,1)
uart_init((UART_BAUD_SELECT((BAUD),F_OSC)));
sei(); // interrupt enable
@prostosergik
prostosergik / mvd.sh
Created Jan 22, 2014
Script for quick virtual domain creation.
View mvd.sh
#!/bin/bash
HOST="Unknown";
if [ "$1" != "" ]; then
HOST="$1";
else
echo "Enter hosthame: ";
read HOST;
fi
@prostosergik
prostosergik / openwrt_downloader.php
Last active Dec 27, 2015
Tool to download latest OpenWRT firmware for TPLink WR703N. Can be used to crezte local repository.
View openwrt_downloader.php
<?php
$url = 'http://downloads.openwrt.org/snapshots/trunk/ar71xx/';
$local_dir = dirname(__FILE__).'/'.date('Y-m-d').'/';
$local_dir_packages = $local_dir.'packages/';
if(!is_dir($local_dir) || !is_dir($local_dir_packages)) {
mkdir($local_dir);
mkdir($local_dir_packages);