customize CFLAG with /etc/mk.conf

2010-03-26 Thread Aaron Lewis

Hi,
   Is that possible to modify CFLAG for port installed software ?

   I read `man mk.conf' found there's no CFLAGS or CXXFLAG entries , 
even though i tried to
   put `CFLAG += -O3 -march=i686' into that file , but ports doesn't 
recognize it.


   Just want to optimize ports software , during compilation of kernel 
, i'd comment them out.


   Does anyone has any ideas ?

   Thanks in advance !

--
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode



Re: customize CFLAG with /etc/mk.conf

2010-03-27 Thread Aaron Lewis

Thanks Jacob , I just want to make some graphic software faster.

Cause i have a core2 cpu , supports mmx code and some other features ,
i'm trying to see if it really helps with those compiler flags.

Jacob Meuser wrote:

On Sat, Mar 27, 2010 at 10:05:02AM +0800, Aaron Lewis wrote:
  

Hi,
   Is that possible to modify CFLAG for port installed software ?

   I read `man mk.conf' found there's no CFLAGS or CXXFLAG entries ,
even though i tried to
   put `CFLAG += -O3 -march=i686' into that file , but ports doesn't
recognize it.

   Just want to optimize ports software , during compilation of
kernel , i'd comment them out.

   Does anyone has any ideas ?



I've built things with '-O3 -march' on OpenBSD throughout the years.
*never* has it improved *anything*.  at best, the difference is not
noticible, at worst things are slower and less stable.  and I'm talking
like I did this a month ago with multimedia software that uses such
flags by default.

  



--
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode



Re: customize CFLAG with /etc/mk.conf

2010-03-27 Thread Aaron Lewis
Christian Weisgerber wrote:
> Aaron Lewis  wrote:
>
>   
>> I read `man mk.conf' found there's no CFLAGS or CXXFLAG entries , 
>> even though i tried to
>> put `CFLAG += -O3 -march=i686' into that file , but ports doesn't 
>> recognize it.
>> 
>
> No such variable is used by the ports infrastructure.  Note the
> name, CFLAG is not the same as CFLAGS.
>
>   

Yeah , its a typo , should be CFLAGS.
>> Just want to optimize ports software , during compilation of kernel 
>> , i'd comment them out.
>> 
>
> Yes, you can set CFLAGS and CXXFLAGS in /etc/mk.conf or the environment
> and most ports will pick it up.  (Some don't for sound technical
> reasons, a few don't and it's an error that needs to be fixed.)
>
> Generally speaking, I advise against playing with gcc's optimization
> flags.  You will not see an improvement, and some of these optimization
> steps may actually generate incorrect code.  The time you spend
> fiddling with these settings will be more than you can ever gain
> from them.
>   

You're right Christian.
AFAIK , sqlite can't work with intel mmx instructions , gcc generate
wrong asm codes
> I do occasionally set CFLAGS to build a port *without* optimization
> when I need to debug a problem with gdb(1).  Single-stepping through
> code that has been run through -O2 can be a surreal experience.
>
>   
Use CFLAGS to build software with debug information is a good hack ,
i'll take your suggestion.


-- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode



[SOLVED] Re: customize CFLAG with /etc/mk.conf

2010-03-27 Thread Aaron Lewis

First of all , thanks for all your experiences ;-)
Forgive me , i didn't response to all your mail.

So let me do a summary , after collection all you mails:

I) generating CPU featured assemble takes longer time , also risks in 
creating wrong code
II) customize compiler flag on OpenBSD doesn't values so much as what we 
costs to achieve it.


Thanks again !

Ivan Nudzik wrote:

Aaron,
I built 3.7 base + OpenVPN for VPN gateway with custom 
CFLAGS/LDFLAGS and it worked well for years, even with such aggressive 
flags as CFLAGS="-O3 -march=c3 -mmmx -m3dnow -fomit-frame-pointer" and 
LDFLAGS="-Wl,-z,combreloc -Wl,-O2 -Wl,--sort-common 
-Wl,--enable-new-dtags". But build was broken and I must to fix many 
things in OpenBSD makefiles, to get binaries done. Such LDFLAGS 
significantly speedups application loading, cause it's doing the same 
things as prelink utility, but it link time. CFLAGS helps me speedup 
C3 500MHz router device as about 20-30%, but it was synthetic 
measurement on nbench built with and without CLFAGS. Kernel build was 
also forced for such CFLAGS and no stability issue and subjectively 
more speedy.
I've read about that , e.g kernel avoid intel MMX instructions , cause 
it may cause interrupts (handle lots of register together to combine a 
bigger register)
It was few years ago, when I've had mood to compile everything 
with all CPU features on. ;-) 
Yeah , i'm so interesting with CPU features on my Linux right now , like 
what you did  a few years ago ;-)


Looking at this concrete OpenBSD build my summary is that it took me 
more than 20h to build it and speedups was not such significant, 
comparing that it should took an about 1h to do the same functionality 
with release binaries only bit slow. And two other things to keep on 
mind: nowadays x86 CPUs has very heuristic instruction 
handling/prefetching so it will not speedup as much with custom 
CFLAGS; OpenBSD still use gcc 3.3.5 which can't do as good 
optimization for new CPUs as to loose time with custom flags build. 
And many makefiles in OpenBSD base don't handle CFLAGS/LDFLAGS 
correctly. The last time I tried it (about 1/2y. ago), I made only 
kernel with custom flags (for kernel it is COPTS variable if I 
remember right). Rest of system didn't build and I didn't had a time 
to bother with broken makefiles.
So if you don't want to do HPC, don't loose time with custom 
flags. I if you want to do HPC, choose other operating system, cause 
OpenBSD strengths are other.



I take your suggestion , ain't gonna waste time playing gcc's flags.


--
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode



Re: how to install OpenBSD in a computer with Linux and Grub2

2010-04-06 Thread Aaron Lewis
On 04/06/2010 07:27 PM, Salvador Fandino wrote:
> AFAIK, this procedure is not documented in any place and it is quite
> handy in order to install OpenBSD on boxes that already have a recent
> Linux inside and use grub2 as the boot manager:
> 
> 0) do any preparatory work needed: backup your data, resize your
> partitions, create a new one for OpenBSD, etc.
> 
> 1) download bsd.rd and move it to the Linux root partition:
> 
>   # wget ftp://ftp.openbsd.org/pub/OpenBSD/4.6/i386/bsd.rd
>   # mv bsd.rd /openbsd.rd
> 
> 2) add the following entry to /etc/grub.d/40_custom
> 
>   menuentry "Install OpenBSD from RAM disk" {
> set root=(hd0,1)
> kopenbsd /openbsd.rd
>   }
> 
> replacing (hd0,1) by the partition id corresponding to the Linux root
> file system.
> 
> (you may need to modify also /etc/default/grub in order to make grub2
> menu visible)
> 
> 3) regenerate grub configuration:
> 
>   # update-grub

I'm on Gentoo Linux , so i think normally you should try with
`grub-mkconfig'
e.g grub-mkconfig > /tmp/grub.cfg && cp /tmp/grub.cfg /boot/grub/grub.cfg

Not all system ships with `update-grub' script.

> 
> 4) reboot:
> 
>   # reboot
> 
> 5) When the grub menu pops up select "Install OpenBSD from RAM disk"
> 
> 
> ... and install OpenBSD
> 
> 
> Cheers,
> 
> - Salva
> 


-- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode



Best System Call Tracer

2010-04-09 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
Is there any dtrace or strace like tools in OpenBSD ?

Thanks in advance !
- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAku/DZ4ACgkQvf41sEptMqCWgwCfQf16xOvKCwsIuRo6vtbb24bU
HKoAn1XanS91TbbyCeif6eJDYBO0Jw64
=4gVg
-END PGP SIGNATURE-



Re: Best System Call Tracer

2010-04-09 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

apropos trace is cool !
systrace,ptrace,ktrace .. i'd try with them ;-)

