Roger's woze

October 31, 2008

traceroute multicast idea

Filed under: Uncategorized — rogerdpack @ 2:04 pm

An idea for router powered multi-cast–the end goal being that routers with and without multi-cast and both exist and multi-cast still work :)

Basically use the BGP tables to compute a path to an end, and, when you do, retain in memory which was your next hop within that path of routers that are multi-cast aware.

Maybe have this information added to the TCP header: destination ‘group’
each router would retain, per group, port information [this group, these next hops]. Could use a bloom filter for such, I suppose.

mbone is related
rsvp is related.
More background research is necessary.

October 30, 2008

how to have file descriptors not close after a forked child process exits

Filed under: Uncategorized — rogerdpack @ 11:47 pm

So…the child process of a fork inherits a copy of the file descriptor table of the parent and, at exit, closes all its open files

fortunately [AFAIK] this doesn’t mean that the parent’s descriptors also close at that point. The parent’s stay open and it can keep happily writing to them.

ruby internals notes

Filed under: Uncategorized — rogerdpack @ 4:28 am

GetOpenFile is defined in include/ruby/io.h — it just checks to make sure the file is open.

October 28, 2008

ruby 1.9 socket woes

Filed under: Uncategorized — rogerdpack @ 8:11 pm

overall sockets on 1.9 are much better than 1.8–however this code

ruby19 -e ‘c = 1; require “socket”; a = TCPServer.new(“0.0.0.0″, 3333); loop { b = TCPSocket.new(“127.0.0.1″, 3333); a.accept.close; b.close; print c += 1, “\n” }’

has some odd pauses every so often on OS X — bug, or to be expected after you’ve opened and closed 16K ports?

not a real bug, I don’t think

ruby passing strings as a return value deemed harmful?

Filed under: Uncategorized — rogerdpack @ 7:44 am

time ./ruby -e ‘a = []; 10_000_000.times { a << 3}; 100_0000.times { “b”}’

real 0m2.191s

time ./ruby -e ‘b = 0; a = []; 10_000_000.times { a << 3}; 100_0000.times { “b”; b += 1}’

real 0m1.491s
user 0m1.448s
sys 0m0.044s

So it did more calculations and took less time. Looks like returning a string value from a block takes longer? huh?

October 27, 2008

don’t buy.com

Filed under: Uncategorized — rogerdpack @ 4:03 pm

So…buy.com should be legit, right?
Well…at the end of your purchase you’re offered the opportunity for a $10 discount on your next order. Just submit your email here.
legit, right?
Wrong.
Turns out that the $10 off discount is a “3rd party” scammer[1] who subsequently takes your credit card number from buy.com itself and then charges it a small monthly fee [in an attempt to hide themselves] until you notice and call them.

[1] Reservation Rewards

danger: google chrome browser has capability to “auto-download” and auto-run spyware

Filed under: Uncategorized — rogerdpack @ 3:23 pm

Here’s what happened
Windows XP
install safari, chrome
use chrome to go to

http://izumi.plan99.net/blog

ignore any “malware” warnings that pop up.
Chrome will “auto download” and auto run” an annoying program–antivirus 2009.
It starts a little red X at the bottom in the system tray saying “windows has detected spyware infection” and restarts your system after a few seconds.

http://www.experts-exchange.com/Virus_and_Spyware/HijackThis/Q_23809985.html

seems to have a few clues.

Fix: download, run from malwarebytes.org
–might need to copy it to a flash drive first.
–might need to run in safe mode.
–may need to click ‘perform full scan’ within malwarebytes

It did say afterward a popup “warning some system files have been replaced with unknown ones” but I ignored it, restarted and it kinder worked.

I believe the problem is probably the same one apparently “patched but not rolled out” mentioned http://www.computerworld.com/action/article.do?command=viewArticleBasic&taxonomyName=software_development&articleId=9117652&taxonomyId=63&intsrc=kc_top

October 26, 2008

ruby easy convert gif2jpg

Filed under: Uncategorized — rogerdpack @ 2:19 am

Here it is :)
require ‘rubygems’
require ‘RMagick’

include Magick
for arg in ARGV do
im = ImageList.new(arg)

im.write(arg.split(‘.’)[0..-2].join(‘.’) + ‘.png’)
end

from http://www.mustap.com/rubyzone_post_185_manipulating-images-with-rma

http://www.mustap.com/rubyzone_post_185_manipulating-images-with-rma

October 25, 2008

gcc install woe

Filed under: Uncategorized — rogerdpack @ 6:04 pm

configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.
Try the –with-gmp and/or –with-mpfr options to specify their locations.

meant “just as they said, you have to download and install these two packages then retry your configure for gcc”

October 24, 2008

ruby woe

Filed under: Uncategorized — rogerdpack @ 8:33 pm

irb(main):006:0> Date.new.parse
NoMethodError: undefined method `parse’ for #
from /Users/rogerpack/dev/ruby-roger-useful-functions/irb_lookup.rb:40:in `method_missing’
from (irb):6

meant ‘require ‘date’ first!’

Older Posts »

Powered by WordPress