02 Oct 2009

Sound Problems With Urban Terror, Pulseaudio and Ubuntu Karmic

I fixed it by installing libsdl1.2debian-pulseaudio (which replaces libsdl1.2debian-alsa). So it might be worth a try if you get sound problems with any other programs.

Source: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/372843

24 Sep 2009

Hoarders, Pack Rats, Clutter Solutions

Interesting thoughts:

One:

“I have the largest seashell collection on the planet. I keep it

scattered on beaches around the world.” – Steven Wright

Two:

Coveting possessions is unhealthy. Here’s how I look at it:

All of the computers on Ebay are mine. In fact, everything on Ebay is

already mine. All of those things are just in long term storage that I

pay nothing for. Storage is free.

When I want to take something out of storage, I just pay the for the

storage costs for that particular thing up to that point, plus a

nominal shipping fee, and my things are delivered to me so I can use

them. When I am done with them, I return them to storage via

Craigslist or Ebay, and I am given a fee as compensation for freeing

up the storage facilities resources.

This is also the case with all of my stuff that Amazon and Walmart are

holding for me. I have antiques, priceless art, cars, estates, and

jewels beyond the dreams of avarice.

The world is my museum, displaying my collections on loan. The James

Savages of the world are merely curators.

Quote from

http://www.metafilter.com/65284/Collect-em-all#1862024

Number three: Watch www.aetv.com/hoarders for a few episodes and that might cure you!

15 Sep 2009

Broken Ubuntu Karmic: How To apt-get upgrade Using The LiveCD

If your Ubuntu installation (or any other linux distribution that has a liveCD) is broken and can’t boot because of a faulty update, you can try to update your installation after booting from the LiveCD.

Start a terminal and use these commands (/dev/sda2 might need to be changed to match your configuration, you can use fdisk to figure out which partition is your main one):

sudo mkdir /media/karmic  
sudo mount /dev/sda2 /media/karmic  
sudo mount -o bind /proc /media/karmic/proc  
sudo mount -o bind /dev /media/karmic/dev/  
sudo cp  /etc/resolv.conf /media/karmic/etc/resolv.conf  
sudo chroot /media/karmic apt-get update  
sudo chroot /media/karmic apt-get upgrade  
sudo chroot /media/karmic apt-get dist-upgrade

27 Aug 2009

DIY Cheap 3D Scanner

There is lot’s of different cheap design for building your own 3D scanner, here are a few:

19 Aug 2009

Digi Watchport/H USB Serial Humidity/Temperature Sensor in Linux

Using Digi Watchport/H USB Serial Humidity/Temperature Sensor in Linux

Ubuntu 9.04 has everything you need except for minicom. So all I had to do was to:

  • plug it in

    dmesg should get you the following output:

      usb 2-9: new full speed USB device using ohci_hcd and address 50
      usb 2-9: configuration #1 chosen from 1 choice
      io_ti 2-9:1.0: Edgeport TI 1 port adapter converter detected
      usb 2-9: Edgeport TI 1 port adapter converter now attached to ttyUSB0'
    
  • Install minicom:

      sudo apt-get install minicom
    
  • Edit minicom settings:

      minicom -s
    
    1. Change the ‘Serial Device’ to ‘/dev/ttyUSB0’

    2. Change the ‘Bps/Par/Bits’ field to ‘9600 8N1’, (9600 baud, 8 bits, no parity, 1 stop bit). These are the default settings used by the Linux kernel; they can, if necessary, be overridden from the kernel command line by adding extra parameters to the ‘console=’ option. See ‘kernel-parameters.txt’ and ‘serial-console.txt’.

    3. Turn off both ‘Hardware Flow Control’ and ‘Software Flow Control’.

    4. In the ‘Modem and dialing’ menu, remove the ‘Init string’ and ‘Reset string’ completely if required.

    5. Save your new config

    6. start minicom

    7. more details

  • Use one of the following commands:

<td>
    Description
</td>

<td>
    Return Value
</td>
</tr>

<tr>
<td>
    ?<CR>
</td>

<td>
    Tells about the command set available for this Watchport
</td>

<td>
    as described in this section
</td>
</tr>

<tr>
<td>
    I<CR>
</td>

<td>
    Tells what kind of Watchport is connected.
</td>

<td>
    Watchport/H<CR>
</td>
</tr>

<tr>
<td>
    H<CR>
</td>

<td>
    Gives the percentage relative humidity.
</td>

<td>
    38%<CR>
</td>
</tr>