Thanks Lambert.

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAku/EYcACgkQvf41sEptMqCk+QCgp0E0Y9E0iRg0Hqgk3LCBPABQ
GokAoJGgOTwDrWA81qMoTNhSPikiEfmF
=halO
-END PGP SIGNATURE-



[SOLVED] Re: Best System Call Tracer

2010-04-09 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/09/2010 07:30 PM, Will wrote:
> On Fri, Apr 9, 2010 at 7:21 AM, Aaron Lewis  wrote:
>>
>>

ktrace & kdump displays asm code , that's what i want.

> There's ktrace. When run, it (by default) writes its output to a
> ktrace.out and then you can use kdump to output that file in a
> human-readable format. man 1 ktrace for more information.

Thanks Will ;-)


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAku/Eb4ACgkQvf41sEptMqBjHACeK6nzu5luruircdOgWgQCQ9Y+
CsYAn3qCY8zDYH6VRenmXWeyqbgTbceE
=6iZp
-END PGP SIGNATURE-



Howto Create a Auto-Extract Package with Shell Script & tar ?

2010-04-09 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
I'm trying to make a small binary package , which aims to install some
X11 fonts to /usr/share/fonts/truetype.
Creating such a binary package will allow me to port it on any
UNIX/Linux system , very useful.

Firstly i need to compress my fonts to a Font_Name.tar.bz2 , if i want
to put the extract script and Font_Name.tar.bz2 together  , a single
bundle , howto archive it ?

Right now , i tried to append the Archive to the script file , Then try
to read through the `setup file' except for the first 5 lines.

#!/bin/bash





tail +5 $0 | tar xvf - -C /tmp
exit 0
#
//Append Tar.Bz2 file

Doesn't looks like a good way , anyone could help ?

Thanks in advance !


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAku/0cEACgkQvf41sEptMqCJgQCfQESwZdv2QvE9j1q9l1AM4fUZ
EW0AoJbplPCW0bnCrzE4wI8IHC9g/Ugk
=3kRR
-END PGP SIGNATURE-



Re: Howto Create a Auto-Extract Package with Shell Script & tar ?

2010-04-10 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/10/2010 05:22 PM, Jean-Philippe Ouellet wrote:
> 
> If you are really only trying to distribute a package of fonts, you're
> better off just distributing it as is, and telling people where to
> extract it on a given system. If you look at most bundles of files in
> unix, they are .tar.gz or .tgz. If everybody does it, there must be a
> reason for it. Simpler is always better.
> 

Thanks for your experience !
There should be a reason why people prefer gzip other than bzip2 , i'd
try to put them all in tgz.


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvAUecACgkQvf41sEptMqAB6ACgg6hDSKWJm/hLeDEOWTl+DfsY
MQEAoK8dr/kDOVrtxYhGhRYrYSLX66+l
=1V+g
-END PGP SIGNATURE-



[SOLVED] Re: Howto Create a Auto-Extract Package with Shell Script & tar ?

2010-04-10 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/10/2010 04:56 PM, Toni Mueller wrote:
> Hello,
> 
> On Sat, 10.04.2010 at 09:17:53 +0800, Aaron Lewis  
> wrote:
>>  Firstly i need to compress my fonts to a Font_Name.tar.bz2 , if i want
>> to put the extract script and Font_Name.tar.bz2 together  , a single
>> bundle , howto archive it ?
>>
>>  Right now , i tried to append the Archive to the script file , Then try
>> to read through the `setup file' except for the first 5 lines.
> 
> maybe you can use or tweak 'shar' to do what you want.
> 
> $ man shar

Yeah , that's what i'm looking for , thanks !
Encoding to readable characters , and easy to hack it ;-)

> 
> 
> Kind regards,
> --Toni++
> 


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvAUlEACgkQvf41sEptMqAJ9QCgwCMRNz+T9RGarMnit4ybnW9C
yUAAniDQAZQ5vpWBHJsGsR2TKR44GINc
=Z8aB
-END PGP SIGNATURE-



[SOLVED] Re: Howto Create a Auto-Extract Package with Shell Script & tar ?

2010-04-10 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/10/2010 06:25 PM, Stuart Henderson wrote:
> On 2010-04-10, Aaron Lewis  wrote:
>>
>> Hi,
>>  I'm trying to make a small binary package , which aims to install some
>> X11 fonts to /usr/share/fonts/truetype.
> 
> /usr/share/fonts/truetype -> not portable
> 
>>  Creating such a binary package will allow me to port it on any
>> UNIX/Linux system , very useful.
>>
>>  Firstly i need to compress my fonts to a Font_Name.tar.bz2 , if i want
>> to put the extract script and Font_Name.tar.bz2 together  , a single
>> bundle , howto archive it ?
>>
>>  Right now , i tried to append the Archive to the script file , Then try
>> to read through the `setup file' except for the first 5 lines.
>>
>>  #!/bin/bash
> 
> /bin/bash -> not portable

Oops , my linux background .. you're right Stuart.

> 
>> tail +5 $0 | tar xvf - -C /tmp
>> exit 0
>> #
>> //Append Tar.Bz2 file
> 
> bz2 -> not as portable as it could be
> 
> relying on tar to autodetect compressed archives -> not portable
> 
> running some random downloaded shell archive with sufficient
> permissions to install to /usr/share without a good way to inspect
> what it's going to overwrite -> not safe
> 
>> Doesn't looks like a good way , anyone could help ?
> 
> the simple portable safe way is a tar.gz with a README and ideally
> a Makefile.  people know how to use these.  use a variable for the install
> target so people can override it on the make(1) command line.

Makefile + ReadMe is yet another good way. Put different entries based
on different OS , and people just override Makefile command line.

I've similar things before

e.g
make openbsd
make solaris
make linux ..

Simpler is easier anyway ;-)

Thanks to all of you.


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvAVdYACgkQvf41sEptMqD36gCg2PYIlMjNBwhx6zS2rblyEyoJ
LXgAoJDKuYwXKLoJ5Vj+D69DJ2aROJv5
=LWAY
-END PGP SIGNATURE-



Re: [SOLVED] Re: Howto Create a Auto-Extract Package with Shell Script & tar ?

2010-04-10 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> the only thing you probably want to change is the directory, so
> something like
> 
> make INSTALLDIR=/usr/share/foo/bar
> 
> and you can put a default definition for INSTALLDIR in the Makefile
> 

Yeah , right , modify such a macro is yet another good way ;-)

I'd put them in , too.

Thanks.


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvAXnAACgkQvf41sEptMqAEiQCggEy8NMKnPyRNKXgoVyuIxG+a
bmoAn3pCeZ0NJjZZYbts5TORTAEVwu8Q
=gnUw
-END PGP SIGNATURE-



Generic Discuss about CPU resource scheduling

2010-04-18 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Hi,
I'm reading Operating System Concepts (7th Edition) , Written by
Abraham , Peter & Greg.

In chapter 5.3 , it talks about a schedule algorithm: SJF
SJF means shortest jobs schedules firstly.

To compare different process , thy use a process running time.

e.g
P1 takes 6 secs to run
P2 takes 3 seconds
P3 takes 10 secs

Then we should put those tasks in array like this:
P2 => P1 => P3

That looks much reasonable , but my question is , how does an OS know
that a process will takes longer time to finish its life ?
I think it's impossible to let OS know exactly how long a process will
take to run.


So far in my experience , i think there's a few ways to compare
Process running time:

Forgive me if i have a poor experience on OS ;-)

I) Number of Loops in a Program , can be detected by compiler
As long as you have any loops , you are slower than any straight ahead
program

II) Length of Program , longer code takes longer time sometimes , not a
good way.


Anyone wants to share some experience with me ?

Be very glad to hear your voice ;-)



- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvLCq4ACgkQvf41sEptMqB/tgCgickA4qHtRxw7TpkAIi6ghHbz
x+kAoKaMkC0FU7NLioMw1hvhEuOvifO/
=S080
-END PGP SIGNATURE-



Re: Generic Discuss about CPU resource scheduling

2010-04-18 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/19/2010 12:10 AM, Luis Useche wrote:
> I don't think there is a way the operating system can detect how long is
> going to last some particular process. Not even the compiler can do this.
> 
> This makes me remember of Turing's proof where there is no way to compute if
> a program will terminate at some point or not.
> 

I agree with you , it's impossible to detect process running time , so
what i'm doing is just try to compare it , wondering will it be possible.

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvLnzIACgkQvf41sEptMqDTXQCfZypOcgFugUy3zspY+fqtjVQN
9GoAn1Kytd635xWphX8tc87zG+wwugft
=KQJx
-END PGP SIGNATURE-



Re: Generic Discuss about CPU resource scheduling

2010-04-18 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

>>
>> You cannot tell in general, that's a basic result from CS. But you can
>> measure previous runs and do predictions based on that, in some cases
>> at least. I hope I'm not answering a homework assignment...

Nope , this has nothing to do with homework , just i was wondering how
does an OS implement such an algorithm in real world.

>>
>>  -Otto
>>
> In general you cannot predict, however there are many (long) jobs with 
> very predictable times to completion: sorts, merges, most anything that
> processes thousands of records in one batch operation.
> (and ties up various resources for the duration --- thein is the gotcha)
> I would not trust counting instructions, loops, subroutine calls as
> being usefully predictive of execution time.

Yeah , looping time depends the complexity of that loop , i've learned
that ,
We use a O(n) to present such complexity of a program.

> 
> The fun thing about scheduling algorithms is that any one of them
> is usually theoretically capable of giving the worst possible overall 
> performance.


That's why there's so many runtime exceptions in cplusplus , can't avoid
all of it. It's unpredictable anyway.


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvLoNgACgkQvf41sEptMqDkJgCfXSYyJHBBzyt4QeFmKu8v/Ra7
aAUAn3jdYLwCvUfeyjA0BjsEchphInqC
=zInF
-END PGP SIGNATURE-



Re: Generic Discuss about CPU resource scheduling

2010-04-18 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/19/2010 12:55 AM, Ted Unangst wrote:

> You measure how long it took to finish its previous time slices.

Yes , that's an Real Time OS , it use CPU time slices.

I don't know if Process total running time is recorded in the PCB.

Once a process acquired the CPU time slices , it can choose to use it up
at one time or a few times , as long as it did finish that slice.

So i should measure the total running time of previous time slice ?
That will be kept as a statistics , am i close ?

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvLo14ACgkQvf41sEptMqCpMgCgowFZJcjZKd08x5rOKP7hvi37
WGsAn0X96Udb2KSLXgIk5phs3u37BM7d
=D2X+
-END PGP SIGNATURE-



[SOLVED] Re: Generic Discuss about CPU resource scheduling

2010-04-20 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

First of All , Thanks to all your help ;-)
All the replies are good , and enlightened me.


Finally as i read more of the book , i found a good way to solve this
problem.

They use multiple queues , which has different CPU time for a slice.
That's a good way as a statistics of running time.
Shorter tasks will be available to execute , and finish earlier.

- -
|   7s CPU time per slice   |   // Queue 1
- -

 ==> if a process didn't finish , move
it to next queue.

- -
|   14s per slice (maybe)   |   // Queue 2
- -

...

And different queues owns different priority , of course.


Thanks again for all of your experience !

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvNikYACgkQvf41sEptMqDnVACguzyJFMSyurqW6RpQE3lay/g3
M2gAn1wOQ+pl0guyKQQD7lQe2SBCAq71
=lHeF
-END PGP SIGNATURE-



Problems with Samba , can't switch to pdb password database backend

2010-04-24 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
How can i switch to pdb password backend , and disable the old
`smbpasswd' pattern ?

