反正就是一整個好玩!!!(  ̄ c ̄)y▂ξ

某日,尤達大師出來曬曬太陽...

 

 

igogo 發表在 痞客邦 留言(0) 人氣()

http://www.ruby-forum.com/topic/182957

 

arr = []
arr << dec_num
str = arr.pack("U") #U=UTF-8 => encode unicode 8364 into a UTF-8
character.
puts str
 
php
http://stackoverflow.com/questions/3704538/php-construct-a-unicode-string 

 

#!/usr/bin/env ruby
#unicode decimal value to string
def decToStr(dec_num)
  arr = []
  arr << dec_num
  str = arr.pack("U")
  return str
end
fread = File.new("./uao.csv","r")
while (line=fread.gets)
  dec_num=line.split(',')[1].to_i(16) if (!line.split(',')[1].nil?)
  puts decToStr(dec_num)
end

fread.close

 

#將md5加密的字利用uao列表比對還原,未優化

#!/usr/bin/env ruby
require 'iconv'
require 'digest/md5'

uao = Array.new
fread = File.new("./uaowords.big5","r")
while (line=fread.gets)
  str=line.chomp
  md5value=Digest::MD5.hexdigest("#{str}")
  #printf("%s,%s\n",str,md5value)
  uao << sprintf("%s,%s",str,md5value)
end
fread.close

dbCsv=Array.new
fread = File.new("./db.csv.big5","r")
while (line=fread.gets)
  dbmd5=line.chomp.split(',')[1].gsub('\'','')
  pinyin=line.chomp.split(',')[2..-1].join(',')
  uao.each do |x|
    uaoword=x.chomp.split(',')[0]
    uaomd5=x.chomp.split(',')[1]
    if(dbmd5==uaomd5)
    printf("%s,\'%s\',%s\n",line.chomp.split(',')[0],uaoword,pinyin)
    end
  end
end
fread.close

igogo 發表在 痞客邦 留言(0) 人氣()

 

跟了ptt的團購,等了半個月,總算寄來了。

目前錄到都是白天的,畫質還不錯,就是大台點,不過要有2吋的螢幕,尺寸比沒螢幕的大,也是很合理。

DSCF3591.JPG

 

DSCF3585.JPG

 

正面照

DSCF3587.JPG

電源線照著網路人家教學,藏在a柱裡。

DSCF3589.JPG

 

夜間效果

   

igogo 發表在 痞客邦 留言(0) 人氣()

 

許久未認真照顧的花園...造就今年茶花盛開

九曲

http://www.flickr.com/photos/seajohn18/5532067310/

DSCF3578茶花九曲

igogo 發表在 痞客邦 留言(0) 人氣()

終於在小暐博一歲一個月時,痛下決心入手sigma 17-50mm 這支

有了17mm(aps-c)端,盲拍的成功率大增

但.. Orz  荷包大失血。

 

DSC_1121

http://www.flickr.com/photos/seajohn18/5519261061/

 

DSC_1114

http://www.flickr.com/photos/seajohn18/5519848124/

 

DSC_1130

http://www.flickr.com/photos/seajohn18/5519855450/

不過,鏡頭也來到77mm。

nikon d60+sigma 17-50mm 的尺寸也大很多,相机包都佔滿了

除了要有決心,也要有毅力,才會想帶出門

比起來,還是小相机能隨時帶著,隨時就有机會拍下照片。

 

F200exr 逆光,慢速閃光

DSCF3556

http://www.flickr.com/photos/seajohn18/5524786859/

 

去新光時,老婆問:「有相机嗎?」

意外的就是剛好有帶 XD

 

DSCF3216

http://www.flickr.com/photos/seajohn18/5281403629/

 

去嘉義耐斯松屋時,就是剛剛好有帶fuji f200exr

DSCF3495-嘉義耐斯松屋

http://www.flickr.com/photos/seajohn18/5506484458/

igogo 發表在 痞客邦 留言(0) 人氣()

