VMなどで動作テスト用にLinux環境を頻繁に作っていると ユーザ&パスワードの設定をしょっちゅう忘れるので、 ユーザ&パスワードを入力しなくても一通り使える テスト用Debian・Ubuntu環境の設定のメモ。
パスワードを入力しなくてもいいように設定するのは次の2点
- sudoをパスワードなしで使えるようにする。
- 起動した直後にtty1が自動的ログインしている状態にする。
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func testHandler(w http.ResponseWriter, req *http.Request) { | |
fmt.Fprintln(w, "/test handler") | |
} |
package main | |
import ( | |
"fmt" | |
"net" | |
) | |
func main() { | |
conn, err := net.Dial("tcp", "127.0.0.1:7") | |
if err != nil { |
$ ls * | (echo "<html><body>" ; sed -e 's/\(^.*$\)/\<a href=\"\1\"\>\1\<\/a\>/' ; echo "</body></html>") |
# | |
# mqtt publish sample | |
# | |
# $ gem install mqtt | |
# $ gem install pit | |
# | |
require 'rubygems' | |
require 'mqtt' | |
require 'json' | |
require 'pit' |
#define __GLMETASEQ_C__ | |
#include "GLMetaseq.h" | |
/* | |
GLMetaseq | |
The MIT License | |
Copyright (c) 2009 Sunao Hashimoto and Keisuke Konishi |
// | |
// attiny85_1mhz_ir_38khz.ino | |
// | |
// see also... http://forum.arduino.cc/index.php?PHPSESSID=hvsfmjo2l66kv9g9rhaigftje4&topic=139729.msg1049431#msg1049431 | |
// | |
void setFrequency(uint16_t freq) | |
{ | |
uint32_t requiredDivisor = (F_CPU/2)/(uint32_t)freq; | |
uint16_t prescalerVal = 1; |
Clock clock; | |
void setup() { | |
size(200, 200); | |
clock = new Clock(width / 2, height / 2, width/2-20); | |
} | |
void draw() { | |
background(0); | |
noFill(); |
//firmata_analog_linechart.pde | |
import cc.arduino.*; | |
import processing.serial.*; | |
import java.util.*; | |
class LineChart { | |
Vector v; | |
int size; | |
LineChart(int size) { | |
v = new Vector(); |
class Walker { | |
PVector position; | |
float top, bottom, left, right; | |
float radian; | |
Walker() { | |
reset(); | |
} | |
void reset() { |