It's a fresh install , didn't put anything else in global section.

//  Config
//
[global]
workgroup = SELABO
server string = Aaron's Server On Sara
log file = /var/log/samba/smbd.%m
max log size = 50
dns proxy = No


When i use
r...@sara # pdbedit -u username -a
It told me /etc/samba/smbpasswd doesn't exist , and successfully created it.


So i have two questions:

I) I tried to use `smbpasswd -u username` & `pdbedit -u username -a` ,
and compared the hashes , found it's the same !
(Of course i delete smbpasswd first)

I've read that smbpasswd format is not secure , and developers prefers
pdb format too , it's more secure , that's why i'd like to change it ;-)


II) How can i modify user password with pdbedit ?

checked man pdbedit , doesn't help , what i can do so far is delete and
recreate , so bad.


Appreciate any of your help ;-)

Thanks in advance !

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvStiUACgkQvf41sEptMqBAkACfUXHsrJqiAfyvY7U7rlGgq3Qg
urMAnA24hNdh8wdv5kGtjhbH4YtL1mYC
=FvtX
-END PGP SIGNATURE-



Re: OpenBSD 4.7 pictures

2010-05-12 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 05/13/2010 01:52 PM, Jordan Earls wrote:
> Just thought I'd share some pictures.
> 
> OpenBSD 4.7 just arrived in the mail today(I'm in Oklahoma, USA).
> Checkout http://earlz.biz.tm/openbsd_pics/  for pictures of some of it
> 

So cool ;-)

SuperBSD (superman ?)


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvrmHkACgkQvf41sEptMqBqEACgq9/AMFZgHFzzaps//DefC4N6
zEMAoMnK3XAgNNdy6AdhBoTu08DIfTsD
=wKAV
-END PGP SIGNATURE-



Is there any crypt device that support both linux and OpenBSD ?

2010-06-16 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi All,
I'm looking for some crypt methods that will encrypt the whole disk ,
rather than saving it to a single file.

And i need it to be supported both Linux and OpenBSD , is it possible ?

Thanks in advance !

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwZjs0ACgkQvf41sEptMqBv1wCghMmHBLpDs0+KL8q9scR+/ui4
6XEAoKtQqZZ1MhzqxfzGGrGcZe8YVpFq
=AMXX
-END PGP SIGNATURE-



Re: Is there any crypt device that support both linux and OpenBSD?

2010-06-19 Thread Aaron Lewis
Hi,

> Aaron Lewis wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> > 
> > Hi All,
> > 
> > I'm looking for some crypt methods that will encrypt the whole disk ,
> > 
> > rather than saving it to a single file.
> > 
> > And i need it to be supported both Linux and OpenBSD , is it possible 
?
> > 
> > Thanks in advance !
> 
> in most cases something that encrypts a whole disk or partition is
> kernel / FS level, meaning the code would need to be very similar across
> OSes. there is nothing like this out there at the moment. as you may
> have noticed almost every OS has a separate disk encryption method e.g.
> netbsd has cgd, freebsd has geom, openbsd has softraid, windows has
> bitlocker, bestcrypt, securedoc, etc.

Understood , FS need kernel driver , which made it hard to port my encrypted 
disk to other OS.

So .. if i use a single file , i'm just worrying that if my file size keep 
growing , will there be a problem ?

E.g:

It's like the ISO image file , once created , if you want to add new files.
You can't just simply resize it , but only create a new one , 
right ?

I want to use the whole disk just in case of that problem.

Thanks.

> 
> the closest thing i've seen to what you describe is truecrypt but it
> does work with files and not whole partitions or disks afaicr. TC works
> on windows and linux.

Yeah , TC is cool on Linux , but i almost do the same thing with dm-crypt.


> 
> > - --
> > Best Regards,
> > Aaron Lewis - PGP: 0x4A6D32A0
> > FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
> > irc: A4r0n on freenode
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> > 
> > iEYEARECAAYFAkwZjs0ACgkQvf41sEptMqBv1wCghMmHBLpDs0+KL8q9scR+/ui4
> > 6XEAoKtQqZZ1MhzqxfzGGrGcZe8YVpFq
> > =AMXX
> > -END PGP SIGNATURE-

-- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode



matching escape string , doesn't work ?

2010-07-05 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
echo %A3 | sed 's/(%[0-9A-Z]{2})//g'

I'd like %A3 like string to be removed , what's wrong with my script ?

