Posts Tagged ‘linux’

Using the ThinkVantage LED on an x300

Friday, August 15th, 2014

Short version: I figured out a way to control it that will actually work on modern systems. Read below to see how to get full control of it (even more control than you get from the other LEDs, including 3 different blink modes).

After googling and digging through some resources such as this thread, I had come up empty-handed, since the /proc/acpi/ibm/ecdump interface is deprecated and no longer included in the thinkpad-acpi driver. The solution: a fancy new program called “ec_access“, which uses the sysfs embedded controller interface, rather than the deprecated procfs one.

Just one problem: it’s not enabled in the kernel by default. I’ll leave you to figure out how to compile a custom kernel for your distro, but the config option that needs to be enabled is “CONFIG_ACPI_EC_DEBUGFS”. This will expose /sys/kernel/debug/ec/ec0/io, which ec_access uses. While you’re at it, you may also want to enable “CONFIG_THINKPAD_ACPI_UNSAFE_LEDS”, which will give you control over the orange and green battery LEDs.

Once you’ve got the kernel working, and can confirm that /sys/kernel/debug/ec/ is present on your system, compile ec_access.c.

Now, you should be able to run “ec_access -w 0x0c -v 0xXY”, where Y is the LED number (“d” in the case of the thinkvantage LED), and X is one of the following:

  • 0-7: LED off
  • 8-b: LED on solid
  • C: Slow, heartbeat-like pulse
  • D: Smooth, slow pulsing
  • E: Faster blink
  • F: LED on solid

Now, you can use this LED in scripts or whatever you need it for. Unfortunately, I haven’t taken time to look at how one would modify thinkpad-acpi to support this LED (or even why its existing tpacpi::thinkvantage LED interface doesn’t seem to work for this).

Known issue: The LED doesn’t seem to run at full brightness when it is set to solid. It is visibly brighter when put in one of the blink modes.

Python IRC Bot in the Works

Saturday, December 5th, 2009

*** Update ***: Main page for bot here

I am currently writing a small, fast, small-footprint IRC bot in Python. More details as I finish the bot. The functions created so far:

  • Help (Displays Help)
  • Echo (Echo back a message)
  • Say (Send a message to a channel)
  • Spam (Send a message to a channel a specified amount of times)
  • Join (Join a channel)
  • Part (Part a channel)
  • Authorization (username+password)
  • Deauthorization
  • User lookup
  • Raw (Use raw IRC commands)
  • Uptime (Display uptime)
  • Math (Do math functions with Yacas)

Planned functions:

  • Encrypted passwords
  • Data storage, either in a text file or a MySQL DB
  • Channel mode control

This bot is not meant to be a complex bot, it is intended to be a fast, light bot that can be easily reprogrammed.

Linux iPhone Tethering over Bluetooth

Thursday, August 27th, 2009

A while ago I wrote about how to do a wifi iPhone tether with a SOCKS proxy. Now, I’ll be writing about a Bluetooth tether on 3.0/3.0.1 with a 3G/3GS. To make this work on 3.1, you will need to enable tethering separately, which can usually be done by installing the “Internet Tethering” package in Cydia. This does NOT rely on that script floating around, and will work on any Linux system with bluetooth. I used my Fedora 10 laptop for this.


A (Mostly) Complete OpenWRT Tutorial

Monday, August 17th, 2009

I’ve attempted to write a complete OpenWRT setup tutorial, since many out there lack certain parts. This will cover the basics and the more advanced things you can do with OpenWRT. Read more for the tutorial.


Installing Debian on an External Drive

Saturday, April 4th, 2009

If you want to install Debian on an external drive, you can follow these instructions. THis has the advantage of being portable and persistent, and works for hard drives and flash drives.