Notices


Reply
Thread Tools
brendan's Avatar
Posts: 531 | Thanked: 79 times | Joined on Oct 2006 @ This side of insane, that side of genius
#1
modified iptalk.sh, found elsewhere on this site.

#!/bin/sh
IP=`/sbin/ifconfig | grep 'inet addr:' | grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'` ;
if test $IP != '0.0.0.0'
then
MASK=`/sbin/ifconfig | grep 'Mask:' | grep -v '127.0.0.1' | cut -d: -f4`
flite "The configured i p address is."
sleep 2
echo "$IP" | flite
flite "Net mask is."
sleep 2
echo "$MASK" | flite
exit 0
else
flite "There is no active internet connection. I P address is unavaiable."
exit 0
fi
__________________
Nokia n800
OS 2008
Pharos iGPS 360-BT
ElmScan 5 BlueTooth
BlackBerry Bold (9000)
AT&T Wireless
 
brendan's Avatar
Posts: 531 | Thanked: 79 times | Joined on Oct 2006 @ This side of insane, that side of genius
#2
Screenshot script. works from osso-statusbar-cpu. requires osso-screenshot-tool be installed and one parameter. parameter indicates time to delay before taking screenshot. can be 0 (zero, but not less).

#!/bin/bash
sleep $1

stamp=`date +%Y%m%d-%H%M`
i=1
path=/home/user/MyDocs/.images
if mount | grep -q mmc
then
path=/media/mmc1
fi

while [ -f $path/shot-$stamp-`printf %02d $i`.png ]
do
i=$((i+1))
done
osso-screenshot-tool $path/shot-$stamp-`printf %02d $i`.png
flite "Screenshot complete"
__________________
Nokia n800
OS 2008
Pharos iGPS 360-BT
ElmScan 5 BlueTooth
BlackBerry Bold (9000)
AT&T Wireless
 
linux_author's Avatar
Posts: 282 | Thanked: 69 times | Joined on Dec 2007 @ Penniless Park, Fla.
#3
- nice! i like your iptalk.sh better! i'm going to save this one!

- how about:

#!/bin/sh
#
# monitor interface traffic
#
watch "/sbin/ifconfig wlan0 | grep -ve 'BROADCAST' -e 'Link' -e 'packets' -e 'collisions'"

- just love tinkering w/my n800! it's gets so bad the wife unit sometimes does a lopsided smirk, then does a 'wall' and sends:

Code:
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'
| dc
:-)
 
Johnx's Avatar
Posts: 643 | Thanked: 628 times | Joined on Mar 2007 @ Seattle (or thereabouts)
#4
Repost of the script I put up in the "Text2Speech" thread:http://www.internettablettalk.com/fo...7&postcount=16

Description: Reads whatever is in the cut buffer, out loud.
Depends: osso-statusbar-cpu (to launch it), xclip (attached to the post I linked), libxmu6
the script:
#!/bin/sh

DISPLAY=:0 flite "$(xclip -o)"

#-John
 
free's Avatar
Posts: 739 | Thanked: 159 times | Joined on Sep 2007 @ Germany - Munich
#5
You need /usr/bin/memstat.

Unlike ps, memstat lists all the shared objects (shared libraries and executables) that are in memory, and which processes are using those shared objects.

Getting the complete memory usage of a process (included shared memory used also by other process):

PHP Code:
#!/bin/sh
pids=`pidof $1`
for 
i in $pids
do
        
memstat -egrep "[^0-9]$i[^k]
done awk 'BEGIN{s=0}{s+=$1}END{print s"k"}' 
Nokia-N800-50-2:/home/user# ./mmem.sh hildon-input-method
27280k
Nokia-N800-50-2:/home/user# ./mmem.sh osso-xterm
4996k

Last edited by free; 2008-01-30 at 19:37.
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#6
I've got some scripts for controlling mpd with the device in my pocket (via powerlaunch). And another script, that I can't post now.

And, used by all of these, the 'say' script. It's just a wrapper around flite, sox, and esdcat. It plays out of only one channel, and at variable pitch/speed and volume. Usage below.

I put all these scripts in /home/user/apps, so the absolute pathnames may need edited... but if you're looking here, you probably can handle that.

