Read Sean

Read me, read Sean.
posts - 508, comments - 655, trackbacks - 9, articles - 4

2014年4月6日

不知道从什么时候开始的,tsocks在Mac下面安装要费些周折,brew官方和曾经一度存在的第三方tap都不再支持直接brew install,需要手工创建formula。过程倒也还OK:

vim /usr/local/Library/Formula/tsocks.rb

require 'formula'

class Tsocks < Formula
  # The original is http://tsocks.sourceforge.net/
  # This GitHub repo is a maintained fork with OSX support

  homepage 'http://github.com/pc/tsocks'
  head 'https://github.com/pc/tsocks.git'

  depends_on 'autoconf' => :build if MacOS.xcode_version.to_f >= 4.3

  def install
    system "autoconf""-v"
    system "./configure""--prefix=#{prefix}""--disable-debug""--disable-dependency-tracking""--with-conf=#{config_file}"

    inreplace("tsocks") { |bin| bin.change_make_var! "LIBDIR", lib }

    system "make"
    system "make install"

    etc.install "tsocks.conf.simple.example" => "tsocks.conf" unless config_file.exist?
  end

  def test
    puts 'Your current public ip is:'
    ohai `curl -sS ifconfig.me 2>&1`.chomp
    puts "If your correctly configured #{config_file}, this should show the ip you have trough the proxy"
    puts 'Your ip through the proxy is:'
    ohai `tsocks curl -sS ifconfig.me 2>&1`.chomp
  end

  def config_file
    etc / 'tsocks.conf'
  end
end

有了上述formula之后,即可 brew install --HEAD tsocks 。

posted @ 2014-05-07 23:23 laogao 阅读(4026) | 评论 (2)编辑 收藏

有了RPi当然免不了要玩玩XBMC,这里推荐XBian,安装配置过程如下:

1- 下载.img文件 ( http://www.xbian.org/download/ );
2- 用dd命令将.img(比如XBian_beta_2.img)写入SD卡;
3- 将中文字体(比如wqy-zenhei.ttc)重命名为arial.ttf,复制到SD卡的~/.xbmc/media/Fonts目录(XBian默认用户为xbian,密码raspberry);
4- 从 https://code.google.com/p/xbmc-addons-chinese/downloads/detail?name=repository.googlecode.xbmc-addons-chinese-eden.zip 下载资源插件并复制到SD卡;
5- 将SD卡插入RPi并连接HDMI到电视机/显示器;
6- RPi开机,进入XBian的配置页面,可以校准屏幕,配置网络连接等;
7- 在系统设置中选择字体为Arial,语言选为中文,此时应该看到界面可正常显示中文;
8- 安装扩展程序,选择之前下载到SD卡的repository.googlecode.xbmc-addons-chinese-eden.zip文件,扩展安装成功后即可在扩展程序列表中看到对应的资源条目,逐一安装即可。

额外提示:XBMC也可以通过网络共享播放视频,之前跟大家提到过XBMC显示中文字幕有时出现整行被方块覆盖的问题,解决方法是在字幕文件中查找并删除或替换"…"字符。Enjoy!

posted @ 2014-04-06 17:45 laogao 阅读(2335) | 评论 (0)编辑 收藏