[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] macaddr-1.0.0

ara.t.howard

8/5/2008 2:54:00 AM


NAME

macaddr

DESCRIPTION

cross platform mac address determination for ruby

URI

http://codeforpeople.co...
http://rubyforg.org/projects/cod...

INSTALL

gem install macaddr

HISTORY

1.0.0:

- rdoc added

- eric hodel kicks ass. to find why, see

http://drawohara.com/post/44678286/eric-hodel...

SYNOPSIS

require 'macaddr'

Mac.addr #=> first mac addr on your system
Mac.addr.list #=> all mac addrs on your system



enjoy.


a @ http://codeforp...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama




27 Answers

Daniel Berger

8/5/2008 3:54:00 AM

0

ara howard wrote:
>
> NAME
>
> macaddr
>
> DESCRIPTION
>
> cross platform mac address determination for ruby
>
> URI
>
> http://codeforpeople.co...
> http://rubyforg.org/projects/cod...
>
> INSTALL
>
> gem install macaddr
>
> HISTORY
>
> 1.0.0:
>
> - rdoc added
>
> - eric hodel kicks ass. to find why, see
>
> http://drawohara.com/post/44678286/eric-hodel...
>
> SYNOPSIS
>
> require 'macaddr'
>
> Mac.addr #=> first mac addr on your system
> Mac.addr.list #=> all mac addrs on your system

This Python library may be of interest:

http://mail.python.org/pipermail/python-win32/2005-September/0...

Covers pretty much every which way to get the info without shelling out.

Regards,

Dan

ara.t.howard

8/5/2008 4:18:00 AM

0


On Aug 4, 2008, at 9:53 PM, Daniel Berger wrote:

> This Python library may be of interest:
>
> http://mail.python.org/pipermail/python-win32/2005-September/0...
>
> Covers pretty much every which way to get the info without shelling
> out.
>
> Regards,
>
> Dan


hmmm - i don't read too much python but this looks like shelling out:


def getmacs_ifconfig():
"""parses the output of unix ifconfig to find mac addresses"""
lines = os.popen("ifconfig", "r").readlines()
headerlines = [line for line in lines if line and not
line[:1].isspace()]
for line in headerlines:
parts = line.split()
ifname = parts[0]
if 'HWaddr' in parts:
hwpart = parts.index('HWaddr')
if hwpart+1 < len(parts):
mac = parts[hwpart+1]
yield mac

def getmacs_ipconfig():
"""parses the output of windows ipconfig to find MAC addresses"""
lines = os.popen("ipconfig /all", "r").readlines()
for line in lines:
if line and not line[:1].isspace():
header = line
ipaddress, mac = None, None
elif line.strip():
if line.strip().startswith("IP Address") and ":" in line:
ipaddress = line.split(":", 1)[1].strip()
if mac:
yield mac
ipaddress, mac = None, None
if line.strip().startswith("Physical Address") and ":" in
line:
mac = line.split(":", 1)[1].strip()
if ipaddress:
yield mac
ipaddress, mac = None, None



you are right that's it's more complete though! if anyone wants to
add a test for their platform porting using this lib as 'doc' i'm
happy to add it

cheers.


a @ http://codeforp...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama




hemant

8/5/2008 7:44:00 AM

0

On Tue, Aug 5, 2008 at 9:23 AM, Daniel Berger <djberg96@gmail.com> wrote:
> ara howard wrote:
>>
>> NAME
>>
>> macaddr
>>
>> DESCRIPTION
>>
>> cross platform mac address determination for ruby
>>
>> URI
>>
>> http://codeforpeople.co...
>> http://rubyforg.org/projects/cod...
>>
>> INSTALL
>>
>> gem install macaddr
>>
>> HISTORY
>>
>> 1.0.0:
>>
>> - rdoc added
>>
>> - eric hodel kicks ass. to find why, see
>>
>> http://drawohara.com/post/44678286/eric-hodel...
>>
>> SYNOPSIS
>>
>> require 'macaddr'
>>
>> Mac.addr #=> first mac addr on your system
>> Mac.addr.list #=> all mac addrs on your system
>
> This Python library may be of interest:
>
> http://mail.python.org/pipermail/python-win32/2005-September/0...
>
> Covers pretty much every which way to get the info without shelling out.
>

