08-23-2011, 05:58 PM | #1 |
fbdev
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
|
fbout (redirect stdout to eink)
for developers, sysadmins.
given a command it will echo the output to your eink display. it does it quick and dirty: it is designed to monitor an active command (like tail -f). it will output one line per pipe flush. |
08-24-2011, 03:10 AM | #2 |
Connoisseur
Posts: 79
Karma: 2718
Join Date: Aug 2011
Device: Kindle 3G
|
You. Rock.
I was gonna ask how hard it would be for you to put something like this together. Thank you thank you thank you. |
08-26-2011, 01:06 AM | #3 |
fbdev
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
|
|
08-26-2011, 07:33 PM | #4 |
Connoisseur
Posts: 79
Karma: 2718
Join Date: Aug 2011
Device: Kindle 3G
|
:-)
Hey dude what is the info displayed in brackets at the beginning of the output of every fbout instance? Can it be hidden? *grin* If it were possible to replace the question-mark-like EOL character with a more solid block, that would be awesome... wouldn't it? |
08-26-2011, 07:39 PM | #5 |
fbdev
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
|
the info in the brackets is the last thousand seconds and thousand milliseconds of the epoch.
if you've ever looked at your kprintfs (assuming your kernel was compiled with the option) you will see uptime next to the status message (seconds.microseconds). this is a ten minute debugging app; it's not really going to get a lot of my attention. =] |
08-26-2011, 07:49 PM | #6 |
Connoisseur
Posts: 79
Karma: 2718
Join Date: Aug 2011
Device: Kindle 3G
|
I see. Coolio.
For the record, I see quite a use for it, outside of simple debugging. At the moment, I use it for various random launchpad + nix commands, but I've also got a suite of scripts to manage kinamp/mplayer: toggling shuffle/repeat, skipping between different genres & albums .... and I love getting on-screen feedback for that stuff. It works beautifully well enough as it is though--I was just being perfectionist. |
08-26-2011, 09:16 PM | #7 | |
fbdev
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
|
you should post them.
scripts are applications, too. Quote:
|
|
08-27-2011, 05:05 AM | #8 |
Connoisseur
Posts: 79
Karma: 2718
Join Date: Aug 2011
Device: Kindle 3G
|
I figured I would eventually... I always share my scripts. I've been tweaking them heavily every other day though.
Did you tell people to put your apps in /mnt/us/system just for simplicity? I run kaffeine & kinamp & fbout so much that it made the code so much cleaner-looking to get them in my path. Is there a reason you know of why I shouldn't add things to /usr/bin? I haven't had any probs yet, but I haven't taken the time to snoop everywhere yet. |
08-27-2011, 11:13 AM | #9 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
How do you give it a command, ./fbout command or command | ./fbout or what?
|
08-27-2011, 01:22 PM | #10 | |
fbdev
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
|
i try to avoid modifying the root file system.
0) i am of the opinion that when i boot my kindle it ought to work; making changes to the root file system is the best way to make it do otherwise. =] 1) there are heavy space constraints on the root file system. iirc, vanilla it has about 150 mb free. 2) if you want an exe in your path, use a symlink. 3) if you want a userspace folder in your path, modify /etc/profile. in short, there isn't any really good reason to modify the root filesystem for drop-in executables and the first rule of *nix administration is to minimize the use of privileged operations. qed, i don't modify the root filesystem. Quote:
|
|
08-27-2011, 01:26 PM | #11 |
fbdev
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
|
|
08-27-2011, 01:35 PM | #12 |
fbdev
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
|
you can think of it a little like a cross between
# watch ls and # ls|xargs |
08-27-2011, 02:01 PM | #13 |
fbdev
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
|
one thing i REALLY hate about shell scripting is that it's so cryptic.
if C is beautiful, and it is, bash and perl are on the wrong end of the ugly stick in a hurricane. let me explicate this bit of code. while sleep 1: loop until interrupt at one second intervals ; do now the body of the loop awk '{ print $15 }' print the fifteenth column of a file `pgrep cvm` the pid of cvm (the java framework) /proc/`pgrep cvm`/stat the name of the file is: /proc/4455/stat if the pid of the cvm process is 4455 the stat file holds process statistics for a process. column 15 of this file is the user mode jiffies (think cpu cycles used) for the process. more info on the stat file. ; done end of the loop body |/tmp/fbout send the output of this loop to the framebuffer. putting the pipe at the end of the loop instead of here: # while sleep 1; do awk '{ print $15 }' /proc/`pgrep cvm`/stat|/tmp/fbout; done causes executions of the command to reuse the pipe instead of reopening it every time. |
08-27-2011, 02:06 PM | #14 |
fbdev
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
|
|
08-27-2011, 03:28 PM | #15 | ||
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
Quote:
Quote:
...Ahhh, now I see! Thanks for taking the time. |
||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
oeb:redirect Hyperlinks to different ebook (on the Kindle) | Kitard | Kindle Developer's Corner | 1 | 07-17-2010 12:02 PM |
Alternativen zu eInk | gromit62 | Deutsches Forum | 1 | 05-29-2010 02:36 PM |