Thanks.


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwxtVUACgkQvf41sEptMqBg9ACgmtDhFkoY14LS+oyRhDmdAcaw
6yAAoJvE0PW+UyayxG6+ZQtPABULpKkn
=L8MU
-END PGP SIGNATURE-



[SOLVED] Re: matching escape string , doesn't work ?

2010-07-05 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/05/2010 06:42 PM, Bret S. Lambert wrote:
> sed 's/%[0-9A-Z][0-9A-Z]//g'

Thanks , and same for VIM.

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwxu2cACgkQvf41sEptMqBcKQCeORAzcjXuLpHtgZNvBXLzDVvA
nFkAn3Dw3r7YUocmDiax4Z5AIQm/hQQu
=4fFn
-END PGP SIGNATURE-



[SOLVED] Re: matching escape string , doesn't work ?

2010-07-05 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/05/2010 07:18 PM, Otto Moerbeek wrote:
> On Mon, Jul 05, 2010 at 06:35:01PM +0800, Aaron Lewis wrote:
> 
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> Hi,
>>  echo %A3 | sed 's/(%[0-9A-Z]{2})//g'
>>
>>  I'd like %A3 like string to be removed , what's wrong with my script ?
> 
> sed uses basic re's by default. Gnu sed implements { } by default as
> an extensiomn to Posix, we do not. use -E. 
> 
> 
>   -Otto

Understand , i'd notice it.


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwx5OcACgkQvf41sEptMqCsZACfdlULMONFiPuzAWcM9EiPYNtd
lXEAoLKCQ65ZjAaSXoqXjnAMiWPmOwyG
=4pJ4
-END PGP SIGNATURE-



[SOLVED] Re: matching escape string , doesn't work ?

2010-07-05 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/05/2010 07:18 PM, William Boshuck wrote:
> On Mon, Jul 05, 2010 at 12:42:51PM +0200, Bret S. Lambert wrote:
>> On Mon, Jul 05, 2010 at 06:35:01PM +0800, Aaron Lewis wrote:
>>> -BEGIN PGP SIGNED MESSAGE-
>>> Hash: SHA1
>>>
>>> Hi,
>>> echo %A3 | sed 's/(%[0-9A-Z]{2})//g'
>>>
>>> I'd like %A3 like string to be removed , what's wrong with my script ?
>>>
>>
>> According to the sed manpage, it doesn't use {} in this way; you seem
>> to be using the wrong syntax (although sed veterans can likely give a
>> more thorough answer).
>>
>> try  sed 's/%[0-9A-Z][0-9A-Z]//g'(minus any typos/thinkos on my part)
> 
> sed(1) uses basic regular expressions (see re_format(7) for
> details).  In particular, you should prepend with a backslash
> the parentheses and braces in the original example, although
> the parentheses are superfluous for the stated purpose.  If
> you want to use bounds, then
> 
> echo %A3 | sed 's/%[0-9A-Z]\{2\}//g' 
> 
> will do.

Yep , should escape it , that's the problem


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwx5K8ACgkQvf41sEptMqDTkgCgmg76T5ahKdsuA6WGCfulXoT1
s+sAoJ2ByK3CpUMkv8N1sHbrKIoddxpA
=bmJF
-END PGP SIGNATURE-



Re: Dynamic Tracing

2010-07-06 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/06/2010 05:52 PM, Edd Barrett wrote:
> On Sat, Jul 03, 2010 at 12:26:14AM -0700, Luis Useche wrote:
>> Hi Guys,
>>
>> I googled this a bit but I couldn't find anything. I just want to check if
>> there is a dynamic tracing tool for OpenBSD. Similar tools are kprobes for
>> Linux or DTrace for Solaris.
> 
> Could be an interesting project for someone.
> 
> Although not the same, we do have ktrace(1) which is similar to truss or
> strace.
> 

DTrace's kind of script language , i only know freebsd / Solaris has
such tools.


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwzC1oACgkQvf41sEptMqDmzgCgt6WVcQEnSINXA3G67wBX0j4Q
NIgAniUp7fOt71FLRL9V5xNiTNAS46Z+
=9N2F
-END PGP SIGNATURE-



302 redirection doesn't work ?

2010-07-10 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
I'm trying to configure apache like this: when pages were not found on
server , it returns a document moved message (301 or 302) , rather than
a 404 error.

So i put those:

ErrorDocument 404 /error.html
Rediret 302 /error.html http://my.host/

But still , it's a 404 error , additionally , a 302 Found error was
encountered while trying to handle the request.

Any ideas will appreciate , thanks !

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw4cHAACgkQvf41sEptMqC8ygCcDENoz7EgrQjUiZBOJF9/c9gZ
4XkAoJRAKFDf9J17nqECHc0CuaMnyxJH
=A5mN
-END PGP SIGNATURE-



Re: 302 redirection doesn't work ?

2010-07-10 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/10/2010 09:57 PM, Peter N. M. Hansteen wrote:
> Aaron Lewis  writes:
> 
>>  ErrorDocument 404 /error.html
>>  Rediret 302 /error.html http://my.host/
>   ^
> missing a 'c' here I think. If this is an actual cut'n'paste from your 
> config, 
> that's the likely source of your problem.
> 
> - P

Nope , it's typo , if i typed something can't understand by apache , it
won't start ;-)

%> nc localhost 80 -vvv
GET /cc

Not Found..
Additionally , a 302 Found error was encountered while trying to use a
ErrorDocument to handle the request.



- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw4f2IACgkQvf41sEptMqB4EwCfcc7gI6kxK/rI8brPAKGmKjri
ewoAoNkEtHvf5tWP5AIj8Td5s1AnIM4z
=rGBM
-END PGP SIGNATURE-



Re: 302 redirection doesn't work ?

2010-07-10 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> 
> from stock httpd.conf:
> 
> ...
> # Customizable error response (Apache style)
> #  these come in three flavors
> #
> #1) plain text
> #ErrorDocument 500 "The server made a boo boo.
> #  n.b.  the (") marks it as text, it does not get output
> #
> #2) local redirects
> #ErrorDocument 404 /missing.html
> #  to redirect to local URL /missing.html
> #ErrorDocument 404 /cgi-bin/missing_handler.pl
> #  N.B.: You can redirect to a script or a document using
> server-side-includes.
> #
> #3) external redirects
> #ErrorDocument 402 http://some.other_server.com/subscription_info.html
> #  N.B.: Many of the environment variables associated with the original
> #  request will *not* be available to such a script.
> ...
> 
> 3) above seems to apply to you. Did you try it?
> 
> /Alexander

Yep , i tried.

But the problem is , i want my server reply with a 301 or 302 error code
, and then redirect to index.htm , is it possible ?

If you just put a ErrorDocument with code 404 , client will still
receive a 404 not found error.

So i tried to combine Redirect & ErrorDocument directive , but it
doesn't seems to work


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw5G68ACgkQvf41sEptMqAkgwCgoO2/jMD+xNM9ZGCCVy0t1EUq
HccAnRoWDli83ozItuq0jvP4u/rWeZAw
=r6Wr
-END PGP SIGNATURE-



Re: 302 redirection doesn't work ?

2010-07-10 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> Hi, apologies in advance, I haven't really been following this thread,
> until I just thought of something now...
> 
> Are you using php?  If so, you can set up the 404 error document as a
> .php file, and use php set the headers to do whatever you want.  You
> could set a meta refresh tag, then display a message to the user saying
> whatever.  After the time you set in the refresh has elasped, it'll drop
> the user at your desired destination page.  Just a thought, sorry if
> it's not what you're looking for.
> 

Yep , header("Location: index.html") actually works.

I'm just wondering some website has such features:

%> nc xx.net 80 -vvv
GET /hello_from_aaron



302 Found

Found
The document has moved http://www.chinaunix.net/hot.shtml";>here.



Very interesting , don't know how it works.

PHP Code will return nothing , just redirection.


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw5NlQACgkQvf41sEptMqD7dgCeLDikYyyRqxfK23huEfz5uwTZ
TUMAoKMzEq4R//NEi3+ROEgbZek7+DjP
=9ipY
-END PGP SIGNATURE-



[SOLVED] Re: 302 redirection doesn't work ?

2010-07-11 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

That works fine , just print a header with custom http status code.

> http://httpd.apache.org/docs/1.3/misc/howto.html


Thanks , for all of your help !

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw5mxYACgkQvf41sEptMqDkBACfbwkfstxjqpqpnJfy3PwPh8JG
dzAAoJywFDbyMBXkaXIJEWMSAm7dgN+z
=/gzW
-END PGP SIGNATURE-



force image size converting possible with convert command ?

2010-07-17 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
I'm trying to convert a image , which will make a change on its size.

%> convert -resize 1024x768 my-1280x800.png my-1024x768.png

Like 1280x800 to 1024x768 , i will end up with a size at 1024x600 ,
just because 1280/800 != 1024/768 , but 1024/600.

So how can i get a image at the `right' size , i just don't know how to
describe this problem ..

Many thanks.

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxBq1wACgkQvf41sEptMqC6jACfTTQ9TyNN/2BZxZm3+3CrFYoo
XRcAoLLaZffm+8bdHPAMqO2wic3GFMXl
=kAVD
-END PGP SIGNATURE-



Re: force image size converting possible with convert command ?

2010-07-17 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/17/2010 09:18 PM, Kenneth Gober wrote:
> describe the problem correctly, and you're halfway to a solution.  1024/600
> *is* the 'right' size.  what you want to do is convert the image to the
> 'wrong' size, by stretching it, or cropping it, or padding it with bars at
> the top and bottom, or something else.  but before you can do this, you will
> have to decide how, exactly, you want to do it 'wrong'.  once you've figured
> out how you want to distort the image, you can then do that as the first
> step, then convert as the last step.

Just like what we do in GIMP , Scale Image with the `Yellow lock'
besides the size unlocked.

Tried -crop size , -linear-stretch not working at all.

> 
> -ken
> 
> On Sat, Jul 17, 2010 at 9:08 AM, Aaron Lewis wrote:
> 
>>
>>

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEUEARECAAYFAkxBuX0ACgkQvf41sEptMqDL4ACUC0HRw1nLRG6R+aULctzM+EJ3
VQCgoPd7qzH4cWSn4D9TXiPvhLwC7vY=
=g9yb
-END PGP SIGNATURE-



[SOLVED] Re: force image size converting possible with convert command ?

2010-07-17 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/17/2010 09:18 PM, Chris Bennett wrote:
> On 07/17/10 08:08, Aaron Lewis wrote:
>>

> see :
> file:///usr/local/share/doc/ImageMagick/www/convert.html


> -resize width
> -resize widthxheight{%} {...@} {!} {<} {>} {^}

Oh , really nice , just need a exclamation mark.

>resize an image.

>By default, the width and height are maximum values. That is, the
> image is expanded or contracted to fit the width
>and height value while maintaining the aspect ratio of the image.
> Append an exclamation point to the geometry to
>force the image size to exactly the size you specify. For example, if
> you specify 640x480! the image width is set to
>640 pixels and height to 480.

Thanks Chris , and all of you.


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxBuikACgkQvf41sEptMqC2IgCgoHUt6AZjJ3XSq+vJtDMhHsBk
Nl4AoI8g7n4vdZS6oPS/D9Ul1sQxWlDU
=rAj1
-END PGP SIGNATURE-



code for fun

2010-07-18 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
how can i determine the maximum size of `double' without printing out
DOUBLE_MAX ?

And what about the precision of a `double' , anyone give a try ?

Google ain't giving much information , i just can't figure out , it's
very funny coding , isn't it ?

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxC1ykACgkQvf41sEptMqCjTwCgisIxQB0fIOCQSrlfhIn7GShT
JogAnAsqx2g5M+PyE0DZLNeSHF1luiYc
=0LIw
-END PGP SIGNATURE-



OT: Re: code for fun

2010-07-18 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/18/2010 06:56 PM, Firas Kraiem wrote:
> On 18/07/2010 12:27, Aaron Lewis wrote:
>> Hi,
>>  how can i determine the maximum size of `double' without printing out
>> DOUBLE_MAX ?
>>
>>  And what about the precision of a `double' , anyone give a try ?
>>
>>  Google ain't giving much information , i just can't figure out , it's
>> very funny coding , isn't it ?
>>
> 
> Kinda off-topic for here but whatever...

Yeah , i'll put a OT here.

> 
> Assuming 64-bit double, it has a mantissa of 52 bits and an exponent of
> 11 bits. If the mantissa is all-ones, that will give a significant of
> 2-2^(-52).  The exponent cannot be all-ones (an all-ones exponent means
> infinity or NaN), so the largest exponent is 2^11-2 = 2046, minus bias
> (1023), it gives a maximum effective exponent of 1023, so that would
> give a value of (2-2^(-52))*2^(1023) = 2^1024 - 2^971, roughly 10^308.

Yep , right , but how you *get* it by a beautiful code  , that could be
really interesting.

I mean , with a small code , c or c++ , printing the size out.

> 
> What do you mean by "precision"?

Kinda of significance digit. For example:
 A number `12.340' , and if say it has 2 digits' precision , then we
consider the `0' is not accurate , while `.34' is accurate.

So for a number stored in a double type , how accurate can it be ? (or
maybe how many bits in the fixed-point part is accurate)

Doesn't matter if it's unsigned or signed , some ideas are cool enough.

Still , use a small part of code , c or c++ , i'm just curious how to
make it happen.

> 
> Firas


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxC4IkACgkQvf41sEptMqBN3wCeNNWj/cs9b1SB4hXwxqnJQrR4
gxsAoLKTzixeHSQzWHAeKTzgp6WDPn3I
=McSS
-END PGP SIGNATURE-



Re: OT: Re: code for fun

2010-07-18 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/18/2010 08:04 PM, Floor Terra wrote:
> On Sun, Jul 18, 2010 at 1:07 PM, Aaron Lewis  
> wrote:
>>> What do you mean by "precision"?
>>
>> Kinda of significance digit. For example:
>>  A number `12.340' , and if say it has 2 digits' precision , then we
>> consider the `0' is not accurate , while `.34' is accurate.
> 
> What?!

See:

http://en.wikipedia.org/wiki/Arithmetic_precision

> 
>>
>> So for a number stored in a double type , how accurate can it be ? (or
>> maybe how many bits in the fixed-point part is accurate)
> 
> http://en.wikipedia.org/wiki/Double_precision_floating-point_format
> 
>>
>> Doesn't matter if it's unsigned or signed , some ideas are cool enough.
> 
> I'd like to see your unsigned double!

Sorry , they're all signed.

> 
>>
>> Still , use a small part of code , c or c++ , i'm just curious how to
>> make it happen.
> 
> What problem (i.e. homework assignment) are you trying to solve?
> 
> 

Come on , just for fun , someone asks me if i could print out the
maximum number that can be stored in a double type , and the *precision*
of a double type.

For the first , maybe with some bit operations , no good idea from me.

And the second , well i tried to divide 2 by 3 , see when i reaches 7 (
should be 0.667 ) ,
may not a clever way.


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxC9EsACgkQvf41sEptMqD8CACfVFw2rSxQHBs1u8hLgltLIEr3
heUAniQgV+JEyy/WLr+IsV3mtIGUznM+
=xwd7
-END PGP SIGNATURE-



Re: OpenBSD users.

2010-07-20 Thread Aaron Lewis

Aaron Lewis , TsingDao , China.



Multi Route possible ?

2010-07-29 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
I'm just wondering if it's possible to take advantage of double routes.
 Combine two lower network , to gain a double-bandwidth network.

Do openbsd has such kernel drivers ?

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxRTC4ACgkQvf41sEptMqBelQCgy/09YdhXwKDBJrhQvHvs4d81
pY0AnA8eGt+EW5/oU7utApnQ7Wb+GuhH
=gZtg
-END PGP SIGNATURE-