<tr>
<td>
    T<CR>
</td>

<td>
    Gives temperature in Celsius.
</td>

<td>
    +22.2500C<CR>
</td>
</tr>

<tr>
<td>
    TC<CR>
</td>

<td>
    Also gives temperature in Celsius.
</td>

<td>
    +22.2500C<CR>
</td>
</tr>

<tr>
<td>
    TF<CR>
</td>

<td>
    Gives temperature in Fahrenheit.
</td>

<td>
    +72.0000F<CR>
</td>
</tr>

<tr>
<td>
    TF+<CR>
</td>

<td>
    Repeats the TF command every 3-4 seconds until the next keystroke. Appending + also works with the TC and H commands
</td>

<td>
    +72.0000F<CR>
</td>
</tr>

<tr>
<td>
    L4<CR>
</td>

<td>
    Adjusts the slew rate of the data line. When “L” is followed by a numeric value, 1 through 8, Watchport responds with OK. Other values return Invalid Command. The default setting is 4. Adjust the parameter until the data transmission becomes error-free. The setting remains in effect until the Watchport is power-cycled.
</td>

<td>
    OK
</td>
</tr>
Command

Download Watchport’s manual

Now all I need is a perl script to automate the posting of these values to twitter?

11 Aug 2009

Identify Computer Hardware

Here is a nice hardware chart:

Computer_hardware_poster_1_7_by_Sonic840

Here is a larger version. If this link is down, try http://www.google.com/search?q=Computer_hardware_poster_1_7_by_Sonic840

11 Aug 2009

Three Best Firefox Extensions / Add-ons

I tried many other add-ons and extensions, but these are the ones I can’t live without:

  1. Adblock Plus
  2. No Script
  3. Firebug (mostly for web development)

Bonus:

  1. ShareMeNot
  2. HTTPS Everywhere

30 Jul 2009

Convert Picture/Image to DXF
  1. First, do edge detection using GIMP (or any other image editing program)
  2. Then, convert to SVG using Inkscape (File – Import, then Path – Trace Bitmap)
  3. Save as a DXF
  4. Fix DXF in AutoCAD (because it probably created too many lines)

16 Jul 2009

Microsoft’s Bing Travel Site – Down Because of Fire

travel_bing_down_fire

See also </images/microsoft.says.microsoft.is.stupid-2006-03-29_1702.png>, an old screenshot I took from 2006.

06 Jul 2009

How to use Perl’s ternary operator

Perl; The Ternary Operator

The ternary is actually a sequence of operators. The operator is used like this:

CONDITION-PART ? TRUE-PART : FALSE-PART

which is shorthand for the following statement:

if (CONDITION-PART) {
    TRUE-PART
} else {
    FALSE-PART
}

Example: If $firstVar is zero, then assign $secondVar a value of zero. Otherwise, assign $secondVar the value in the first element in the array @array.

$secondVar = ($firstVar == 0) ? 0 : $array[0];

via Perl 5 By Example.

13 May 2009

Arduino – Using an LED as a light sensor (photodiode)

My first attempt at using the Arduino (Duemilnove). This sketch is based on this and that but mine uses 2 LEDs, one for the sensor and one for the feedback. And instead of getting bright when more ambient light is present, it turns OFF if ambient light is bright, stays ON in the dark and blinks if it’s in between.

