Dr D's Abode

Code

Renaming files in CVS – and keeping the history

by on May.31, 2009, under Code, Computers, CVS, Linux

So I am working on a personal project, and decided to rename the file.  Now, I know from experiance that you cannot rename a file in cvs, and keep its commit history, but I decided to see if someone found a way.  Well, someone did, partially… http://www.eyrie.org/~eagle/notes/cvs/renaming-files.html

He shows the way I used to do it, mv local file, cvs delete old file, cvs add new file, commit changes. – This deletes the cvs commit history

He also mentions about modifying the raw RCS file and renaming that, but apparently, cvs doesnt like that since cvs itself isnt aware of any changes.

So I tried a mixture of them, heres my process:

  • Find the raw RCS file:  cat CVS/Root CVS/Repository – in my case, /cvs/projects
  • Copy that file somewhere: cp /cvs/projects/currentfile.sh,v /tmp
  • Rename the file in the current checked out sources:  mv currentfile.sh newfile.sh
  • Delete, Re-add, and commit changes: cvs delete currentfile.sh; cvs add newfile.sh; cvs commit currentfile.sh newfile.sh
  • Move the Attic’ed file from cvs: mv /cvs/projects/Attic/currentfile.sh,v /tmp/ currentfikle.sh,v-Attic
  • Copy the old RCS file to the new name: cp /tmp/currentfile.sh,v /cvs/projects/newfile.sh,v
  • Re-cvs up: cvs up

Now you have a renamed file in CVS, that CVS is aware of, and keeping your old history!

Please comment if you find this helpful or if you have any other information to add!

1 Comment :, , , more...

Virtual Machines, trixbox and joy

by on Mar.02, 2008, under Code, Computers, General

So I decided to get a VM server for at home, reduce the number of machines I have in house, reduce power, and learn while Im at it.

So I got my system, its a Intel Duo 2 Quad Q6600 cpu, 4g ram, 750g hdd and I install gentoo on it.

Everything is going fine, until I get to converting my trixbox. Of course, I shouldnt be doing this because trixbox is realtime audio for a phone, on a virtual server. Ive read the bads about it, but I dont care. In my case, its a glorified answering machine.

So I google, and stumble accross some sites, we have http://pbxinaflash.com/forum/showthread.php?t=66 who had two unique solutions which helped, but didnt fix my issue. I tried both solutions, then in the process of doing so, I realized something. If there is a CPU load of say 5-10% going across, the audio sounds perfect!

So of course, I get to finding a way to geneate a low cpu load, that can be “moved over” when something more important comes along.

Now my script, dubbed “generate-cpu-load.sh” was born.

Here is my script, and where its placed to run

——– >8 start code 8<——–

#!/bin/sh
#
# (c) Dan Delaney 2008 http://dan-delaney.com
# generate-cpu-load.sh - To generate a small CPU load on the system so
# that trixbox will play back audio without skipping.
# NOTE: This is NOT to be used for a perminant solution, just to work
# around a problem with vmware and asterisk timing.
while true; do
nice -n19 find /etc/asterisk > /dev/null 2>&1
done

——– >8 end code 8<——–

Of course, we need this to run constantly in the background, so I put it in my rc.local file

echo "nice -n19 /root/generate-cpu-load.sh &" >> /etc/rc.d/rc.local

and to start it without rebooting: sh -c "nice -n19 /root/generate-cpu-load.sh &"

Now, dont go knocking me down because this creates a constant CPU load. This does not make the system ready for production, nor may it work on anyone else’s system.

If you find this helpful or just whatever, just drop me a line and say so!

Comments Off on Virtual Machines, trixbox and joy more...

MythTV, TV recording, and 3GP streaming

by on Sep.03, 2007, under Code, Computers

Well, I haven’t written much about it, but I do have a MythTV setup on a Gentoo box at home.

