29
Sep 09

Ubuntu 9.04 Settings for Eduroam Wireless Networks

Many UK universities use Eduroam wireless networks which require certificate authentication along with a username and password. Despite following the official guide to getting my laptop setup at the University of Leeds, my laptop wouldn’t seem to connect – however, after a bit of playing I managed to get things up and running.

Here are the settings you will need:

  • Set ‘Wireless security’ to WPA or WPA2 Enterprise
  • Set ‘EAP method’ to TTLS
  • Set ‘Key type’ to MSCHAP
  • Set ‘Identity’ to your ISS Username with @leeds.ac.uk appended, for example jh1761@leeds.ac.uk
  • Type your normal ISS password into the password box
  • Leave ‘Anonymous Identity’ blank
  • Leave ‘Client certificate file’ set to (none)
  • Click the ‘CA Certificate file’ option, a file open window should popup – locate the file: /etc/ssl/certs/GTE_CyberTrust_Global_Root.pem , select it and click open
  • You should now find that the computer connects without any issues.


    23
    Aug 09

    Disable the touchpad whilst typing on the Asus EeePC 1005HA in Ubuntu

    If you install Ubuntu Netbook Remix 9.04 (UNR) on the Asus EeePC 1005HA you do get most features supported out of the box, however there are a couple of things that require a bit of tweaking such as the ethernet and wireless drivers and some of the function keys and touchpad. For a full-on guide to setting up your machine with Ubuntu, head over to this excellent blog post.

    Disable the touchpad whilst typing
    One thing that I did not feel was configured properly in the above guide is the touchpad for the 1005HA. On such a small laptop, it is inevitable that whilst typing emails or doing word processing tasks on the netbook, your hands will often brush the touchpad, activating tapping or scrolling features that may cause undesired outcomes such as text being deleted or being moved around within the document. This problem can however be dealt with by using a program that temporarily deactivates the touchpad whilst text is being typed and then reactivates it once typing is finished. Whilst this feature is discussed in the above guide, there is no documentation regarding customisation – for example users may want to change the amount of time for which the touchpad is disabled or only disable tapping and scrolling (and not the pointer itself). I did some investigation on my own and found the following solution:

    Configuring the touchpad device
    Before we do anything else, we need to enable configuration of the touchpad by enabling SHMConfig in a configuration file. In a terminal, enter the following commands:

    sudo nano /etc/hal/fdi/policy/shmconfig.fdi

    Paste the following code into the file and save:

    <?xml version="1.0" encoding="UTF-8"?><deviceinfo version="0.2"><device><match key="input.x11_driver" string="synaptics"><merge key="input.x11_options.SHMConfig" type="string">True</merge></match></device></deviceinfo>

    You now need to restart X (logout and log back in again) or restart the computer for changes to take effect.

    Syndaemon – disable the touchpad on typing
    Next, we will use syndaemon to setup automatic disabling of the touchpad when typing. Here are the configuration options for this daemon.

    Usage: syndaemon [-i idle-time] [-m poll-delay] [-d] [-t] [-k]
      -i How many seconds to wait after the last key press before
         enabling the touchpad. (default is 2.0s)
      -m How many milli-seconds to wait until next poll.
         (default is 200ms)
      -d Start as a daemon, ie in the background.
      -p Create a pid file with the specified name.
      -t Only disable tapping and scrolling, not mouse movements.
      -k Ignore modifier keys when monitoring keyboard activity.
      -K Like -k but also ignore Modifier+Key combos.
      -S Use SHMConfig even if input device properties are available.

    It is best to setup syndaemon to run as a daemon process in the background – if you run it as a normal command in a terminal then it will terminate when you quit the terminal session. Here is the command I use to run syndaemon:

    syndaemon -t -K -d -i 1

    The -t flag only disables tapping and scrolling whilst typing. This is useful as it means that you can continue to move the mouse pointer whilst or immediately after typing – but you will not accidentally click on text or scroll within a window whilst you are typing when your hands brush against the touchpad.

    The -K flag means that the touchpad will only be deactivated when you are typing real text and not when you are using shortcut keys within programs.

    Finally, I personally prefer a slightly shorter time delay of just one second before the touchpad is reactivated, this is set by the -i flag followed by the delay time in seconds.

    Automation
    Instead of running this manually in a terminal every time you need it, you can setup syndaemon to run automatically on session startup. In the menu, go to System –> Preferences –> Startup Programs and add an entry named “Syndaemon”. You can then copy and paste the above command into the dialogue box and hit ok.


    09
    Jul 09

    用 tsocks 和 proxychains 使 Linux 下所有软件能够翻墙

    情况
    由于最近在中国某个地方爆发了 riot, 所以境内很多网站又是无法访问 (twitter.com、facebook.com 等),让我们这些网民很无奈。

    使用 SSH 翻墙
    我曾经介绍过如何使用 SSH 来建立一个 SOCKS 代理服务器,让你能够在 Firefox 里正常访问以上所提起的网址。然而不是所有 Linux 软件都能支持代理服务器。如果你最热爱的 Linux 工具需要访问”被封”的网站,又没有嵌入的代理支持,该怎么办呢?
    遇到这种情况当然不要放弃该软件… 毕竟我们用的系统是 Linux 而不是以前让我们咳声叹气,丧失信心的 Windows,总有一个方法去解决问题。

    举个例子吧
    我不久前发现了 Twitter 这个网站。我一开始不经常用,也搞不明白别人为什么对这个 web 2.0 服务都着了迷。后来我在推特上跟的人越来越多,跟着我的人亦是日益增多,不知不觉我也迷上了该网站,天天都会上。凡是经常用推特的人一般都会用一个推特的客户端,这才能跟得上朋友们的状态更新和最火热的网络新闻。本人作为 Ubuntu 的用户,我自然就选了 Gwibber 这个基于 GNOME 的客户端来访问我的推特。这个软件功能很丰富,用起来得心应手,不过总有一个问题让我有点遗憾,就是 Gwibber 还不听从 GNOME 的代理设置。平时这也不是一个很大的问题,但是每遇中国网络封锁较严重时,都会让我暂时无法使用该软件。

    解决方案… Tsocks
    经过几个 Google 搜索,我最终很高兴地发现 Linux 有一个能够强迫任何软件通过 SOCKS 代理上网的工具,其名就是 tsocks。Tsocks 是一个透明 SOCKS 代理软件,只要你电脑有一个连接到国外服务器的 SSH 隧道,你就能让任何软件翻墙。

    安装并配置 Tsocks
    以下说明都是为了那些使用 Ubuntu 的 Linux 用户,不过在别的 Linux 发行版下,安装的过程应该与此差不多。

    在终端中:

    sudo apt-get install tsocks

    修改配置文件:

    sudo nano /etc/tsocks.conf

    将其内容改成以下几行并保存退出:

    local = 192.168.1.0/255.255.255.0 #local表示本地的网络,也就是不使用socks代理的网络
    server = 127.0.0.1 # SOCKS 服务器的 IP
    server_type = 5 # SOCKS 服务版本
    server_port = 9999 #SOCKS 服务使用的端口

    你可能需要修改一下以上内容,用你自己的 SSH 隧道设置。

    运行软件
    用 tsocks 运行你的软件很简单,在终端中:

    tsocks 你的软件 &

    我现在运行 Gwibber 都是这样运行的:

    tsocks gwibber &

    祝你们翻墙愉快!

    EDIT—————–>

    我今天还发现了另外一个工具,其功能似乎比 tsocks 要更丰富,配置起来更简单,而且不会那么容易出错。这个工具就是 proxychains。以下有配置方法:

    sudo apt-get install proxychains

    修改配置文件 (/etc/proxychains.conf),应该如下:

    # proxychains.conf  VER 2.0
    #
    #        HTTP, SOCKS4, SOCKS5 tunneling proxifier.
    #
    
    # The option below identifies how the ProxyList is treated.
    # only one option should be uncommented at time,
    # otherwise the last appearing option will be accepted
    #
    # Dynamic - Each connection will be done via chained proxies
    # all proxies chained in the order as they appear in the list
    # at least one proxy must be online to play in chain
    # (dead proxies are skipped)
    # otherwise EINTR is returned to the app
    #
    # Strict - Each connection will be done via chained proxies
    # all proxies chained in the order as they appear in the list
    # all proxies must be online to play in chain
    # otherwise EINTR is returned to the app
    #
    # Random - Each connection will be done via random proxy
    # (or proxy chain, see  chain_len) from the list
    # this option is good for scans
    
    dynamic_chain
    #strict_chain
    #random_chain
    
    # Make sense only if random_chain
    chain_len = 2
    
    # Quiet mode (no output)
    #quiet_mode
    
    # Write stats about good proxies to proxychains.stats
    #write_stats
    
    #Some timeouts in milliseconds
    #
    tcp_read_time_out 15000
    tcp_connect_time_out 10000
    
    [ProxyList]
    # ProxyList format
    #       type  host  port [user pass]
    #       (values separated by 'tab' or 'blank')
    #
    #
    #        Examples:
    #
    #            	socks5	192.168.67.78	1080	lamer  secret
    #		http	192.168.89.3	8080	justu	hidden
    #	 	socks4	192.168.1.49	1080
    #	        http	192.168.39.93	8080
    #
    #
    #       proxy types: http, socks4, socks5
    #        ( auth types supported: "basic"-http  "user/pass"-socks )
    #
    #http 	10.0.0.5 3128
    socks5 127.0.0.1 9999
    socks4 127.0.0.1 9050
    

    注意事项:

    1. 要选 dynamic_chain 而不是 random_chain
    2. 可以列举几个代理服务器,proxychains 会按顺序用,代理无法访问即自动选用下一个
    3. 代理服务器要根据自己电脑的情况自行调整

    运行 proxychains
    运行 proxychains 跟运行 tsocks 完全一样。在终端中:

    proxychains 你的软件 &

    比如说:

    proxychains chromium-browser &

    我还是推荐你使用 proxychains!


    09
    Jul 09

    Install latest VLC 1.0 in Ubuntu using the Launchpad Repository

    As some of you may have heard by now, VLC reached its version 1.0 milestone yesterday and is already available for download for use on your OS of preference bringing you plenty of new features.

    New Features

    • Free, Open Source and cross-platform
    • Independant of systems codecs to support most video types
    • Live recording
    • Instant pausing and Frame-by-Frame support
    • Finer speed controls
    • New HD codecs (AES3, Dolby Digital Plus, TrueHD, Blu-Ray Linear PCM, Real Video 3.0 and 4.0, …)
    • New formats (Raw Dirac, M2TS, …) and major improvements in many formats…
    • New Dirac encoder and MP3 fixed-point encoder
    • Video scaling in fullscreen
    • RTSP Trickplay support
    • Zipped file playback
    • Customizable toolbars
    • Easier encoding GUI in Qt interface
    • Better integration in Gtk environments
    • MTP devices on linux
    • AirTunes streaming
    • New skin for the skins2 interface

    Whilst it may take a while before packages start hitting the repositories for your favourite linux distributions, for those of you who are in a hurry to try out the latest version and happen to be running on Ubuntu, here is a quick method to download and install the latest version.

    Launchpad Repository
    Whilst older versions of VLC are already available in the repositories provided by Ubuntu, the newest version has not yet been rolled out. Don’t despair however… Videolan provide an alternative PPA repository hosted on Launchpad which has the latest edition of your favourite media player.

    Installing VLC 1.0
    To install VLC 1.0, fire up a terminal and follow the instructions below:

    Add the repository:

    sudo nano /etc/apt/sources.list.d/vlc.list

    For Jaunty, paste in the lines below, save and exit:

    deb http://ppa.launchpad.net/c-korn/vlc/ubuntu jaunty main
    deb-src http://ppa.launchpad.net/c-korn/vlc/ubuntu jaunty main

    Add the key for the Launchpad PPA:

    sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 7613768D

    Update your repositories:

    sudo apt-get update

    Install:

    sudo apt-get install vlc vlc-plugin-esd mozilla-plugin-vlc

    That should prompt apt to look for the latest version in the repositories and to download and install it for you. Next time you fire up VLC you should now see that the version number is 1.0!

    vlc_1.png

    Source: Install VLC on Ubuntu