Tuesday, September 20, 2011

Wireless on Latitude D820

The wireless hasn't worked for awhile on this. Didn't know why, but when I investigated today, I looked at /etc/sysconfig/hwconf and modprobe.conf and found that the non-existent driver iwl3945 was associated with eth1. Not sure how that happened, but the result was that ifup-ifcfg-eth1 would tell me to connect a cable to the device -- I guess it assumed the tg3 or some wired driver as a substitute. I did the following and rebooted, which seemed to work:

modprobe -r ipw3945
modprobe ipw3945

And I may have not needed to do this, but in modeprobe.conf, I manually changed iwl3945 to ipw3945. The Wireless card comes and goes in hwconf, so I'm not sure that changing that file does much. Anyways, after doing these things and rebooting, (oh, and double checking that ifcfg-eth1 is assigned to eth1 and that the GUI Network interface also shows eth1 being tied to the same driver and hardware), it worked again.

Wednesday, April 6, 2011

Convert PNG to PDF

I forgot that PDF is supported in CONVERT.

convert file.png file.pdf

Wednesday, March 10, 2010

Reading Binary Files

To handle DNA data coming out of old and new generation sequencing machines, I needed to learn how to read the binary SCF files that are typically output by the software these machines use. To do so, I needed to know the byte format of these files, and I had to translate from C definitions of the data types to IDL data types.

The byte format page describes in detail how the bytes are ordered. There's a header, some comments, base calls, and traces. The base calls include probabilities and a cross-reference to the trace position where the base was called. The traces themselves are stored as consecutive differences as opposed to absolute values, so translating the SCF traces to something you're used to is non-trivial.

The biggest trick in this was figuring out how to use IDL's READU function, the OPENU function, the latter with the SWAP_ENDIAN keyword set. The byte-ordering (at least on the 3.00 version SCF files I used) is different from what IDL expects. Also note that READU shifts the file pointer according to the data type of the variable you'll be reading in, something I found out the hard way and later read in the documentation.

I found the POINT_LUN,unit,pos function was most useful for shifting and tracking the file pointer. Defining a variable = -1 * unit (i.e. the negative of the logical unit) makes POINT_LUN return the current position.

Thursday, March 4, 2010

Making GIF animations

I've done this enough times, but I still don't remember.

convert -delay 50 -loop 0 age*gif noscale.gif

Thursday, February 11, 2010

IRAF tasks

I had to add the XIDL tasks for Gemini data. At some point, you need to add the x_gmos packages.
1) mkiraf in a new directory (so you have a fresh set of parameter files)
2) To login.cl add: "set x_gmos = ""
3) Near the end, define the package:
task $x_gmos.pkg ".x_gmos.cl"
(the $ sign is necessary and signifies that there is no parameter file)
4) Now it should work to call it as "x_gmos".

Monday, December 28, 2009

iptables for ssh and gmote

Run these commands to open up incoming SSH and Gmote through iptables. Be sure to open the appropriate port/ip combination in the router.

SSH:
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT

Gmote (port 8889):
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 8889 -j ACCEPT

I think it works to run simultaneously, but I haven't tested it yet.

Copying Tapes to DVD

Use the CyberLink PowerDirector v5 (not Producer!) supplied with the KWorld PCI Card. Plug the red/black audio feeds from the card into the audio out (L and R, doesn't really matter which, just be consistent) on the VCR. The yellow video out should be plugged into the yellow video out of the VCR.

Make sure the CyberLink PowerDirector is installed. Then open it on your computer. As a test run, plug in the USB end of the KWorld card into your computer, and the audio end into the microphone jack (Windows *should* automatically detect both). Click on 'capture' and then click the hammer/nail picture below the main box on the left hand side of the screen (it's a configuration menu). Make sure the video is coming in through USB and audio is coming in through "Line-in". Finally, check in control panel --> sound settings --> microphone that the "Line-in" is not muted, and that the sound is not turned down too far.

Now do a test run: Push play on the VCR. On the right side of hte screen, you should see your video playing, but you probably won't hear any sound -- don't panic. Press the record button on the left side of the screen to make a test recording for like 30 seconds. Press "stop" (you should be prompted to name the video clip you've just made), then also stop the VCR. Click on the new clip on the right side of the screen. It should open up a viewer screen where you just push 'play', after which the video should play and you should hear sound.

If you don't hear sound, be sure you're listening in the right place! Is the sound configured to go to the headphones or to the speakers? You can probably configure this somewhere in CyberDirector, but on my laptop, it went to the headphones by default (it only does this in CyberDirector?), so to listen to the video, I needed to plug in headphones. If the sound is OK, then you're good. If not, discard this video and try adjusting the Line-In volume and the volume on the video. Then repeat the test.

Once you're happy, select the 'quality' of the recording (DVD-HD, SP, LP, SLP; better quality means more disk space. You want to be sure the quality of the recording will not use too much of the laptop disk, and will *also* fit on the DVD you're going to copy to. There are some meters in the capture screen that give you estimates of the space consumed by the video, and that should be enough to calculate the approximate final size of the video. There's probably not much point in ever being higher than SP if you're recording from VCR tapes, but you can view the quality for yourself.

When all of that is set, make your recording. It will take as long as it takes the VCR to play the tape at normal speed. When done, press stop, and be sure the clip is saved. Then click 'Edit', which will take you to an interface for editting what you have recorded. Here, you can try various tools in the CyberDirector to clean up the video and audio (the audio clean-up of white noise seems to work pretty well for crappy old tapes). You can also carve up the video into chapters, edit the length, etc. The best thing to is to experiment, and to be sure you don't permanently screw up the ~2hr video you just made.

Next, you can prepare to copy to a DVD...