Skip to content

Instantly share code, notes, and snippets.

#installed zbar with difficulty, main steps taken from https://github.com/NaturalHistoryMuseum/gouda
#what worked for me (executed from anaconda command prompt)
#conda update --all
#conda update --all
#python -m pip install --upgrade pip
#python <Anaconda dir>\Scripts\pywin32_postinstall.py -install
#python -m pip install pathlib
#python -m pip install numpy
#python -m pip install Pillow
#conda install -c menpo opencv
#!/bin/bash
# Don't forget to resize disk first. Use raspi-config from command line, expand filesystem and reboot before running this script
# INSTRUCTIONS:
# wget --no-check-certificate https://gist.github.com/mohankumargupta/b02b007b8c205673569a4ccae51a1f4f/raw/ffbcec3f49904629acff3173d8722b404c05bc2a/ethernetgadgetpizero.sh
# chmod 777 ethernetgadgetpizero.sh
# ./ethernetgadgetpizero.sh
set -x
cd ~
wget -O gadgetkernel.tgz http://adafruit-download.s3.amazonaws.com/gadgetmodulekernel_151226a.tgz
tar xvzf gadgetkernel.tgz
(Taken from http://blog.gbaman.info/?p=791)
1. Install Bonjour Print Services (https://support.apple.com/kb/DL999)
2. Start from scratch, copy Raspian Jessie to SD card (can use SDFormatter to clean SD card).
3. Open SD Card in File Explorer
add to bottom of config.txt:
dtoverlay=dwc2
change cmdline.txt to something like the following:
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_ether quiet init=/usr/lib/raspi-config/init_resize.sh
4. eject SD card, put into pi zero and boot.
5. Wait 2 minutes, plug in USB cable, and then try to SSH to raspberrypi.local
from functools import reduce
mylist = [
(0,0),
(0,0),
(5, 5),
(10,10),
(10,10),
(-2,-3),
(0,0)
#!/usr/bin/env bash
#apt-get -y install php5-cli php5-gd php5-curl php5-mysql git
#set -x
disown >/dev/null 2>/dev/null
ps aux|grep php|head -n -1|cut -f6 -d' '| xargs -I {} kill {}
if [ -z "$1" ];
then
echo "Must enter a project name"
exit 1
import requests
import json
headers = {'Authorization': 'Bearer 49beba867bca3b08df1252f837197b27ab529166'}
query_graphql = '''
query {
repository(owner: "mohankumargupta", name: "raspberrypi-ansible") {
ref(qualifiedName: "master") {
target {
#!/usr/bin/bash
which ansible >/dev/null 2>&1
if [ $? -ne 0 ];
then
echo "Installing Ansible..."
sleep 5
pushd .
cd ~
pacman -S libyaml-devel python2 tar libffi libffi-devel gcc pkg-config make openssl-devel openssh --noconfirm --needed
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
[
{
"id": "75b64b94.0fd5b4",
"type": "tab",
"label": "sunposition",
"disabled": false,
"info": ""
},
{
"id": "4bffb431.af3aac",
#!/bin/bash
#-------------------------------------------------
losetup --show -f -P somediskimage.img
fdisk -l
#----------------------------------------------
fc-list
#!/bin/bash
set -x
sudo apt-get update
sudo apt-get install -y libatlas-base-dev
sudo pip3 install tensorflow
sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install qt4-dev-tools
sudo pip3 install opencv-python