But, if you use Python, you are selling out!

Daniel Berger

8/5/2008 1:30:00 PM

0

ara.t.howard wrote:
>
> On Aug 4, 2008, at 9:53 PM, Daniel Berger wrote:
>
>> This Python library may be of interest:
>>
>> http://mail.python.org/pipermail/python-win32/2005-September/0...
>>
>> Covers pretty much every which way to get the info without shelling out.
>>
>> Regards,
>>
>> Dan
>
>
> hmmm - i don't read too much python but this looks like shelling out:
>
>
> def getmacs_ifconfig():
> """parses the output of unix ifconfig to find mac addresses"""
> lines = os.popen("ifconfig", "r").readlines()
> headerlines = [line for line in lines if line and not
> line[:1].isspace()]
> for line in headerlines:
> parts = line.split()
> ifname = parts[0]
> if 'HWaddr' in parts:
> hwpart = parts.index('HWaddr')
> if hwpart+1 < len(parts):
> mac = parts[hwpart+1]
> yield mac
>
> def getmacs_ipconfig():
> """parses the output of windows ipconfig to find MAC addresses"""
> lines = os.popen("ipconfig /all", "r").readlines()
> for line in lines:
> if line and not line[:1].isspace():
> header = line
> ipaddress, mac = None, None
> elif line.strip():
> if line.strip().startswith("IP Address") and ":" in line:
> ipaddress = line.split(":", 1)[1].strip()
> if mac:
> yield mac
> ipaddress, mac = None, None
> if line.strip().startswith("Physical Address") and ":" in line:
> mac = line.split(":", 1)[1].strip()
> if ipaddress:
> yield mac
> ipaddress, mac = None, None
>
>
>
> you are right that's it's more complete though! if anyone wants to add
> a test for their platform porting using this lib as 'doc' i'm happy to
> add it

Yes, that's all I meant - that it had a bunch of alternative
implementations.

Regards,

Dan

Wexford

4/14/2011 9:43:00 PM

0

On Apr 14, 5:40 pm, "Eddie Haskell" <bcb...@sasasas.com> wrote:
> "CB" <C...@PrayForMe.com> wrote in message
>
> news:8hpeq697nocn19m628jcoqmc589gjeb35j@4ax.com...
>
>
>
>
>
> > On Thu, 14 Apr 2011 15:07:18 -0500, "Eddie Haskell"
> > <bcb...@sasasas.com> wrote:
>
> >>Throughout our history most Americans believed in the principals of the
> >>founding and revered the constitution, but not anymore. Starting sometime
> >>in
> >>the 60' socialists slowly began taking over the democrat party and have
> >>now
> >>completed their mission. Democrats don't believe in anything that founded
> >>this nation, and in fact believe the opposite. The only way to pull
> >>ourselves out of this economic mess is to create a business friendly
> >>nation
> >>that would encourage business to locate here and existing ones to
> >>flourish.
> >>That would involve cutting our corporate tax rate which is one of the
> >>highest in the world, and intimate tort reform, but we cant do ether
> >>because
> >>socialist democrats believe in wealth redistribution that punishes
> >>achievement and rewards sloth. And can't initiate any kind of tort reform
> >>because trial lawyers are the democrats biggest contributors. The two
> >>ideas
> >>on what kind of nation we will be competes in every election now. Whether
> >>we
> >>will be socialist or capitalist. That's why conservatives can't save
> >>America
> >>even if they took control and initiated everything they wanted to create a
> >>business friendly climate that would produce jobs and thus, revenues.
> >>Businesses need more than a 4 years assurance that the country will remain
> >>that way and no one is going to bet the farm on a 4 year promise.
> >>Democrats
> >>could get back in office at any time and began looting again, destroying
> >>the
> >>golden goose. So we are destine to remain a borrow and spend nation until
> >>our demise now. Corporations are evil and we need an all powerful
> >>government
> >>to protect us from the bogeyman. That's what democrats have convinced too
> >>many Americans of. The financial crisis was the Katrina democrats and the
> >>MSM convinced Americans republicans were responsible for, and now the
> >>subsequent looters are in charge.
>
> >>-Eddie Haskell
>
> > Great minds think alike!
>
> > I was thinking if Congress were to reduce Corporate taxes to zero %
> > companies would be free to expand, invest, purchase and hire. What
> > you'd see is the rich forego big salaries, stashing their money in
> > plant assets. Tax personal income the same as it 'is'.
>
> > The result will be an expansion in Commerce and companies like Sysco
> > Microsoft, Google and pharmaceutical companies once incorporated in
> > America, come back
>
> Yeah, but like I said, there is no assurance that it would last more than 4
> years and companies need to know that it would last longer than that to make
> such a move. If socialist democrats got back in they'd reinitiate their
> looting and plundering wealth redistribution schemes and they know it.

