Re: java decoder?

2008-02-18 Thread Jim Bow

Gary Kline wrote:

I doubt this but is there anything that will take a foo.jar and turn in back 
into java?  Or at least assembler?   


This really isn't the place for such questions.

As to the question itself, Im no java man, but I think a jar is an 
archive of classes, meaning you can extract them and then use a java 
decompiler to decompile the classes to get the source.


Good luck.


JimBow
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: pf.conf for variable interfaces

2008-02-08 Thread Jim Bow

Erik Norgaard wrote:

Chad Perrin wrote:

I'm setting up PF on a FreeBSD laptop that sometimes uses the wireless
device (iwi0) as its external interface, and sometimes uses the RJ-45
ethernet device (bge0) as its external interface.  Unfortunately, I
haven't figured out yet how to make that happen.


How about this:

ext_ifs = { iwi0 bge0 }
block in quick on ext_ifs all
pass out quick on ext_ifs all keep state
...


This is nice, but any ideas how to do this if the wireless interface 
is only present some of the time, ie its a pcmcia card?



JimBow
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: time in jail one hour behind the jailhost

2008-02-07 Thread Jim Bow

Johan Hendriks wrote:

Hello all

I have a question regarding my time in a jail.

I use ntp on the jailhost, but my jails are all one hour behind the
host.

Can someone tell me how to fix that!


Try running 'tzsetup' in the jail and selecting the correct timezone 
there.



JimBow
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Need help with backup shell script

2008-01-16 Thread Jim Bow

Andreas Widerøe Andersen wrote:

#!/bin/sh

MOUNT=/external
DATE=`date +%Y%m%d%H%M`

mount /dev/da0 $MOUNT #Change device name
find $MOUNT -mtime +30 -delete
mkdir $MOUNT/$DATE
rsync -rlpgoD /backup/ $MOUNT/$DATE
umount /external

When I try to run my script I get this prompt back:

mount: /dev/da0 on /external: incorrect super block


This fails because you are trying to mount the raw(?) drive and mount is 
unable to detect what file system it is (by looking at the partition's 
super block).



Am I doing something wrong here or do I need to I need to use one of the
other from /dev:


You want to use /dev/da0s1d - the main partition on slice 1 on the drive.

Sorry, I dont remember the explanation as to why you must use da0s1d 
instead of da0s1c, but it goes something along the lines of c partition 
being a shorthand notation for the entire slice, whereas letter d marks 
the first partition on the slice.


Maybe someone here can clarify this?

Hope this helps.



Jim Bow

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: mail from: field question

2008-01-15 Thread Jim Bow

Ian Smith wrote:

paqi# alias um
tty;id -p;who am i
paqi# um
/dev/ttyp3
login   smithi
uid root
groups  wheel operator network
root ttyp3Jan 11 14:09

Note 'id -p' showing 'login smithi'; see id(1) .. I gather that sendmail
must also use getlogin(2) - which value does not appear in `env` - when
sending mail from an su'd session, as opposed to an original root login,


Yes, I think you've hit the nail on the head there.

  The actual thing Im trying to do is to email something from a script 
  that runs as root from devd, but I run into the same problem of the 
  email arriving from somebody other than root, hence trying this manually 
  on the command line.


Is 'somebody other than root' consistent, and someone who's logged in,
perhaps before su'ing and then starting the session that invokes devd?


'somebody other than root' is the same user each time. They are not 
logged in at the time the script runs, but do own some active processes 
(most notably screen).


  There is definitely something that I am overlooking, but what is it? I'm 
  extremely curious to work-out why I'm seeing such behavior as its 
  defeating all my expectations so far.



I noticed later that Paul gets a different result .. maybe postfix as
mentioned


Postfix doesn't seem to be affected by the same issue and works as one 
would expect when run from command line and devd. I've also tried using 
nullmailer and that works ok too.


Seems that sendmail's workings were responsible for the confusion. I'm 
going to be replacing it with nullmailer on all machines.



Thanks for all your help,



Jim Bow
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: mail from: field question

2008-01-10 Thread Jim Bow

Lowell Gilbert wrote:


