Skip to content

Instantly share code, notes, and snippets.

@dlintw
dlintw / sample.go
Created October 11, 2011 14:00
go tour #69
func Crawl(url string, depth, workerCnt int, fetcher Fetcher) {
reqch := make(chan int)
seen := make(map[string]bool)
working := make(chan bool, workerCnt)
var crawl func(string, int)
crawl = func(url string, depth int) {
defer func(){reqch <- -1}()
if depth <= 0 {
return
@dlintw
dlintw / a69.go
Created October 14, 2011 06:47
go tour #69 real fetcher
package main
import (
"bytes"
"os"
"fmt"
"html"
"http"
"io/ioutil"
"log"
@dlintw
dlintw / multifile.go
Created April 22, 2013 09:02
multi file read example code
package main
import (
"bufio"
"flag"
"fmt"
"time"
"log"
"io"
"os"
@dlintw
dlintw / cscope.sh
Created August 24, 2013 03:26
cscope for nextvod uboot source
mkdir -p cscope
FILE=$PWD/cscope/cscope.files
find "$PWD/src/" \
"$PWD/src/board/st/pdk7105" \
"$PWD/src/common" \
"$PWD/src/cpu/sh" \
"$PWD/src/cpu/sh/stx7105" \
"$PWD/src/disk" \
"$PWD/src/fs" \
"$PWD/src/include" \
@dlintw
dlintw / make.sh
Created August 30, 2013 13:38
nextvod uboot make script
#!/bin/bash
set -o errexit
# use make.sh <uboot_version> # if fossil not exist
UBOOT_VER=${1:-1}
if [ "$UBOOT_VER" == "1" -a -x /usr/bin/fossil -a -r manifest.uuid ] ; then
# use fossil version
_id=$(cat manifest.uuid 2>/dev/null)
UBOOT_VER=$(printf %u 0x${_id:0:6})
echo UBOOT_VER="$UBOOT_VER"
@dlintw
dlintw / nextvod kernel boot log
Created September 12, 2013 00:04
sh4twbox [639108], kernel[88b563]
Board: STx7105-PDK [32-bit mode]
U-Boot 1.3.1 (Aug 31 2013 - 10:44:00) - stm23_0045
DRAM: 256 MiB
SPI: ST M25P80 (1MiB) device (page=256,erase=4096)
In: serial
Out: serial
Err: serial
@dlintw
dlintw / nextvod kernel + busybox boot
Created September 15, 2013 15:50
uboot[a907] kernel[5ea7] rootfs[c1dd]
...
stm-ehci stm-ehci.1: USB 0.0 started, EHCI 1.00
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 1 port detected
stm-ohci stm-ohci.1: STMicroelectronics OHCI Host Controller
stm-ohci stm-ohci.1: new USB bus registered, assigned bus number 4
stm-ohci stm-ohci.1: irq 142, io mem 0xfeaffc00
usb usb4: configuration #1 chosen from 1 choice
hub 4-0:1.0: USB hub found
# Maintainer: Sebastien Bariteau <numkem@gmail.com>
pkgname=atlassian-jira
pkgver=6.0.8
# check new version on https://www.atlassian.com/software/jira/download
pkgrel=1
pkgdesc="Atlassian's JIRA issue tracking system"
arch=('i686' 'x86_64')
license=(custom)
url="http://www.atlassian.com/software/jira/overview"
backup=(etc/conf.d/jira opt/atlassian-jira/conf/server.xml
@dlintw
dlintw / bvi-1.4.0alpha.configure
Created September 18, 2013 01:49
on sparc + gcc 3.4.6
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for special C compiler options needed for large files... no
gcc -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_MSE_INT_H -I/usr/local/include/ncurses/include -I/usr/local/include/ncurses/include/ncurses -DHAVE_CONFIG_H -c bvi.c
bvi.c: In function `main':
bvi.c:129: error: `tntty' undeclared (first use in this function)
bvi.c:129: error: (Each undeclared identifier is reported only once
bvi.c:129: error: for each function it appears in.)
make: *** [bvi.o] Error 1