Code:
/home/user/apps/say <rate> <vol> <text>
  • rate is the playback sample rate. 8000 plays the voice as it comes from flite. Lower numbers give a lower pitch, and take longer; higher values give a higher, faster, more robotic-chipmunk-sounding result.
  • vol is the volume scale factor. 1 gives same as flite, beyond 10 only increases distortion without boosting volume substantially. Values from 1 - 5 are helpful; after 5 the distortion starts getting annoying.
  • text is just the text to speak. Since we're practicing script fu, that's usually a backquoted pipeline.

Dependencies:
  • flite is in some repo, extras I think? Installs from Package Manager.
  • sox is in some repo -- Gronmayer.com it if you need to. I think it was a Bora repo, and I think you need to redpill or apt-get install it manually.
  • esdcat was by far the hardest bit to find. Sid Lenny armel to the rescue -- I installed both esound-clients and esound-common, then copied /etc/esd.conf (original OS2008 file) over /etc/esound/esd/conf (new file from esound-common package). It might work by simply forcing a dependency override, but IMHO better not to go that way... Anyway, when you're done, you should have esdplay and esdcat, which should have been available out-of-box, I would think.

Those are all attached. Here's a lame one, for VNC over SSH. This one's small enough to in-line:
PHP Code:
#!/bin/sh
#change user@host.net to whatever's right for you, of course...
ssh --L localhost:5901:127.0.0.1:5900 user@host.net sleep 10
vncviewer 
--hostname=127.0.0.1:
And finally, a one-liner for launching/unminimizing xmms. Just put this line directly into osso-statusbar-cpu.
PHP Code:
xmmsctrl launch main 0 equalizer 0 play_list 0 main 1 equalizer 1 play_list 1 
Edit: I should mention that the mpc* scripts use nc (aka netcat), which is to be found in the repos as well.
Attached Files
File Type: txt mpcnext.txt (280 Bytes, 179 views)
File Type: txt mpcprev.txt (366 Bytes, 173 views)
File Type: txt mpcshuf.txt (113 Bytes, 168 views)
File Type: txt mpcstat.txt (157 Bytes, 157 views)
File Type: txt say.txt (144 Bytes, 174 views)

Last edited by Benson; 2008-06-07 at 02:23.
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#7
Originally Posted by Johnx View Post
#!/bin/sh

DISPLAY=:0 flite "$(xclip -o)"

#-John
I made a version of that which fixes text with \uXXXX escapes (replaces a couple it knows about, and discards others) instead of reading them "backslash u two thousand fourteen". Handy for reading stuff from some websites. It also uses my 'say' wrapper, but could easily be reverted to use sed if you don't have and aren't willing to get sox, esdcat. (I'm posting again with it, since this won't permit more than 5 attachments...)
Attached Files
File Type: txt readsel.sh.txt (144 Bytes, 114 views)
 
bluesubaru's Avatar
Posts: 197 | Thanked: 39 times | Joined on Jan 2008 @ Long Island
#8
Originally Posted by linux_author View Post
- nice! i like your iptalk.sh better! i'm going to save this one!

- how about:

#!/bin/sh
#
# monitor interface traffic
#
watch "/sbin/ifconfig wlan0 | grep -ve 'BROADCAST' -e 'Link' -e 'packets' -e 'collisions'"

- just love tinkering w/my n800! it's gets so bad the wife unit sometimes does a lopsided smirk, then does a 'wall' and sends:

Code:
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'
| dc
:-)
I get "watch not found" when I try to run
__________________
Paul <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Linux newbie with a N810 OS2008 >>>>>>>>>>>>>>>>>> Art is the lie that shows us the Truth
Don't let a suitcase full of cheese be your big fork & spoon
 
free's Avatar
Posts: 739 | Thanked: 159 times | Joined on Sep 2007 @ Germany - Munich
#9
Originally Posted by bluesubaru View Post
I get "watch not found" when I try to run

http://debfarm.free.fr/nondeb/watch
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#10
Code:
rootsh su -c 'echo `run-standalone.sh zenity --value=$(cat /sys/class/leds/keypad/brightness) --scale --text="Set LED Level" --max-value=255` > /sys/class/leds/keypad/brightness'
Sets the LED level on the N800.
You need zenity (available from Extras - apt-get install zenity) & s/rootsh/sudo/ if your preferred weapon of choice to become root is sudser.

Last edited by qwerty12; 2009-03-14 at 23:52.
 

The Following User Says Thank You to qwerty12 For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 06:42.