The answer will probably depend on the MTA you're using (which you
didn't mention, so it's probably sendmail)


You've guessed it. Its out-of-the-box sendmail.

Run the script from the command line and in particular just call 

 mail the way the script does.

If I run the script (or just send a mail) on the command line using 
sudo, then it's sent as me and not root. Same happens if I su to root first.


The only way I can get it to be sent from root is if I explicitly login 
as root.



 Make sure the results are the same (if they're not, the MTA isn't

 the problem).

So it looks like it isn't. What can be the cause of this then?


Thanks for your help.


JimBow
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: mail from: field question

2008-01-10 Thread Jim Bow

Mike Bristow wrote:

On Thu, Jan 10, 2008 at 10:46:30AM +, Jim Bow wrote:
If I run the script (or just send a mail) on the command line using sudo, 
then it's sent as me and not root. Same happens if I su to root first.


use 'su -'.  It means you get a login shell (which sets up the enviroment
in the same way that login does).


That makes perfect sense, but doesn't seem to work. Here's the output of 
my terminal session:


host% whoami
jim
host% sudo su - (tried doing su - also, with same results)
Password:
host# whoami
root
host# env
USER=root
HOME=/root
SHELL=/bin/csh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin
MAIL=/var/mail/root
BLOCKSIZE=K
FTP_PASSIVE_MODE=YES
TERM=screen
HOSTTYPE=FreeBSD
VENDOR=intel
OSTYPE=FreeBSD
MACHTYPE=i386
SHLVL=1
PWD=/root
LOGNAME=root
GROUP=wheel
HOST=host.example.com
EDITOR=vi
PAGER=more
host# cat /etc/motd  | mail -s hello [EMAIL PROTECTED]

This results in the mail from: header of [EMAIL PROTECTED] I've 
tried this on two different hosts with the same result.


The actual thing Im trying to do is to email something from a script 
that runs as root from devd, but I run into the same problem of the 
email arriving from somebody other than root, hence trying this manually 
on the command line.


There is definitely something that I am overlooking, but what is it? I'm 
extremely curious to work-out why I'm seeing such behavior as its 
defeating all my expectations so far.


Thanks for reading.


JimBow



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: mail from: field question

2008-01-10 Thread Jim Bow

Paul Schmehl wrote:
I'm not sure what, but something is wrong.  I did the exact same thing 
you did, but the results are completely different.


The only difference I can spot is that you are using Postfix, while the 
hosts I'm using all run standard Sendmail.


Could this be the problem? I might give it a quick test to find out for 
sure.


Thanks,


Jim Bow



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


mail from: field question

2008-01-08 Thread Jim Bow

Hi all,

I have a small shell script that does a backup to a usb drive and emails 
the results to a set of people. The script is triggered from devd (upon 
drive attachment) and runs as root.


The problem is that the mail report is sent from an active system user 
and not user root. The user the mail is sent from is not referenced in 
the script. The mail line looks like this:


   cat $LOGFILE | mail -s backuptousb report [EMAIL PROTECTED]

I find this rather confusing since I was expecting the email to be sent 
by the user running the script. How can this be?


A little research told me that this may be because of something called 
envelope-from, but I found little explanation of what that actually 
means. Anyone have any suggestions?


Thanks,



JimBow
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Jim Bow

Hey Steve,

Steve Franks wrote:


Ah!  You'd think any one of the many tutorials I read would have
mentioned that little detail ;)


Tutorials do have a tendency to look over important details.

That's why I would always recommend a good book, something like UNIX 
Power Tools in your case, which, if not explains, then at least mentions 
most of the little things.



JimBow
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: batch rename

2008-01-07 Thread Jim Bow

Jeff Laine wrote:


My goal is to rename several files in such a way as to decapitalize starting
letters in their names.
The solution seems to be simple but I'm stuck. What should I use? awk/sed or
write some shell-script?


I found myself at this point once too, and then I discovered 
/usr/ports/sysutils/rename.


Sure, its not as crazy as krename (it wont read any metadata), but it 
runs in a terminal, is written in C and supports extended regular 
expressions.



JimBow
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]