Skip to content

Instantly share code, notes, and snippets.

View aborilov's full-sized avatar
🕶️
Working from home

Pavel aborilov

🕶️
Working from home
View GitHub Profile
@aborilov
aborilov / test.py
Created January 9, 2013 15:34
example
#!/usr/bin/env python
'''
Pymodbus Asynchronous Processor Example
--------------------------------------------------------------------------
The following is a full example of a continuous client processor. Feel
free to use it as a skeleton guide in implementing your own.
'''
#---------------------------------------------------------------------------#
# import the neccessary modules
@aborilov
aborilov / server.cpp
Last active December 18, 2015 01:29
write to serial port
#include <sys/types.h>
#include <sys/stat.h>
#include <termios.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <unistd.h>
#define BAUDRATE B9600
#define DEVICE "/dev/ttySP2"
@aborilov
aborilov / gist:5719991
Created June 6, 2013 07:59
код тестовой программы 1
'''
Created on Jul 10, 2012
@author: pavel
'''
from twisted.internet.serialport import SerialPort
from twisted.protocols.basic import LineReceiver
from twisted.internet import protocol, reactor
import time
@aborilov
aborilov / gist:5719994
Created June 6, 2013 08:00
код второй тестовой программы
'''
Created on Jul 4, 2012
@author: pavel
'''
import serial
import time
import random
@aborilov
aborilov / gist:5720005
Created June 6, 2013 08:01
метод записи в порт
void ConnectionManager::need2send(QByteArray b){
turn2Write();
int sended = write(fd, b.data(), b.size());
#ifdef QT_DEBUG
if (sended != b.size())
QLOG_ERROR()<<"!!!!!!!!!!!!!NOT ALL SENDED!!!!ONLY: "<<sended;
#endif
tcflush(fd, TCOFLUSH);
opt.c_cc[VMIN] = sended; /* Minimum bytes available */
tcsetattr (fd, TCSANOW, &opt);
ifconfig | grep "inet addr" | grep -v 127.0.0.1 | awk -F ' ' '{print $2}' | awk -F ':' '{print $2}'
/* File generated by Qt Creator, version 2.4.1 */
import QmlProject 1.1
Project {
mainFile: "ErisQml.qml"
/* Include .qml, .js, and image files from current directory and subdirectories */
QmlFiles {
directory: "."
@aborilov
aborilov / gist:45a823a0de16eca2561d
Created September 2, 2014 08:10
vlc rtsp to mjpeg
vlc -I dummy -d rtsp://192.168.0.99/video.mjpg --no-sout-audio --sout "#transcode{vcodec=MJPG,vb=1000,fps=15}:standard{access=http{mime=multart/x-mix-replace;boundary=myboundary},mux=mpjpeg,dst=:8090/cam.mjpg}"
set nosmoothscroll
map <C-b> scrollPageUp
map <C-f> scrollPageDown
2014-10-31 09:36:12,861 WARNING init_log:70 Starting Qtile
2014-10-31 09:36:13,612 WARNING safe_import:27 Can't Import Widget: '.wlan.Wlan', No module named pythonwifi.iwlibs
2014-10-31 09:36:13,629 WARNING safe_import:27 Can't Import Widget: '.google_calendar.GoogleCalendar', No module named apiclient.discovery
2014-10-31 09:36:13,716 ERROR make_qtile:123 Qtile crashed during startup
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/qtile-0.8.0-py2.7.egg/EGG-INFO/scripts/qtile", line 120, in make_qtile
state=options.state,
File "/usr/local/lib/python2.7/dist-packages/qtile-0.8.0-py2.7.egg/libqtile/manager.py", line 125, in __init__
self.supporting_wm_check_window.wid
File "/usr/local/lib/python2.7/dist-packages/qtile-0.8.0-py2.7.egg/libqtile/xcbq.py", line 621, in set_property