This file contains hidden or 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 | |
| # Fresh install for CUDA 6.5 on Jetson TK1 for Linux for Tegra (L4T) 21.1 | |
| # CUDA 6.5 REQUIRES L4T 21.1 !!! | |
| sudo apt-add-repository universe | |
| sudo apt-get update | |
| # This is for L4T r21.1 ; Update for your L4T i.e. r21.3 | |
| wget http://developer.download.nvidia.com/compute/cuda/6_5/rel/installers/cuda-repo-l4t-r21.1-6-5-prod_6.5-14_armhf.deb | |
| # Install the CUDA repo metadata that you downloaded | |
| # This is for L4T 21.1 ; Update for your L4T i.e. 21.3 |
This file contains hidden or 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
| #!/usr/bin/python | |
| # A simple example of a threaded TCP server in Python. | |
| # | |
| # Copyright (c) 2012 Benoit Sigoure All rights reserved. | |
| # | |
| # Redistribution and use in source and binary forms, with or without | |
| # modification, are permitted provided that the following conditions are met: | |
| # - Redistributions of source code must retain the above copyright notice, | |
| # this list of conditions and the following disclaimer. | |
| # - Redistributions in binary form must reproduce the above copyright notice, |
This file contains hidden or 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
| // 參考資料: | |
| // trim: http://stackoverflow.com/questions/1418050/string-strip-for-javascript | |
| // tcp server: http://www.giantflyingsaucer.com/blog/?p=952 | |
| // http://nodejs.org/api/net.html#net_socket_remoteaddress | |
| if (typeof(String.prototype.trim) === "undefined") { | |
| String.prototype.trim = function(){ | |
| return String(this).replace(/\r+|\n+|\s+|\s+$/g, ''); | |
| }; | |
| }; |
This file contains hidden or 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
| /* | |
| In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
| server, but for some reason omit a client connecting to it. I added an | |
| example at the bottom. | |
| Save the following server in example.js: | |
| */ | |
| var net = require('net'); |
This file contains hidden or 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
| // Load the TCP Library | |
| net = require('net'); | |
| // Keep track of the chat clients | |
| var clients = []; | |
| // Start a TCP Server | |
| net.createServer(function (socket) { | |
| // Identify this client |
This file contains hidden or 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
| sudo apt-get install libatk1.0-0 libc6 libasound2 libcairo2 libcups2 libexpat1 libfontconfig1 libfreetype6 libglib2.0-0 libgnome-keyring0 libgtk2.0-0 libpam0g libpango1.0-0 libpci3 libpcre3 libpixman-1-0 libpng12-0 libspeechd2 libstdc++6 libsqlite3-0 libx11-6 libxau6 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxrandr2 libxrender1 libxtst6 zlib1g apache2.2-bin bison curl elfutils fakeroot flex g++ gperf libapache2-mod-php5 libasound2-dev libbz2-dev libcairo2-dev libcups2-dev libcurl4-gnutls-dev libelf-dev libgconf2-dev libgl1-mesa-dev libglib2.0-dev libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev libkrb5-dev libnspr4-dev libnss3-dev libpam0g-dev libpci-dev libpulse-dev libsctp-dev libspeechd-dev libsqlite3-dev libssl-dev libudev-dev libwww-perl libxslt1-dev libxss-dev libxt-dev libxtst-dev mesa-common-dev metacity patch perl php5-cgi pkg-config python python-cherrypy3 python-dev python-psutil rpm ruby subversion ttf-dejavu-core ttf-indic-fonts ttf-koc |
This file contains hidden or 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
| cd ~ | |
| mkdir .gyp | |
| nano .gyp/include.gypi | |
| paste the following | |
| { | |
| 'variables': { | |
| 'linux_use_gold_binary' : 0, | |
| 'linux_use_gold_flags' : 0, | |
| 'target_arch': 'arm', | |
| 'disable_nacl': 1, # NaCL does not build for ARM. |
This file contains hidden or 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
| var app = require('express')(); | |
| var GridStore = require('mongodb').GridStore; | |
| var ObjectID = require('mongodb').ObjectID; | |
| var MongoClient = require('mongodb').MongoClient; | |
| var Server = require('mongodb').Server; | |
| var dbConnection; | |
| MongoClient.connect("mongodb://localhost:27017/ersatz?auto_reconnect", {journal: true}, function(err, db) { | |
| dbConnection = db; | |
| app.listen(3000); |
This file contains hidden or 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
| /* | |
| * Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
| */ | |
| var http = require('http'), | |
| fs = require('fs'), | |
| util = require('util'); | |
| http.createServer(function (req, res) { | |
| var path = 'video.mp4'; |
This file contains hidden or 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
| #!/usr/bin/env node | |
| /* | |
| * Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
| * Modified from https://gist.github.com/paolorossi/1993068 | |
| */ | |
| var http = require('http') | |
| , fs = require('fs') | |
| , util = require('util') |