"Looting and plundering???" Democrats are now bankers, insurers and
hedge fund managers?

bcbcbc

4/14/2011 9:47:00 PM

0


"Wexford" <wryan77@gmail.com> wrote in message
news:6cd10e01-ba14-4199-8a99-47cbc7330612@hg8g2000vbb.googlegroups.com...
On Apr 14, 5:40 pm, "Eddie Haskell" <bcb...@sasasas.com> wrote:
> "CB" <C...@PrayForMe.com> wrote in message
>
> news:8hpeq697nocn19m628jcoqmc589gjeb35j@4ax.com...
>
>
>
>
>
> > On Thu, 14 Apr 2011 15:07:18 -0500, "Eddie Haskell"
> > <bcb...@sasasas.com> wrote:
>
> >>Throughout our history most Americans believed in the principals of the
> >>founding and revered the constitution, but not anymore. Starting
> >>sometime
> >>in
> >>the 60' socialists slowly began taking over the democrat party and have
> >>now
> >>completed their mission. Democrats don't believe in anything that
> >>founded
> >>this nation, and in fact believe the opposite. The only way to pull
> >>ourselves out of this economic mess is to create a business friendly
> >>nation
> >>that would encourage business to locate here and existing ones to
> >>flourish.
> >>That would involve cutting our corporate tax rate which is one of the
> >>highest in the world, and intimate tort reform, but we cant do ether
> >>because
> >>socialist democrats believe in wealth redistribution that punishes
> >>achievement and rewards sloth. And can't initiate any kind of tort
> >>reform
> >>because trial lawyers are the democrats biggest contributors. The two
> >>ideas
> >>on what kind of nation we will be competes in every election now.
> >>Whether
> >>we
> >>will be socialist or capitalist. That's why conservatives can't save
> >>America
> >>even if they took control and initiated everything they wanted to create
> >>a
> >>business friendly climate that would produce jobs and thus, revenues.
> >>Businesses need more than a 4 years assurance that the country will
> >>remain
> >>that way and no one is going to bet the farm on a 4 year promise.
> >>Democrats
> >>could get back in office at any time and began looting again, destroying
> >>the
> >>golden goose. So we are destine to remain a borrow and spend nation
> >>until
> >>our demise now. Corporations are evil and we need an all powerful
> >>government
> >>to protect us from the bogeyman. That's what democrats have convinced
> >>too
> >>many Americans of. The financial crisis was the Katrina democrats and
> >>the
> >>MSM convinced Americans republicans were responsible for, and now the
> >>subsequent looters are in charge.
>
> >>-Eddie Haskell
>
> > Great minds think alike!
>
> > I was thinking if Congress were to reduce Corporate taxes to zero %
> > companies would be free to expand, invest, purchase and hire. What
> > you'd see is the rich forego big salaries, stashing their money in
> > plant assets. Tax personal income the same as it 'is'.
>
> > The result will be an expansion in Commerce and companies like Sysco
> > Microsoft, Google and pharmaceutical companies once incorporated in
> > America, come back
>
> Yeah, but like I said, there is no assurance that it would last more than
> 4
> years and companies need to know that it would last longer than that to
> make
> such a move. If socialist democrats got back in they'd reinitiate their
> looting and plundering wealth redistribution schemes and they know it.

> "Looting and plundering???" Democrats are now bankers, insurers and
> hedge fund managers?

Would you like to get more specific, or would you rather hide behind vague
generalities?

-Eddie Haskell


Bert Hyman

4/14/2011 9:48:00 PM

0

In news:6cd10e01-ba14-4199-8a99-47cbc7330612@hg8g2000vbb.googlegroups.com
Wexford <wryan77@gmail.com> wrote:

> Democrats are now bankers, insurers and hedge fund managers?


Well yeah, they are.

--
Bert Hyman St. Paul, MN bert@iphouse.com

CB@PrayForMe.com

4/14/2011 10:45:00 PM

0

On Thu, 14 Apr 2011 14:43:04 -0700 (PDT), Wexford <wryan77@gmail.com>
wrote:

>On Apr 14, 5:40?pm, "Eddie Haskell" <bcb...@sasasas.com> wrote:
>> "CB" <C...@PrayForMe.com> wrote in message
>>
>> news:8hpeq697nocn19m628jcoqmc589gjeb35j@4ax.com...
>>
>>
>>
>>
>>
>> > On Thu, 14 Apr 2011 15:07:18 -0500, "Eddie Haskell"
>> > <bcb...@sasasas.com> wrote:
>>
>> >>Throughout our history most Americans believed in the principals of the
>> >>founding and revered the constitution, but not anymore. Starting sometime
>> >>in
>> >>the 60' socialists slowly began taking over the democrat party and have
>> >>now
>> >>completed their mission. Democrats don't believe in anything that founded
>> >>this nation, and in fact believe the opposite. The only way to pull
>> >>ourselves out of this economic mess is to create a business friendly
>> >>nation
>> >>that would encourage business to locate here and existing ones to
>> >>flourish.
>> >>That would involve cutting our corporate tax rate which is one of the
>> >>highest in the world, and intimate tort reform, but we cant do ether
>> >>because
>> >>socialist democrats believe in wealth redistribution that punishes
>> >>achievement and rewards sloth. And can't initiate any kind of tort reform
>> >>because trial lawyers are the democrats biggest contributors. The two
>> >>ideas
>> >>on what kind of nation we will be competes in every election now. Whether
>> >>we
>> >>will be socialist or capitalist. That's why conservatives can't save
>> >>America
>> >>even if they took control and initiated everything they wanted to create a
>> >>business friendly climate that would produce jobs and thus, revenues.
>> >>Businesses need more than a 4 years assurance that the country will remain
>> >>that way and no one is going to bet the farm on a 4 year promise.
>> >>Democrats
>> >>could get back in office at any time and began looting again, destroying
>> >>the
>> >>golden goose. So we are destine to remain a borrow and spend nation until
>> >>our demise now. Corporations are evil and we need an all powerful
>> >>government
>> >>to protect us from the bogeyman. That's what democrats have convinced too
>> >>many Americans of. The financial crisis was the Katrina democrats and the
>> >>MSM convinced Americans republicans were responsible for, and now the
>> >>subsequent looters are in charge.
>>
>> >>-Eddie Haskell
>>
>> > Great minds think alike!
>>
>> > I was thinking if Congress were to reduce Corporate taxes to zero %
>> > companies would be free to expand, invest, purchase and hire. What
>> > you'd see is the rich forego big salaries, stashing their money in
>> > plant assets. Tax personal income the same as it 'is'.
>>
>> > The result will be an expansion in Commerce and companies like Sysco
>> > Microsoft, Google and pharmaceutical companies once incorporated in
>> > America, come back
>>
>> Yeah, but like I said, there is no assurance that it would last more than 4
>> years and companies need to know that it would last longer than that to make
>> such a move. If socialist democrats got back in they'd reinitiate their
>> looting and plundering wealth redistribution schemes and they know it.
>
>"Looting and plundering???" Democrats are now bankers, insurers and
>hedge fund managers?

How do you think Charlie Rangel became a slum lord and own ocean front
property in the Carrabean from a sargent's pay (he admitted he was
poor before his 'career' as a politician)?

What ever happened to Charlie Rangel's problems?
http://www.washingtontimes.com/news/2009/sep/01/rangel-profits-by-any-way-...

Yoorghis

4/15/2011 12:26:00 AM

0

On 14 Apr 2011 21:48:16 GMT, Bert Hyman <bert@iphouse.com> wrote:

>In news:6cd10e01-ba14-4199-8a99-47cbc7330612@hg8g2000vbb.googlegroups.com
>Wexford <wryan77@gmail.com> wrote:
>
>> Democrats are now bankers, insurers and hedge fund managers?
>
>
>Well yeah, they are.

Difference between Democrat "bankers, insuers and managers" is the
goal of helping all people using government.

Winger assholes merely line their own pockets.






>=============================================================

On Fri, 18 Sep 2009 16:32:34 -0700 (PDT), Kurtis T. Nicklas of
1293 Westbrook Ave, Elon, NC 27244-9372"

<nickl...@bellsouth.net> wrote in message


>I don't pay much attention to him these days, but I'd wager he's not
>happy.

You sure as shit paid attention when you got caught
making all those late-night hang-up phone calls, didn't
ya, Nickkkkers?

CLICK ! ! !

Wexford

4/15/2011 2:59:00 AM

0

On Apr 14, 5:47 pm, "Eddie Haskell" <bcb...@sasasas.com> wrote:
> "Wexford" <wrya...@gmail.com> wrote in message
>
> news:6cd10e01-ba14-4199-8a99-47cbc7330612@hg8g2000vbb.googlegroups.com...
> On Apr 14, 5:40 pm, "Eddie Haskell" <bcb...@sasasas.com> wrote:
>
>
>
>
>
> > "CB" <C...@PrayForMe.com> wrote in message
>
> >news:8hpeq697nocn19m628jcoqmc589gjeb35j@4ax.com...
>
> > > On Thu, 14 Apr 2011 15:07:18 -0500, "Eddie Haskell"
> > > <bcb...@sasasas.com> wrote:
>
> > >>Throughout our history most Americans believed in the principals of the
> > >>founding and revered the constitution, but not anymore. Starting
> > >>sometime
> > >>in
> > >>the 60' socialists slowly began taking over the democrat party and have
> > >>now
> > >>completed their mission. Democrats don't believe in anything that
> > >>founded
> > >>this nation, and in fact believe the opposite. The only way to pull
> > >>ourselves out of this economic mess is to create a business friendly
> > >>nation
> > >>that would encourage business to locate here and existing ones to
> > >>flourish.
> > >>That would involve cutting our corporate tax rate which is one of the
> > >>highest in the world, and intimate tort reform, but we cant do ether
> > >>because
> > >>socialist democrats believe in wealth redistribution that punishes
> > >>achievement and rewards sloth. And can't initiate any kind of tort
> > >>reform
> > >>because trial lawyers are the democrats biggest contributors. The two
> > >>ideas
> > >>on what kind of nation we will be competes in every election now.
> > >>Whether
> > >>we
> > >>will be socialist or capitalist. That's why conservatives can't save
> > >>America
> > >>even if they took control and initiated everything they wanted to create
> > >>a
> > >>business friendly climate that would produce jobs and thus, revenues.
> > >>Businesses need more than a 4 years assurance that the country will
> > >>remain
> > >>that way and no one is going to bet the farm on a 4 year promise.
> > >>Democrats
> > >>could get back in office at any time and began looting again, destroying
> > >>the
> > >>golden goose. So we are destine to remain a borrow and spend nation
> > >>until
> > >>our demise now. Corporations are evil and we need an all powerful
> > >>government
> > >>to protect us from the bogeyman. That's what democrats have convinced
> > >>too
> > >>many Americans of. The financial crisis was the Katrina democrats and
> > >>the
> > >>MSM convinced Americans republicans were responsible for, and now the
> > >>subsequent looters are in charge.
>
> > >>-Eddie Haskell
>
> > > Great minds think alike!
>
> > > I was thinking if Congress were to reduce Corporate taxes to zero %
> > > companies would be free to expand, invest, purchase and hire. What
> > > you'd see is the rich forego big salaries, stashing their money in
> > > plant assets. Tax personal income the same as it 'is'.
>
> > > The result will be an expansion in Commerce and companies like Sysco
> > > Microsoft, Google and pharmaceutical companies once incorporated in
> > > America, come back
>
> > Yeah, but like I said, there is no assurance that it would last more than
> > 4
> > years and companies need to know that it would last longer than that to
> > make
> > such a move. If socialist democrats got back in they'd reinitiate their
> > looting and plundering wealth redistribution schemes and they know it.
> > "Looting and plundering???" Democrats are now bankers, insurers and
> > hedge fund managers?
>
> Would you like to get more specific, or would you rather hide behind vague
> generalities?

Good question, Eddie. When are you going to get specific. All I ever
hear from you are talking points and excuses.