SAMBA PDC

smb.conf


[global]

  netbios name = smbserver
  workgroup = smb

  encrypt passwords = yes

  passdb backend = smbpasswd:/var/lib/samba/private/smbpasswd

  os level = 65
  wins support = yes
  preferred master = yes
  domain master = yes
  local master = yes
  security = user
  domain logons = yes
  logon path = \\%N\profiles\%U\%a
  logon drive = H:
  logon home = \\smb\%U\winprofile
  logon script = logon.vbs

 add machine script = /usr/sbin/useradd -c machines -d /var/lib/nobody -u 999 -g 1005 -s /bin/false %m$
  socket options = IPTOS_LOWDELAY TCP_NODELAY
  enable privileges = yes

#lo net 指令才能連上
  interfaces = lo eth0 192.168.1.130
  hosts allow = 192.168.1. 120.0.0.1
  bind interfaces only = Yes
  client ntlmv2 auth = yes
  lanman auth = yes
  ntlm auth = Yes
  name resolve order = bcast host lmhosts wins


[netlogon]
  path = /var/lib/samba/netlogon/
  guest ok = yes
  read only = yes

[profiles]
  path = /var/lib/samba/profiles
  read only = no
  create mask = 0600
  directory mask = 0700
  browseable = no
  inherit permissions = yes
  root preexec = /etc/samba/chk_profiles.sh %u %g

[homes]
  comment = Home directories
  browseable = no
  writable = yes
  valid users = %S
  create mode = 0664
  directory mode = 0775


#password backends

 

#add machine script

 

 

chk_profiles.sh

#!/bin/bash

usr=$1
grp=$2

PROFILE=/var/lib/samba/profiles/$usr;
if [ ! -e $PROFILE ]; then
 mkdir -pm700 $PROFILE; chown $usr:$grp $PROFILE;
fi


 

 

 

windows 7

必須更改reg及下載一官方提供的hotfix

http://wiki.samba.org/index.php/Windows7

igogo 發表在 痞客邦 留言(0) 人氣()

八取四不重覆,並且排列順序列入考慮(permutation)

#!/usr/bin/env ruby

require 'permutation'

str = "abcdefgh"
nums = 4  #取的個數
perm = Permutation.for("#{str}")
arr = Array.new
arr = perm.map { |p| p.project[0..(nums-1)] }.sort.uniq

arr.each do |e|
 puts e
end

puts arr.uniq.size

 

 

 

八取四不重覆,並且排列順序不列入考慮(comprehension)

#!/usr/bin/env ruby

require 'permutation'

str = "12345678"
nums = 4  #取的個數
perm = Permutation.for("#{str}")
arr = Array.new
arr = perm.map { |p| p.project[0..(nums-1)].split(//).sort.join }.sort.uniq

arr.each do |e|
 puts e
end

puts arr.size


 

 

參考:

http://dufu.math.ncu.edu.tw/calculus/calculus_eng/node208.html

igogo 發表在 痞客邦 留言(0) 人氣()

利用兩張網卡讓ubuntu做簡易router

知道A,B,D點

A:10.200.14.94  (學校WAN IP)

D:10.200.14.89

B:163.17.210.254

 

1.開啟ip forwarding的功能

更改 /etc/sysctl.conf

net.ipv4.ip_forward=1

 

編好後,下

sysctl -p

檢查以下值

cat /proc/sys/net/ipv4/ip_forward 

 

2.編輯 /etc/network/interfaces


#d point
auto eth0
iface eth0 inet static
        address 10.200.14.94
        netmask 255.255.255.248
        gateway 10.200.14.89


#b point
auto eth1
iface eth1 inet static
        netmask 255.255.255.128
        network 163.17.210.129
        broadcast 163.17.210.255
        address 163.17.210.254




重新啟動網卡設定

/etc/init.d/networking restart

igogo 發表在 痞客邦 留言(0) 人氣()