Start the worker:
celery -A tasks worker --loglevel=info -c 2 --pidfile=celery.pid
In another terminal send 6 tasks:
python script.py
import pygame | |
import pygame.camera | |
from pygame.locals import * | |
DEVICE = '/dev/video0' | |
SIZE = (640, 480) | |
FILENAME = 'capture.png' | |
def camstream(): | |
pygame.init() |
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
pm list packages -f |
"""Conversion between 6D Cartesian and spherical coordinates. | |
Cartesian6D represents the coordinates (x, y, z, xdot, ydot, zdot). | |
Spherical6D represents the coordinates (r, alpha, delta, rdot, | |
alphadot, deltadot). Alpha is the longitudinal angle and delta is the | |
latitudinal angle. The latter goes from 90 degrees at the +ve z-axis to | |
-90 at the -ve z-axis. | |
The Cartesian coordinates can have any units. The radial spherical | |
coordinate has the some unit as the input Cartesian |
import cv2 | |
import numpy as np | |
import itertools | |
lk_params = dict( winSize = (10, 10), | |
maxLevel = 5, | |
criteria = (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 10, 0.03)) | |
feature_params = dict( maxCorners = 3000, | |
qualityLevel = 0.5, |
git verify-pack -v .git/objects/pack/*.idx | grep blob | cut -c1-40,48- | cut -d' ' -f1,3 | sort -n -r --key 2 | head -500 > top-500-biggest-blobs.txt |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Image from Webcam</title> | |
<style type="text/css"> | |
video { display: block; margin: 0 auto; border: 10px solid #ccc; } | |
.button { margin: 10px auto; padding: 10px; background: #ccc; color: white; text-align: center; width: 200px; cursor: pointer; } | |
#container, |
# Thanking everyone who wished me on my birthday | |
import requests | |
import json | |
from time import strftime | |
AFTER = #convert your time to iso 8601 time | |
TOKEN = ' <insert token here> ' | |
def get_posts(): |
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate server.xml with the following command: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
# run as follows: | |
# python simple-https-server.py | |
# then in your browser, visit: | |
# https://localhost:4443 | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl |