-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev-setup.sh
executable file
·43 lines (36 loc) · 972 Bytes
/
dev-setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
apt-get install python-pip
pip install tornado
ufw status
ufw allow 8888/tcp
ufw allow ssh
ufw enable
#
# To find the raw barcode scanner input device:
#
readlink -f $(ls -1 /dev/input/by-id/* | grep Electron_Company)
sudo python scan.py -d $(readlink -f $(ls -1 /dev/input/by-id/* | grep Electron_Company))
#
# Enable/disable barcode scanner as a keyboard:
#
export DISPLAY=:0
xinput --list
xinput --disable 16
xinput --enable 16
#
# If you download the GTIN POD database in CSV form:
#
# http://pod.opendatasoft.com/explore/dataset/pod_gtin/export/
#
# The lines are seperate by Windows line endings '\r\n'. This
# messes up the import script, so run this command:
#
# cat pod_gtin.csv | tr -d '\n' | tr '\r' '\n' > pod_gtin-sanitized.csv
#
# Next, we prune away most of the columns:
#
# cat pod_gtin-sanitized.csv | cut -d';' -f1,2 > pod_gtin-pruned.csv
#
# Run cart.py to host the server.
crontab -e
@reboot ~/dev/cart/cart.py >/dev/null 2>&1