This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note: This just aligns the position of the textblock, not the text itself. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PythonMagick | |
from pyPdf import PdfFileWriter,PdfFileReader | |
input1 = PdfFileReader(file('/home/steph/menu.pdf', 'rb')) | |
p2=input1.getPage(1) | |
writer=PdfFileWriter() | |
writer.addPage(p2) | |
import io | |
f=io.BytesIO() | |
writer.write(f) | |
blob=pm.Blob(f.read()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: mosquitto | |
# Required-Start: $local_fs $remote_fs $network | |
# Required-Stop: $local_fs $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start or stop the mosquitto service | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import getopt | |
import sys | |
from sqlalchemy import create_engine, MetaData, Table | |
from sqlalchemy.dialects.mysql.base import TINYINT | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.exc import ProgrammingError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
# | |
# Connects to a Wifi network | |
# | |
import os | |
def commandExists(command): | |
def canExecute(file): | |
return os.path.isfile(file) and os.access(file, os.X_OK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import zmq | |
from zmq.devices.basedevice import ProcessDevice | |
from multiprocessing import Process, Pool | |
def create_socket(socket_type,uri): | |
context = zmq.Context() | |
socket = context.socket(socket_type) | |
socket.connect(uri) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ctypes import WINFUNCTYPE, windll | |
from ctypes.wintypes import BOOL, DWORD | |
import zmq | |
kernel32 = windll.LoadLibrary('kernel32') | |
PHANDLER_ROUTINE = WINFUNCTYPE(BOOL, DWORD) | |
SetConsoleCtrlHandler = kernel32.SetConsoleCtrlHandler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import uuid | |
import wtforms_json | |
from sqlalchemy import not_ | |
from sqlalchemy.dialects.postgresql import UUID | |
from wtforms import Form | |
from wtforms.fields import FormField, FieldList | |
from wtforms.validators import Length | |
from flask import current_app as app | |
from flask import request, json, jsonify, abort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>Chrome File API tester</title> | |
<script> | |
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Bluetooth/Pyjnius example | |
========================= | |
This was used to send some bytes to an arduino via bluetooth. | |
The app must have BLUETOOTH and BLUETOOTH_ADMIN permissions (well, i didn't | |
tested without BLUETOOTH_ADMIN, maybe it works.) | |
Connect your device to your phone, via the bluetooth menu. After the | |
pairing is done, you'll be able to use it in the app. |
NewerOlder