# 使用 Homebrew 安装 aria2
brew install aria2
# 创建配置文件aria2.conf和空对话文件aria2.session
mkdir ~/.aria2 && cd ~/.aria2
touch aria2.conf
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
Source: http://datahugger.org/datascience/setting-up-hadoop-v2-with-spark-v1-on-osx-using-homebrew/ | |
This post builds on the previous setup Hadoop (v1) guide, to explain how to setup a single node Hadoop (v2) cluster with Spark (v1) on OSX (10.9.5). | |
Apache Hadoop is a framework that allows for the distributed processing of large data sets across clusters of computers using simple programming models. It is designed to scale up from single servers to thousands of machines, each offering local computation and storage. Rather than rely on hardware to deliver high-availability, the library itself is designed to detect and handle failures at the application layer, so delivering a highly-available service on top of a cluster of computers, each of which may be prone to failures. The Apache Hadoop framework is composed of the following core modules: | |
HDFS (Distributed File System): a distributed file-system that stores data on commodity machines, providing very high aggregate bandwidth across the cluster. | |
YARN (Yet A |
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/sh | |
## install python if it isn't already installed, e.g. ## | |
#sudo apt-get install python | |
# remove problematic dist versions of pip and pyserial | |
sudo apt-get remove python-pip -y | |
sudo apt-get remove python-pyserial -y | |
# optional - python-serial includes other dependencies that can be cleaned up | |
sudo apt-get autoremove |
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/sh | |
sudo apt-get install -y dosfstools parted kpartx rsync | |
df=`df -P | grep /dev/root | awk '{print $3}'` | |
dr=`df -P | grep /dev/mmcblk0p1 | awk '{print $2}'` | |
df=`echo $df $dr |awk '{print int(($1+$2)*1.2)}'` | |
sudo dd if=/dev/zero of=raspberrypi.img bs=1K count=$df | |
sudo parted raspberrypi.img --script -- mklabel msdos | |
start=`sudo fdisk -l /dev/mmcblk0| awk 'NR==10 {print $2}'` | |
start=`echo $start's'` | |
end=`sudo fdisk -l /dev/mmcblk0| awk 'NR==10 {print $3}'` |
refer to: https://stackoverflow.com/questions/39371772/how-to-install-anaconda-on-raspberry-pi-3-model-b
{USER}: pi
Install Miniconda 3:
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-armv7l.sh
sudo md5sum Miniconda3-latest-Linux-armv7l.sh # (optional) check md5
sudo /bin/bash Miniconda3-latest-Linux-armv7l.sh # -> change default directory to /home/pi/miniconda3
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 processing.video.*; | |
Capture cam; | |
void setup() { | |
size(640, 480); | |
cam = new Capture(this, 640, 480); | |
cam.start(); | |
} |
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
# Make a function that does a half and half image. | |
def halfsies(left,right): | |
result = left | |
# crop the right image to be just the right side. | |
crop = right.crop(right.width/2.0,0,right.width/2.0,right.height) | |
# now paste the crop on the left image. | |
result = result.blit(crop,(left.width/2,0)) | |
# return the results. | |
return result | |
# Load an image from imgur. |
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 SimpleCV import Image, Color, Display | |
# Make a function that does a half and half image. | |
def halfsies(left,right): | |
result = left | |
# crop the right image to be just the right side. | |
crop = right.crop(right.width/2.0,0,right.width/2.0,right.height) | |
# now paste the crop on the left image. | |
result = result.blit(crop,(left.width/2,0)) | |
# return the results. |
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 urllib.request | |
import urlopen | |
from bs4 | |
import BeautifulSoup | |
import re | |
pages = set() | |
def getLinks(pageUrl): | |
global pages | |
html = urlopen("http://en.wikipedia.org"+pageUrl) |
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
// Include the required Wire library for I2C<br>#include <Wire.h> | |
int LED = 13; | |
int x = 0; | |
void setup() { | |
// Define the LED pin as Output | |
pinMode (LED, OUTPUT); | |
// Start the I2C Bus as Slave on address 9 | |
Wire.begin(9); | |
// Attach a function to trigger when something is received. | |
Wire.onReceive(receiveEvent); |
NewerOlder