//
// This example shows one way of using an LED as a light sensor.
// You will need to wire up your components as such:
//LED #1:
// + digital2 (N side)
// |
// <
// > 100 ohm resistor
// <
// |
// |
// -----
// / \ LED #1, 5mm, clear plastic is good (or translucent green lense)
// -----
// |
// |
// + digital3 (P side)
//
//////////////////////////////////
//LED #2  (only required if you don't have the on-board LED on pin 13):
// + digital13 (P side)
// |
// |
// -----
// / \ LED #2
// -----
// |
// |
// + Ground
//
// What we are going to do is apply a positive voltage at digital2 and
// a low voltage at digital3. This is backwards for the LED, current will
// not flow and light will not come out, but we will charge up the
// capacitance of the LED junction and the Arduino pin.
//
// Then we are going to disconnect the output drivers from digital2 and
// count how long it takes the stored charge to bleed off through the
// the LED. The brighter the light, the faster it will bleed away to
// digital3.
//
// Then just to be perverse we will display the brightness back on the
// same LED by turning it on for a millisecond. This happens more often
// with brighter lighting, so the LED is dim in a dim room and brighter
// in a bright room. Quite nice.
//
//
#define LED1_N_SIDE 2 // original code uses pin 2
#define LED1_P_SIDE 3 // original code uses pin 3
#define LED2 13 // LED 2 is on-board or external on pin 13 and ground
//
// -1 = very dark ; 1 = very bright
int extreme = 0;
//
void setup() {
pinMode(LED1_N_SIDE, OUTPUT); // N side is output or input but starts w/ output
pinMode(LED1_P_SIDE, OUTPUT); // P side is alway output pin (drive low or high)
pinMode(LED2, OUTPUT);
}
//
void loop() {
unsigned int waitDischarge, extenLimit;
//
// Apply reverse voltage, charge up the pin and led capacitance
digitalWrite(LED1_N_SIDE,HIGH);
digitalWrite(LED1_P_SIDE,LOW);
delay(30);
//
// Isolate the pin 2 end of the diode
pinMode(LED1_N_SIDE,INPUT);
digitalWrite(LED1_N_SIDE,LOW); // turn off internal pull-up resistor
//
// Turn LED on if ambient light is very dark or medium
if (extreme <= 0) {
    digitalWrite(LED2,HIGH);
}
//
// Count how long it takes the diode to bleed back down to a logic zero
for ( waitDischarge = 0; waitDischarge < 65534; waitDischarge++) {
  if ( digitalRead(LED1_N_SIDE)==0) {
	// very dark (you might need to sligthly change this number depending
	// on the color of the lense of LED #1 for example)
	if ( waitDischarge > 6 ) extreme = -1; 
	// very bright (you might need to sligthly change this number depending
	// on the color of the lense of LED #1 for example)
	else if ( waitDischarge < 3 ) extreme = 1;
	else extreme = 0;
	break;
  }
  delay(30); // to avoid going above 65534
}
//
// Turn LED off if ambient light is very bright or medium
if (extreme >= 0) digitalWrite(LED2,LOW);
delay(200);
}

30 Apr 2009

How to use ALSA w/ applications coded to use OSS (Ubuntu)

By using the ALSA / OSS wrapper:

~$ sudo apt-get install alsa-oss    
~$ aoss "app_that_usually_use_OSS"

30 Apr 2009

Mac Netbook
netbook-1

Mac Netbook.

30 Apr 2009

Salvage used stepper motors from obsolete electronic devices

Here is a list of devices where you might be able to find stepper motors:

  • floppy disk drives
  • flatbed scanners
  • printers
  • plotters
  • shredders
  • faxes
  • photocopiers
  • robots
  • webcams
  • watches
  • really old harddrives
  • backup tape drives

Large stepper motors can be found in automated industrial equipment.

20 Apr 2009

How-To Change The Default Sound Card in Slackware Linux

How-To Change The Default Sound Card in Slackware Linux

My case: I have an on-board sound card that I use for everything except for Skype, where I use my Logitech ClearChat Wireless USB Headset<img src=“http://www.assoc-amazon.com/e/ir?t=wusum-20&#038;l=as2&#038;o=1&#038;a=B0015EY5RE" width=“1” height=“1” border=“0” alt=” style=“border:none !important; margin:0px !important;” />. It is easy in Skype to select a different sound device. So I needed to set my on-board sound card as the default output for everything else.

If they both use a different kernel module you can easily make sure the right one is the default card.

Find out what module is being used for your soundcards:

cat /proc/asound/modules

On my computer this gave

Sound card 0 is the default one (snd_usb_audio in this case). This is the module’s name.

You can’t assign card 0 because whichever card get’s loaded first get # 0. So, you have to assign # 1 to the one you don’t want as the default card. This can be done by adding one simple line to /etc/modprobe.d/sound (create it if it doesn’t exist):

options name_of_offending_module index=1

So, in my case this would be

options snd_usb_audio index=1

Reboot and try

via HOWTO make one soundcard default.

18 Apr 2009

linux chmod files or directory only recursively

From the command line:

-bash-3.00$ find ./ -type f -exec chmod 600 {} \;
-bash-3.00$ find ./ -type d -exec chmod 700 {} \;

16 Apr 2009

watch design led
watch led design

Product Page

14 Apr 2009

Ed Ulbrich shows how Benjamin Button got his face | Video on TED.com

Ed Ulbrich shows how Benjamin Button got his face | Video on TED.com.

14 Apr 2009

Sound Experiment

ToneMatrix.swf (application/x-shockwave-flash Object).

14 Apr 2009

Vast Space

Vast Space