LEDs on cubietruck / armboards

It can be configured, it’s just not enabled by default (mostly).

Try entering ls /sys/class/leds/ to check what LEDs are available,

cat /sys/class/leds//trigger to see available triggers, for example

cat /sys/class/leds/white:ph11:led3/trigger

[none] battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid ac-online usb-online mmc0 mmc1 timer disk-activity heartbeat backlight cpu0 cpu1 default-on rfkill0 rfkill1

and setting them manually, example:

echo “mmc0″ > /sys/class/leds/blue:ph21:led1/trigger

echo “heartbeat” > /sys/class/leds/green:ph07:led4/trigger

echo “cpu0″ > /sys/class/leds/orange:ph20:led2/trigger

echo “cpu1″ > /sys/class/leds/white:ph11:led3/trigger

You need to use root shell to test setting triggers, using sudo from non-privileged user won’t work.

To enable them at every boot, you can edit .fex file (and recompile it to bin afterwards) on old kernel, .dts file with dtc (it’s a little bit tricky) on mainline, or just put echo commands to /etc/rc.local.

Read More

ctags

ctags -R *

Ctrl+] – go to definition

Ctrl+T – Jump back from the definition.

Ctrl+W Ctrl+] – Open the definition in a horizontal split

Add these lines in vimrc

map <C-> :tab split:exec(“tag “.expand(““))

map <A-]> :vsp :exec(“tag “.expand(““))

Ctrl+\ – Open the definition in a new tab

Alt+] – Open the definition in a vertical split

Read More

Attach to process

create a pipe: mkfifo /tmp/fifo.

Use gdb to attach to the process: gdb -p PID

Then close stdin: call close (0); and open it again: call open (“/tmp/fifo”, 0600)

Finally, write away (from a different terminal, as gdb will probably hang):

echo blah > /tmp/fifo

========

view only:

cd /proc/PID/fd

tail -f 1..3

Read More