Re: Multi Route possible ?

2010-08-03 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

>> Hi,
> Hi Aaron,
> 
>>  I'm just wondering if it's possible to take advantage of double routes.
>> Combine two lower network , to gain a double-bandwidth network.
>>
>>  Do openbsd has such kernel drivers ?
> You could have a look at the route option "-mpath" when creating default 
> routes, this can be used to load-balance your outgoing traffic.
> 
> See http://www.openbsd.org/faq/faq6.html#Multipath for more info.

Exactly what i'm looking for , thanks !

Well , just some ideas , is it possible to bind two different address to
a single NIC , and play with double routes ?

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxXzz0ACgkQvf41sEptMqCvYQCfY/9YXCJWoM0GCYZTgUy1i10P
J0oAn1i/KWN4+ijaOGAF5X/w5HozKRwZ
=i8Cd
-END PGP SIGNATURE-



Re: Multi Route possible ?

2010-08-03 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/03/2010 08:52 PM, Kevin Chadwick wrote:
>> Well , just some ideas , is it possible to bind two different address to
>> a single NIC , and play with double routes ?
> 
> You can bind two nics with the trunk(4) interface?
> 

All right , let me put it straight , a have a 3G card , a cable with 1M
bandwidth , i'd like to take use of them together , that's so-called
double routes (maybe load balance) , don't know if it is possible.

Thanks


- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxYENUACgkQvf41sEptMqCoEQCgibCh9RTvJOTEs38Q0sl5ypJC
QpcAnj00elLtKYnapPm6w+mdRyG9rYy7
=fJR5
-END PGP SIGNATURE-



becoming a openbsd developer , any guides ?

2010-08-03 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
I've been googled a lot , nothing interesting about this topic , can
anyone get me some ideas ?

Thanks !

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxY/7EACgkQvf41sEptMqANDgCeMzdMZVXBhL8GsJjsXGoWI9og
FnMAoMNsXC08x6qIg9C3c0OECryYGtAu
=g+Rh
-END PGP SIGNATURE-



Re: Multi Route possible ?

2010-08-04 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/04/2010 06:36 PM, Kevin Chadwick wrote:
> 
> Correct me if I'm wrong again but another option for redundancy would be
> to use two boxes for the connections with a trunk in failover mode.
> (I'm guessing you don't want to increase bandwidth, if you've chosen
> 3g?, or is this just a laptop or something?)
> 

- --
- -  --- 3G (ppp0)
- - OpenBSD Laptop -
- -  --- Cable (em0) (sometimes wlan0 with wireless)
- --

Possible to gain double bandwidth ? I'm very curious.

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxZZSoACgkQvf41sEptMqByugCeJ0c+SVEqkvjLNDTlUrd/rerZ
PvwAoNGpH5cOkQZyeGV/m21XGMR9ziRR
=4e0X
-END PGP SIGNATURE-



[solve] Re: becoming a openbsd developer , any guides ?

2010-08-05 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
I'm using lower case of `solved' just because i'm with some basic ideas
for the moment.

Thanks for all or your suggestions.

@Dunceor: So , i will start from src/sys , it's interesting for me.

@Philip: I came from LINUX world , these VCS tools comes up a bit
different , but i'd get used to it.

@Richard: undeadly and bsdtalk is a good start then.

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEUEARECAAYFAkxbXjgACgkQvf41sEptMqB/JgCYmdrepggZGJr3ozmtdC9ln2At
RgCg1t9OcEm/sR2iUUGmhMQwbYmZNRE=
=+Ij6
-END PGP SIGNATURE-



How much disk space should be maintained for /usr/obj

2010-08-06 Thread Aaron Lewis

Hi,
How much space should i put for a separated partition , mounted on 
/usr/obj , is 4 GiB more or less ?


Thanks



[SOLVE] How much disk space should be maintained for /usr/obj

2010-08-06 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thanks for All of your help !

As i only need some basic desktop tolz , 4GiB must be enough for the moment.

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxcqgIACgkQvf41sEptMqAaEwCgkHf/J4Jres4gE2XXZpTW4UlF
VVIAn3/JGyP4l7ca8OWmp69e1hsLVwbG
=Dk4E
-END PGP SIGNATURE-



Thinkpad R400 works fine , dmesg attached

2010-08-06 Thread Aaron Lewis
 Hub-to-PCI" rev 0x93
pci6 at ppb5 bus 21
cbb0 at pci6 dev 0 function 0 "Ricoh 5C476 CardBus" rev 0xba: apic 1 int
16 (irq 11)
"Ricoh 5C832 Firewire" rev 0x04 at pci6 dev 0 function 1 not configured
sdhc0 at pci6 dev 0 function 2 "Ricoh 5C822 SD/MMC" rev 0x21: apic 1 int
18 (irq 11)
sdmmc0 at sdhc0
"Ricoh 5C843 MMC" rev 0x11 at pci6 dev 0 function 3 not configured
"Ricoh 5C592 Memory Stick" rev 0x11 at pci6 dev 0 function 4 not configured
"Ricoh 5C852 xD" rev 0x11 at pci6 dev 0 function 5 not configured
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 22 device 0 cacheline 0x0, lattimer 0xb0
pcmcia0 at cardslot0
pcib0 at pci0 dev 31 function 0 "Intel 82801IEM LPC" rev 0x03
ahci0 at pci0 dev 31 function 2 "Intel 82801I AHCI" rev 0x03: apic 1 int
16 (irq 11), AHCI 1.2
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0:  SCSI3 0/direct fixed
sd0: 238475MB, 512 bytes/sec, 488397168 sec total
cd0 at scsibus0 targ 1 lun 0:  ATAPI
5/cdrom removable
ichiic0 at pci0 dev 31 function 3 "Intel 82801I SMBus" rev 0x03: apic 1
int 23 (irq 11)
iic0 at ichiic0
usb2 at uhci0: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci1: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci2: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb5 at uhci3: USB revision 1.0
uhub5 at usb5 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb6 at uhci4: USB revision 1.0
uhub6 at usb6 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb7 at uhci5: USB revision 1.0
uhub7 at usb7 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: 
spkr0 at pcppi0
aps0 at isa0 port 0x1600/31
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
mtrr: Pentium Pro MTRR support
uvideo0 at uhub0 port 6 configuration 1 interface 0 "Chicony Electronics
Co., Ltd. Integrated Camera" rev 2.00/3.20 addr 2
uvideo0: video control not supported for this device.
video0 at uvideo0
ubt0 at uhub3 port 2 "Lenovo Computer Corp ThinkPad Bluetooth with
Enhanced Data Rate II" rev 2.00/3.99 addr 2
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
root on sd0a swap on sd0b dump on sd0b



- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxc2CkACgkQvf41sEptMqAOfACglgfrWV9TVzc1AUQjMjUPp3Jy
yGYAoMbvC8CW8GCCDjfitPAx/4EyP1/M
=8C8n
-END PGP SIGNATURE-



Anyone playing with Active Protection System (hdaps) here ?

2010-08-07 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
Mon Laptop has a device aps0 , and hdapsd works fine on Gentoo Box , i'm
wondering how should i activate it on OpenBSD ?

/etc/rc.conf doesn't have anything related ..

Many thanks.

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxdBwUACgkQvf41sEptMqBbbQCgioVJ9ft6tUT+ELCLNSMPuaMh
b0cAnA6xj5p0i9fR7eR0DphJ8Oc2B9Eh
=IWgd
-END PGP SIGNATURE-



Re: Anyone playing with Active Protection System (hdaps) here ?

2010-08-07 Thread aaron lewis
> from man aps:
>
> SEE ALSO
> isa(4), sensorsd(8), sysctl(8)
>
> That's your money reading, right there.
>
> $ sysctl | grep -c aps
> 9
>
>
Well , Thanks Bret , can you get me more instructions please ?

I think i should put a limit via sysctl  , right ?

-- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode



[SOLVE] Anyone playing with Active Protection System (hdaps) here ?

