Dump existing data:
python3 manage.py dumpdata > datadump.json
Change settings.py to Postgres backend.
Make sure you can connect on PostgreSQL. Then:
1 x Pololu DRV8835 Dual Motor Driver Shield for Arduino = @ $10.00 ea. | |
1 x Romi Chassis Kit - Pink = @ $40.00 ea. | |
1 x RedBoard - Programmed with Arduino = @ $31.00 ea. | |
1 x RedBot Sensor - Mechanical Bumper = @ $7.00 ea. | |
Depending on how much you want to thrash the motors, you might want a replacement regulator to power the RedBoard (knock off arduino) so you can use fewer batteries and run the whole thing at a lower voltage. Pololu 5V Step-Up/Step-Down Voltage Regulator S7V8F5 will give you 5v to feed in to the RedBoard's Vcc after the regulator. | |
Whatever sensors appeal to you, here are some suggestions: | |
1 x Mini Photocell = @ $1.00 ea. | |
1 x Ultrasonic Range Measurement Module - HC-SR04 = @ $7.00 ea. |
# Taxonomy terms: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php | |
# Menu links: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php | |
# File items: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php | |
# Nodes: |
# First, make a dump of the database without data (-s) | |
$ pg_dump -h localhost -U username -Fc -s -f db_dump dbName | |
# Create a list of the functions | |
$ pg_restore -l db_dump | grep FUNCTION > function_list | |
# Restore the functions in an other database | |
$ pg_restore -h localhost -U username -d other-dbName -L function_list db_dump |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
require 'tire' | |
# Tire.configure { logger STDERR, level: 'debug' } | |
Tire.index('movie-titles') do | |
delete | |
create \ | |
settings: { | |
index: { | |
analysis: { |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |