Roger's woze

January 31, 2009

windows hosts file doesn’t work with too many settings

Filed under: Uncategorized — rogerdpack @ 12:27 am

this line in my windows hosts file:

127.0.0.1 localhost bridal ties home l h g ebay.com www.ebay.com bb ll hh
doesn’t work for thing after ebay.com
fix:
split onto multiple lines
weird windows bug. No idea where to report those :)

January 30, 2009

how to start xvfb on startup

Filed under: Uncategorized — rogerdpack @ 8:47 pm

Add a line to /etc/rc.local like
nohup /usr/bin/Xvfb :1 -screen 0 1152x900x8 &
[at least on redhat that's a good file to dump it into]

refs:

http://www.idevelopment.info/data/Unix/General_UNIX/GENERAL_XvfbforSolaris.shtml

January 28, 2009

ruby how to request

Filed under: Uncategorized — rogerdpack @ 11:49 pm

http://blog.shingara.fr/en/2008-09-03-profile-a-request-in-rails.html

shows how to use script\performance\request — it needs an input file.

Note that in 2.3 you’ll need to use a plugin, apparently. Still seems useful to me, though.

how to use strace with java

Filed under: Uncategorized — rogerdpack @ 12:25 am

Apparently strace doesn’t play well by default with java.
strace -p pid doesn’t work, for example.

This does, though [follows forks--why necessary, dunno].
Run it under strace:
$ strace -F -f java Readfiles # where Readfiles.class exists

$ strace -F -p <pid>

ref: http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=/com.ibm.java.doc.diagnostics.60/html/linux_tools.html

January 27, 2009

optimize GCC compiler settings

Filed under: Uncategorized — rogerdpack @ 11:53 pm

This program tries them all then tells you which one was fastest :)

http://www.coyotegulch.com/products/acovea/

now how to apply this to ruby…

ref: http://ruby-perspectives.blogspot.com/2008/07/oprofile-is-my-new-best-friend.html

read a file in java from a linux device

Filed under: Uncategorized — rogerdpack @ 9:51 pm

here’s an example:


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.StringTokenizer;

public class Readfiles {

  public static void main(String[] a) throws Exception {
    System.out.println("here");
    readTapeToFile(new File("out1"));
  }

  static void readTapeToFile(
      File dstFile) throws FileNotFoundException,
      IOException {
    long start = System.currentTimeMillis();
    File srcFile = new File("/dev/nst2");
    InputStream inTape = new FileInputStream(srcFile);
    OutputStream outFile = new FileOutputStream(dstFile);
    try {
      byte[] buf = new byte[1024 * 64];
      int size;
      while ((size = inTape.read(buf)) >= 0) {
        outFile.write(buf, 0, size);
      }
    }
    finally {
      outFile.close();
      inTape.close();
    }
  }
}

bitmountain thoughts

Filed under: Uncategorized — rogerdpack @ 6:51 pm

I don’t want to tear down bitmountain, just catalog a list of things that could improve with future versions of it, should it become open source.

Currently:
can’t delete a single file.
Doesn’t handle [?] oveflow conditions well?

does it handle directories well?

rails wish list

Filed under: Uncategorized — rogerdpack @ 6:23 pm

the ability to have foreign key “and other” restraints done solely at the DB level, instead of in rails.

ex:
validates_uniqueness_of
at load time, check if the DB already does this. If not spit out a warning and code for how to make this happen, then do it in Ruby.

Faster, safer [for validates uniqueness of].

January 26, 2009

how to get access to an acsss machine

Filed under: Uncategorized — rogerdpack @ 6:40 pm

Assuming that the devices are setup to access the tapes
you need to make yourself a member of group disk
you need to edit the access_control/internet.addresses to enable your user from your host still.

Also may need to compile the tape api lib on localhost.
Should be good to go.
Mount the tapes using the api, then write to them via the device.

You can tell which drive maps to which device by comparing the [device] scsi serial number with the serial number advertised by that drive [within acsss display drive

ruby mingw woe

Filed under: Uncategorized — rogerdpack @ 4:40 pm

./ext/mingw/rubyeventmachine.so: 5: Access is denied. – ./ext/mingw/rubyeventmachine.so (LoadError)

meant [I think] you need to recompile your .so to work with a different machine. Maybe :)

Older Posts »

Powered by WordPress