2010-08-07 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> Yes: get familiar with man(1) and experimentation.
> 
> And thus is my reputation for being an unhelpful prick upheld!

OK , no problem ;-)

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxdS9AACgkQvf41sEptMqAySQCgwNPCFYKNo2PEXYptm/CGfMNY
h9sAn0Ryf/+Ta65BpzD/wZ5/JQkUjhqo
=P6/H
-END PGP SIGNATURE-



Re: Anyone playing with Active Protection System (hdaps) here ?

2010-08-08 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/08/2010 02:22 PM, Dmitrij D. Czarkoff wrote:
> aaron lewis  wrote:
>> I think i should put a limit via sysctl  , right ?
> 
> Hmm... Limit what? You want to limit X_ACCEL and Y_ACCEL? I'm not quite sure
> about that being possible.
> 
> As far as I understand, this feature is a kind of anti-theft protection.

Nope , it's a internal hdd protection system , see here:
http://www.thinkwiki.org/wiki/Active_Protection_System

> 
> What do You want to get from this feature? If You want to know the movement of
> Your laptop You might be interested in writing some daemon (script?) that
> polls the state of X_ACCEL and Y_ACCEL and mails You some helpful data if
> values exceeded something. Still, useful report would need some instant mean
> of communication (e.g. WiMax or cellular connection) and some means of
> position tracking (GPS?). Do You have those undetachable?

At first , I thought BSD has a pre-installed daemon for this , just need
me to enable it , i was wrong.

So i turned to the source code of hdapsd , but it's for linux only ( i
thought it's a script at first glance , while it's not ) , i'm now
trying to port it to OpenBSD ;-)

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxea9EACgkQvf41sEptMqCXCwCfQN+oeXBlCDS8r0VjH1l9C46y
R0oAoNE7KvWh7c8Gj46TANUj2J7fj27u
=SU4Q
-END PGP SIGNATURE-



Re: Is there anything I can use in place of MATLAB on OpenBSD?

2010-09-03 Thread Aaron Lewis
 On 09/04/2010 01:20 PM, Siju George wrote:
> Hi,
>
> Is there anything I can use in place of MATLAB on OpenBSD?
>
> http://www.mathworks.com/products/matlab/
>
> even at least through Linux emulation?
> Looking for a free Alternative :-)
>
> thanks
>
> --Siju
>
how about octave ? ( haven't tried before , i'm using MATLAB on gentoo
only )

-- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode



Re: Wireless Network GUI

2010-10-06 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/07/2010 11:58 AM, Edho P Arief wrote:
> On Thu, Oct 7, 2010 at 9:04 AM, Hugo Osvaldo Barrera
>  wrote:
>> I want to make a small desktop application (probably GTK+, since I've
>> never done anything in GTK) that shows available wireless networks,
>> signal, and a few buttons to connect to each/configure each.
>>
>> I don't intend to make a huge daemon like the linux's NetworkManager,
>> but, instead, just a simple application you open, connect, and close.
>> Done. B No bloat, and definitely ***NO*** requirement for stuff like
>> HAL.
>>
>> I wanted to get a few pointers before I started:
>> 1) First of all, I want to be sure no one's already working on
>> something like this.
>
> wicd is as small as network gui I can find in linux. Also I believe
> pc-bsd made their own version of network gui. It probably depends on
> kde or qt though.
>
> http://wicd.sourceforge.net/
>
nope , wicd is actually based on gtk & python , also wicd-client for
kde available on kde-apps.org.
( written in qt4 )

Haven't tried though on *bsd's.

- -- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E

No HTML shits , thanks.
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMrW0YAAoJECSSp9Df5sKeDY0QALf2/K1A8/kRVP2+grQqPRHt
fE7vdfIbjp4NVakUQDG77+HP0Pk2U/BQFC0UNEumS2v1pG1Z+HgudCqXJ/uqoe2d
WFyNdeGlVpJ4ZEen4OpjXRd+ktXUaf6TSmy0b1ya9pvPJ0RrACSzrJl4jxtUfQQi
xk0FutLlGXkZv/aTH1zHTMw0vLPdz4eMQNcr2sOHYriNFUjYFgZeomag9dxebViQ
hZXTzBtRjYzQLlc8/8oU1o0hiImOToaCB4XSCdCjHGTD4dvlv3qhBA9tZ+Pa2lOw
9TS/2Wyqd4YmpQiOhnICin98HJ5M65W5jUZiFqB1IzUJFuekZixGczv4DXKa7sWx
IfQvhDRa9kClKtk3UXP9y2lbHDgxthBo/NTuLBkrNwraTDl/MyO7IqKqKdguTom7
iEkIflSdll6P7ixI40QRRjxOSFbmFYhgS/qcVrWBCKI5E6j0kueQMlU2d1aUGrAr
Kt68A5D+fGkx9Wmkq5rVhi1MdpvRjuZmPOaoKnhyI5+BdcvZ3J/Ha9OJEUwzSPAq
XAF0mmI/8V3/75l4nuQUNamDBOggCjujYB4ZKpPQQRPq2eO5+NVMf6aFnCQSVB1O
/MkzdaXgjOHjJ4M4ciBLwBNb9Wq+Jwr77AiNtDGHoDNuXHLtKTDUXjNDYZH4YJxV
mvVPIWuh0WV089ocZk1W
=KN8f
-END PGP SIGNATURE-



Finding active interface and its ip address within a perl script ?

2010-10-11 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
I'm trying to write a simple script which can grab the ip address of
current active interface.

e.g
iwn0 -> 10.7.22.23/24 , route 10.7.22.254
em0  -> 192.168.133.2/24  , route 192.168.133.1 ( active , 
default route )

Now how can i tell that em0 is active and fetch the local address ?
First thought was to parse output of `ifconfig` , seeking for entries
"status: active" ?
But is there any better ways to work it out ?

Many thanks !


- -- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E

No HTML shits , thanks.
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMs/lFAAoJECSSp9Df5sKe+dwP/Ru/WyCkjgCOKVbu2phzjk36
QltijnJD+Jwgy06/KqifCSiNJ3YOpGSKaDOLrEFLz+vICB5Ks4Xn1mmd6AR7O5dL
LISe4xwE5AfBaPEpdTdoy3/wkxy22P2/H7oLASexUaB969UL23UvO4sOMx2yS763
f+vmfni4InJEZ1Bj3VDd6IP0rhGZZhQ4mnsHViES/w6Mk1mqW+19vnU3mNMdDrTy
XYoxTBSALJPIHj/ji0TIPPKiGMu03Ip3Q9M57rs70ZHvo5smrBYjGe8FExkMkENl
mVYlJqsFfNwU53L4FvjMoK7KJo5j5AEP1lrLqjoJOksWmoZI8WLdiHTXlw5VvBj7
V0Tm2OtspUTkPYTIgYI8RpyD0/GKt47SH4Ve3FbIZncbFBiz/hiQg/XwImdgkk2U
A+hZu8G5YASS+XC+g4Hx4l4mb5NPfDZrM48cuh99Dp9Rsd7jZ6br4Ecd5UBGYPZN
hByxQhos0Q1JdYZcz54vXkcPlw5ZPHyehvKqn04ca9RN0v2ue+Na4yBjecJwm6e/
Rn6+JyJ94FFLqbaT6whsZKvJcM2G/fy7sdmZm+LckF3LnrlauStgcv+mKETo+aZv
MU3Idrb8ZCpYSIvxNJxlAEXHCBvY2rM/jvnBthKiH2w2dNHApKG8lzFUTGdPCuwY
BuaQB5kgdWDB2iS7D3Kl
=/TPV
-END PGP SIGNATURE-



[SOLVED] Re: Finding active interface and its ip address within a perl script ?

2010-10-12 Thread Aaron Lewis
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/12/2010 02:23 PM, joshua stein wrote:
>>  But is there any better ways to work it out ?
> 
> you could get the ip of the interface that the default route is
> going through:
> 
> route -n get default | grep 'if address' | sed 's/.*: //'
> 
> or ask ifconfig what is in the egress group and assume the first ip
> on the first interface will be ok:
> 
> ifconfig egress | grep 'inet ' | head -n1 | awk '{ print $2 }'
> 

Great , thanks !

- -- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E

No HTML shits , thanks.
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMtAb2AAoJECSSp9Df5sKe040P/A7ILmwdfd5MWBf08NYLcelj
SLQsU4NrhdIUNI41MFQgd4MTQ4JFUbZCdndom0TEOB467dQeYRdfslT1JSV9B13l
1zyNYODnqNp95a9uRCKVagR++oK7Ni6GaPXLhAnOh3WA+ZLi+ncNtDF3tl16GwpH
tnC5Og8MBtMeG9zGM54SHpCRUNHW9O6iPBOhV1O9l8VcBkiiIn7c0TenFLdVxgxT
wtKRslbtvxg7iliNJ9hqstdgyvfyuDw09Kh+TQnye3iN4PzzA2KrPKoknjkbfOv8
9OuQ/HCXFBUUpoq9SPmz1XxJJwzghZQNxP6Gvufk8GTePXf47XkZxOuLSrA7xXaU
bTYCTqT8xwLIOpeixpiPYuB9XMUPIFOJwDHA2OfFex7BDrc+HDreGLwq7YkkpWo0
TpSCrDBCXCbgpN9PHBI4bY6N4Ld0g9We5HWiUDmhjPp2dXVw+u2958caWJrJfs9y
KQzeKXCIpfhDVUdqeldHHLxVPSEDhxiPnFP8xhNDDzxIL+yZoaQwSH/MT5+4/3FJ
eeXnieRpy3i1Q1CmpLKIuGDW8j3EBYPNnZIdIzobfLwdrRfz+C6uiqCBD9UkJTBJ
59aS02I5pIAR+Ja7USFU5iL7fR0QrrUYVgVB3XqNKrjIZdnleZ2FyAUUA6SyvLsW
5Gtluza4OXRRgYK9dr7I
=YkqU
-END PGP SIGNATURE-



Tips of bash on command substitution ?

2010-10-26 Thread Aaron Lewis
Hi,
Suppose last command was "cd cd" , and i've remembered that it could be
replaced to "ls ls" simply with "^cd^ls^" , but only first entry was
replaced , thus i finally got "ls cd"

But i want "ls ls" , anyway to work it out ?

-- 
Aaron



need help on setting up 3G connections , migrating from wvdial.conf to ppp's conf

2010-10-31 Thread Aaron Lewis
Hi,
I've just grabbed a usb modem , and it works on some linux machines
with wvdial's configuration.

Now i'm migrating it to my openbsd box , so i tried to do a conenction
test with cu.

# cu -l /dev/cuaU0
ATZ
OK
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
AT+CGDCONT=1,"IP","cmnet"
ERROR ( couldn't remeber exactly what it says , error code seems to be 
3 )

It's better if i could set up pppd directly , just get stuck here.

Many thanks !

P.S. attached initial modem commends with wvdial's conf.


wvdial.conf


[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","cmnet"
Password = B
Phone = *99#
Modem Type = USB Modem
Stupid Mode = 1
Baud = 460800
New PPPD = yes
Modem = /dev/ttyACM0
ISDN = 0
Username = A
Carrier Check = no


-- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E



Re: Enough is enough!

2010-11-02 Thread Aaron Lewis
On 11/02/2010 04:44 PM, Martin Schrvder wrote:
> 2010/11/2  :
>> If this whole situation is not cleared in the next 24 hours, I'm
>> switching to ArchLinux (www.archlinux.org).
> 
> Pussy. Real Men use Gentoo.

Yeah , besides OpenBSD ,
gentoo is my personal favourite
 and i don't use any other linux distros.


Gentoo est la plus grande linux ;-)


-- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E



reveal top disk consumer process ?

2010-11-06 Thread Aaron Lewis
Hi,
How could i know which process is taking most time of I/O operations ?

Saw disk indicator blinks , anyway to find out who ?

-- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E



[SOLVED] Re: reveal top disk consumer process ?

2010-11-06 Thread Aaron Lewis
On 11/06/2010 09:05 PM, Dmitrij Czarkoff wrote:
> On Sat, Nov 6, 2010 at 11:41 AM, Aaron Lewis  
> wrote:
>> Hi,
>>How could i know which process is taking most time of I/O operations ?
>>
>>Saw disk indicator blinks , anyway to find out who ?
> 
> Try fstat(1).

Done. Thanks !


-- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E



What do fifth entry of `ls -ld /` implies ?

2010-11-08 Thread Aaron Lewis
Hi,
I'm wondering what is the fifth entry of "long format" with ls -ld ,
which i've never cared much about.

ls -ld /usr/bin
drwxr-xr-x 2 root wheel 6656 Nov 3 02:21 /usr/bin

What does 6656 implies here ?

Many thanks !

-- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E



existing mht file format converter ?

2010-11-18 Thread Aaron Lewis
Hi,
I'm looking for some mht converter that can put a ".mht" file into pure
html files , and also has abilities to handle unicodes ..

So anyone know some cool stuffs that could help ?

I know opera could read those shits , besides i found this project:

http://www.loganowen.com/mht-rip/

It just received segment fault and dead .. would take some time to
debug if no better solution came up ;-)

Thanks in advance !

-- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E ( http://keyserver.veridis.com )
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E



Re: existing mht file format converter ?

2010-11-19 Thread Aaron Lewis
On 11/18/2010 06:04 PM, Markus Bergkvist wrote:
> Perhaps MHTML->MAFF->unzip?
> http://maf.mozdev.org/

Ah , thanks for reply , i'm trying that plugin , so far all went well ;-)

> 
> On 11/18/10 10:30, Aaron Lewis wrote:
>> Hi,
>> I'm looking for some mht converter that can put a ".mht" file into
>> pure
>> html files , and also has abilities to handle unicodes ..
>>
>> So anyone know some cool stuffs that could help ?
>>
>> I know opera could read those shits , besides i found this project:
>>
>> http://www.loganowen.com/mht-rip/
>>
>> It just received segment fault and dead .. would take some time to
>> debug if no better solution came up ;-)
>>
>> Thanks in advance !
>>


-- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E ( http://keyserver.veridis.com )
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E



[SOLVED] Re: What do fifth entry of `ls -ld /` implies ?

2010-11-20 Thread Aaron Lewis
On 11/08/2010 10:38 PM, Andreas Kahari wrote:
> On Mon, Nov 08, 2010 at 09:59:25PM +0800, Aaron Lewis wrote:
>> Hi,
>>  I'm wondering what is the fifth entry of "long format" with ls -ld ,
>> which i've never cared much about.
>>
>>  ls -ld /usr/bin
>>  drwxr-xr-x 2 root wheel 6656 Nov 3 02:21 /usr/bin
>>
>>  What does 6656 implies here ?
> 
> That's the size needed to store the directory node.
> 

Thanks Andreas ! And sorry for the delayed reply ,

Before i just didn't quiet understand the meaning of
"the total number of blocks used by the files in the directory" in ls(1) ..

Now i just came to know about inodes stuffs ...

-- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E ( http://keyserver.veridis.com )
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E



how to know if a headphone jack is plugged in

2010-12-14 Thread Aaron Lewis
how to know if a headphone jack is plugged in , anyone knows ?

-- Aaron



Re: how to know if a headphone jack is plugged in

2010-12-15 Thread Aaron Lewis
Thanks , guys , for all of your help , Err , just don't know where to
start from;

azalia(4) did the job

-- Aaron



Re: merry xmas

2010-12-25 Thread Aaron Lewis
On 12/25/2010 03:34 PM, Traian Ciobanu wrote:
> Merry Xmas to all OpenBSD developers, supporters and fans. May this holiday
> bring you a lot of health, joy and may all your dreams come true.
> 
> Merry Christmas friends, and a Happy New Year!
> 

Merry Xmas ;-)

-- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E ( http://keyserver.veridis.com )
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E