Wednesday, August 23, 2006

xinit

I stumbled across this by accident and found it to be a very interesting command.


Say you wanted to run a command from the command line that runs in a GUI(KDE is what I've tested it on)

from the command prompt type(in this example I will be staring firefox web browser):
xinit /usr/bin/firefox

It will load firefox without having to load KDE. Also you'll have to mess around with the commands to get it fullscreen or anything else you want it to do.

If you wanted firefox to load a certain webpage then type:
xinit /usr/bin/firefox "www.website.com"

This command also works if you ssh from one computer to another. Example

I ssh from computer1 to computer2. I am now logged onto computer2. I can now run the same xinit command and it will load firefox on computer2. The catch is that the Xserver can't be running on computer2. If Xserver is running you'll have to kill it or figure out a way to get xinit to use a different display.. I'm going to check into the export DISPLAY command and see if that will work if Xserver is already running.

Tuesday, August 08, 2006

Get rid of MARK messages in / var/log/messages

/var/log/messages filled up with -- MARK -- lines?

Edit /etc/rc.d/rc.syslog. Change the line:

/usr/sbin/syslogd

to

/usr/sbin/syslogd -m 0

Script to help clean out log files

I wrote a short script that helps me clean out log files. I don't care that other scripts exists for this. This is for ME to learn the ins and outs of writing scripts from scratch.

#Script to ask for input, then delete that string from a file
#Command to get string to be deleted
echo "Enter string to be deleted :"
read delstring

#uses the requested input in a script to delete from a file, moves the file to another file then back to the original file so that it doesn't blank out the original file

sed /$delstring/d file1 > file2; mv file2 file1



I added an addition line to ask for the file to be modified. Changes are in red

##Script to ask for input, then delete that string from a file
#Command to get string to be deleted
echo "Enter string to be deleted :"
read delstring

echo "Enter filename to be modified :"
read modfile

#uses the requested input in a script to delete from a file, moves the file to another file then #back to the original file so
#that it doesn't blank out the original file
sed /$delstring/d $modfile > file2; mv file2 $modfile