The reason its running on Gentoo is simply because KnoppMyth didn’t give me the upgrade options I wanted without a re-install, or upgrade which breaks the system, and the fedora based installs didn’t work correctly on my hardware. Needless to say, I am very pleased with MythTV, on my Gentoo box.

Recently, Ive been looking into seeing if I can set up streams from my PVR, to my PDA phone. I found this file type, .3gp, which most modern systems recognize and play without problems. I came across a few websites [Links here, here, and here] that showed you how to encode videos into the 3gp format. However, on my system, the encoding process was not working correctly. After making sure I had all the correct USE options for my gentoo setup, I decided to try the first links directions, and compile a separate install for ffmpeg, dubbed ffmpeg_3gp.

Like all directions, things change, and I had to adopt the new options and such to get things to work, which is why im writing this. I figured I spent some time on getting it to work, and wanted to share my knowledge with the rest of the world (or whoever reads this)

Starting off, I made sure my system was up to date (Gentoo, 2007.0), I ran emerge –sync, of course.

Next, I had to download the ffmpeg source, the command used in the first link did not work, so I went to the website, and found the correct command:

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

Then, I cd’ed into the directory, and ran the config script, again, new versions, there was a different option to run:

./configure –enable-libamr-nb

The original documentation stated that there would need to be additional files downloaded, but I saw no note of this, so I decided to download the files anyways.

wget “http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip”

I downloaded this one, because when trying to use the build in ebuild, gentoo downloaded this file as well. I followed the directions from here on out, copying the new executable from the current directory, to /usr/local/bin/ffmpeg_3gp

Then of course, the script to encode everything, I had to jazz up a bit:

mythtv@hermes ~ $ cat /usr/local/bin/myth3gp.sh
#!/bin/bash

PATH=”/bin:/usr/bin:/usr/local/bin”

NICELEVEL=”19″

OUT=”/mythtv/3gpvideo”
TMP=”/mythtv/3gpvideo/tmp”
OUTFILE=`echo $2 | sed -e ‘s/ /_/g’ -e ‘s/:/-/g’ -e ‘s/\!//g’`

TITLE=”`echo $2 | sed -e ‘s/^.*[0-9]-//g’`”
TIMESTAMP=”`date`”
COMMENT=”This video was encoded with ffmpeg on `hostname -f` at `date`”

RESOLUTION=”176×144″
# 176×144 default
# 352×288

sudo nice -n $NICELEVEL ffmpeg_3gp -y -i “$1” -title “$TITLE” -timestamp “$TIMESTAMP” -comment “$COMMENT” -s $RESOLUTION -b 64k -r 15 -ac 1 -ar 8000 -ab 12.2k “$TMP/$OUTFILE.3gp” || exit 2

# do 3gp stuff
MP4Box -3gp -mtu 1450 -hint “$TMP/$OUTFILE.3gp” -out “$OUT/$OUTFILE.3gp” || exit 2

rm -rf $TMP/$OUTFILE.*
Install the script into the user Jobs, and the hard part should be done.

Next is the setup of the streaming server. I attempted to use the Darwin Streaming server, but ran into problems. Thats where I am now, and plan to continue on.

I hope this page helps people out if they ever run into problems with this type of setup.

EDIT:

So I just checked, and it looks like its been fixed in gentoo on a newer ebuild version, but it looks like its masked for some reason. The reason it wasn’t working is because they were using the old –enable line, instead of the new one. BLEH

oh well.

Comments Off on MythTV, TV recording, and 3GP streaming more...

Geek Code

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GIT d-(+) s:+ a C++ BL++++ P++>+++ L++(+++) E--- W++ N o K- w O M V-- PS
PE Y+ PGP+ t+ 5 X+ R tv b DI D+ G e+ h+ r-- y+
------END GEEK CODE BLOCK------

Linux Counter

Certifications


 

PSN Portable ID

Powered by

Hacker
 
Powered by Gentoo Linux