Skip to content

Instantly share code, notes, and snippets.

@glisha
glisha / get.py
Last active Apr 7, 2020
Get availalbe free slots for online order by the AH
View get.py
#!/usr/bin/python3
"""
This script notifies you by mail when there are available time slots for online shopping at the AH.
./get.py --postcode 1111aa --to-mail <WHERE_TO_SEND_THE_ALLERT> --from-mail <GMAIL_SENDER_ADDRESS> --password <THEPASS>
"""
import json
import urllib.request
@glisha
glisha / arduino.ino
Created Oct 24, 2014
arduino+esp8266+relay
View arduino.ino
boolean wifiReady = 0;
boolean wifiConnected = 0;
void setup() {
pinMode(10,OUTPUT);
pinMode(13,OUTPUT);
digitalWrite(10,LOW);
digitalWrite(13,LOW);
Serial.begin(115200);
View .i3status-vga1.conf
general {
colors = true
interval = 20
output_format = "i3bar"
}
# order += "ipv6"
# order += "run_watch DHCP"
# order += "run_watch VPN"
#order += "wireless wlan0"
View mnogudetna.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#https://github.com/amueller/word_cloud
from wordcloud import WordCloud
#http://www.pmgrecordings.com/makedonide.php?id=113
#pdftotext
text = open("mnogudetna.txt").read().decode('utf-8')
View master.c
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"
String txtMsg = "";
char cmd[10]; //"state address", state=0|1, address=0..7
char s;
byte state;
byte address;
@glisha
glisha / 8chasa-grafik.sh
Last active Dec 20, 2015
ds1621 сензори врзани на Raspberry PI. Графирање со rrdtool.
View 8chasa-grafik.sh
#!/bin/bash
#*/15 * * * * /root/ds1621/8chasa-grafik.sh > /dev/null 2>&1
rrdtool graph /usr/share/nginx/html/temperatura_4f-8chasa.png \
--vertical-label "°C" \
--title "Температура сензор 4f последните 8 часа" \
--slope-mode \
--end now --start end-8h \
--width 500 --height 200 \
--watermark "`date`" \
@glisha
glisha / hatta.sh
Created Dec 24, 2012
nginx+uwsgi+hatta
View hatta.sh
#!/bin/bash
HATTADIR="/home/glisha/webapps/nginx/html/georgi.softver.org.mk.wiki"
/home/glisha/bin/uwsgi \
--pidfile $HATTADIR/run/uwsgi.pid \
--daemonize $HATTADIR/run/uwsgi.log \
--processes 1 \
--socket $HATTADIR/run/hatta.sock \
--wsgi-file $HATTADIR/hatta.wsgi \
@glisha
glisha / arduino_ethernet_cosm
Created Nov 26, 2012
arduino_ethernet_cosm
View arduino_ethernet_cosm
/*
Cosm sensor client
This sketch connects an analog sensor to Cosm (http://www.cosm.com)
using a Wiznet Ethernet shield. You can use the Arduino Ethernet shield, or
the Adafruit Ethernet shield, either one will work, as long as it's got
a Wiznet Ethernet module on board.
This example has been updated to use version 2.0 of the Cosm.com API.
To make it work, create a feed with a datastream, and give it the ID
@glisha
glisha / arduino.ino
Created Nov 24, 2012
MQ135 gas sensor
View arduino.ino
int sensorValue;
void setup(void) {
Serial.begin(9600);
}
void loop(void) {
// If we get a ping from the PC, dump the data
if (Serial.available()) {
@glisha
glisha / readout_to_cosm.py
Created Nov 17, 2012
Хаклаб on/off switch to cosm
View readout_to_cosm.py
#!/usr/bin/env python2.7
"""
Reads out the temp sensors from serial and posts them to https://cosm.com/feeds/86779
"""
import serial
import json
import requests
import time
import ConfigParser