View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 9 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Jul 17, 2005 9:47 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,
I just sent a list of a few tweaks that I do to my KnoppMyth box to a fellow board member. He was kind to share a script with me for testing (works great but he will have to do his own sharing when ready)

Anyway, long story shortened a little, I have been following the knoppmyth project for longer than I care to dwell on :) but it has been educational. One of the lessons learned is that it can be difficult to remember all the details of things done to make something work or do something different.

For that reason, as memtioned in other posts or at least hinted toward that I did a
# mkdir /myth/tools
directory and
# chown mythtv:mythv /myth/* .
In that little space I store all my tools to be able to do a repeatable upgrade or install. All these little tools will fit on one floppy so you may have them for an install else where too.

Here is what I sent. Most of these you should be able to just copy and paste to make your own scripts. You execute them by preceding the file name with sh and a space.


When I do a reboot I also force a backup. It has happen several times in the past that I would forget and then do an upgrade. Well things get lost when that happens so now on reboot or halt an automatic backup is called. I added sounds so that I know it is alive :) You may have noticed that this should all be copy & paste steps to build your own.

nano reboot-control
#<code>
#!/bin/bash
(play /usr/share/sounds/beg.wav >& /dev/null)&
/usr/local/bin/mythbackup
(play /usr/share/sounds/end.wav >& /dev/null)
sleep 3
(play /usr/share/games/frozen-bubble/snd/applause.wav >& /dev/null)
sleep 3
sudo reboot
#<end code>

I set it up with another script

nano fix-reboot
#<code>
#!/bin/bash
cp reboot-control /usr/bin/
chmod +x /usr/bin/reboot-control
#<end code>

and for the halt command:

nano halt-control
#<code>
#!/bin/bash
(play /usr/share/sounds/beg.wav >& /dev/null)&
/usr/local/bin/mythbackup
(play /usr/share/sounds/end.wav >& /dev/null)&
sleep 2
#(play /myth/saytime/bummer.wav >& /dev/null) #seach the web for saytime
sleep 3
#(play /myth/saytime/fart.wav >& /dev/null) #ripped from live knoppix ver 3.8.2 cd
sleep 3
sudo halt
#<end code>

You can add your own sound choices as there are a few available in knoppmyth,
# find / -name *.wav gets a good selection.

nano fix-halt
#<code>
#!/bin/bash
cp halt-control /usr/bin/
chmod +x /usr/bin/halt-control
#<end code>

As with anything I change, I copy the original to my tools directory and tweak it there.

I modify knoppmyth.xml by adding this to the bottom (remove original halt & reboot)


<button>
<type>Halt</type>
<text>Halt System</text>
<action>EXEC sh /usr/bin/halt-control</action>
</button>

<button>
<type>Reboot</type>
<text>Reboot System</text>
<action>EXEC sh /usr/bin/reboot-control</action>
</button>


oh yes, another script

nano fix-knoppmyth.xml (notice any trend?)
#<code>
#!/bin/sh
#
cp /myth/tools/knoppmyth.xml /usr/share/mythtv/knoppmyth.xml
chmod +x /usr/share/mythtv/knoppmyth.xml
#<end code>

If you run this one, it gives one stop shopping.
nano fix-apt-setup
#<code>
#!/bin/sh
#setup apt-get
#
echo "Will load -updates- installs -ftp- -mozilla- and -thunderbird-"
echo "this will take several minutes and does require operator action"
echo " select auto for mozilla and debian for email. These are both in the desktop menu under Net"
apt-get update
apt-get install ftp
apt-get install mozilla
apt-get install mozilla-thunderbird
#<end code>

I hope these are helpful. If so, I have a few more if interested. I just have a basic machine using R5A16 (awsome) e-machine +1600 (1.3 ghz) 256 meg, 16 gig hd with a pvr-350. Someday maybe there will be a larger drive in the budget and it will become hdb /myth No install / upgrade required :) Would be a nice install option? Choose the drive for the /myth. :)
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 24, 2005 2:01 am 
Offline
Joined: Sat Jul 23, 2005 10:45 pm
Posts: 19
This may seem like a dumb question, but how do I copy and paste? For example, I want to copy your text here on this forum from Firefox into Xedit, vi, etc. I see the coplied text go into the xclipboard, but I cannot paste it into vi or exit.

I tried cream, but it requires downloading another 44MB of stuff to get it to work.... 44MB for a text editor?

For someone used to notepad.exe for windows, this sort of thing can be VERY frustrating.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 24, 2005 2:28 am 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
Try the middle mouse button for paste. If you have a 2 button mouse, press both buttons at once.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 24, 2005 4:35 am 
Offline
Joined: Sat Feb 26, 2005 9:05 am
Posts: 160
Location: Ipswich, UK
I tend to do my major file editing in notepad, and then copy the file onto my myth box over the network...

Mephi


Top
 Profile  
 
 Post subject: Quick tip
PostPosted: Sun Jul 24, 2005 6:15 am 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,
Quick word of quidence, if you copy &paste into nano, use nano -w (no word wrap) as if a line is broken it will fail. Not hard to fix.

Same with notepad, turn word wrap off.

Hope that helps an good to someone interesting in experimenting. :)

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 24, 2005 11:21 am 
Offline
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location: Nashville, TN
also if you are going to use a windows program to edit unix files use wordpad not notepad, as notepad doesn't do unix style line feeds.

_________________
Have a question search the forum and have a look at the KnoppMythWiki.

Xsecrets


Top
 Profile  
 
 Post subject: I didn't know that
PostPosted: Sun Jul 24, 2005 9:19 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi Xsecrets,
Learn something new everyday! Didn't know there was a lf handling difference between those two apps. The word wrap switch would still apply though as a long linux statement will fail if broken improperly.

Nano caught me on that a couple of times before I took the time to read the man pages :) For those who don't know how a command works, at a prompt $ man nano or $ man ls and so on. Some commands have many switches to control what it does (tar is a good exacmple).

Thanks for the tip Xsecrets.
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 24, 2005 10:30 pm 
Offline
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location: Nashville, TN
yeah it's very obvious of the line handling if you just pull a long (more than one line ) script from a unix box and open it up in notepad it will be all kinds of weird with little boxes instead of line breaks.

_________________
Have a question search the forum and have a look at the KnoppMythWiki.

Xsecrets


Top
 Profile  
 
PostPosted: Sun Jul 24, 2005 10:58 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi Xsecrets,
It is a bit amazing what one looks at and can accept as ok, I don't know how may little tweaks I have done with those "long lines in notepad" :) I was alway leary that wordpad would stuff something into file and break it so I just grin and bear it with notepad. I try to keep my linux work on a linux box and usually use vi although I am starting to get to like nano since I found the -w switch. Maybe will change the alias for it so it is a default setting.

Have a good night, alway a pleasure.
Mike


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu