Jul 10, 2011

Reset Compiz in Ubuntu 11.04

If your window title bar is gone. or you have messed the compiz in any other way in Ubuntu. Just open up a terminal and enter the following command:
gconftool-2 --recursive-unset /apps/compiz-1

Then Logout and Login back.

Edit:
As commented by zwergnase, the above command should also be followed by:
gconftool-2 --recursive-unset /apps/compizconfig-1

Solve -- Xlib: extension GLX missing on display

Recently I was playing with OpenCL in my system. Due to its dependency, I had to mess up with different packages. I even installed Intel® OpenCL™. And suddenly on next boot Something went wrong.
And this is what I did to revert back:
sudo apt-get purge nvidia*
sudo apt-get install --reinstall xserver-xorg-video-intel  libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
sudo dpkg-reconfigure xserver-xorg
sudo update-alternatives --remove gl_conf /usr/lib/nvidia-current/ld.so.conf

Hope it helps you too.

Reference:
https://theiszm.wordpress.com/2010/06/27/glx-missing-on-display/

Jun 26, 2011

Save Streamed Flash Video [Firefox-4] [Linux]

It cost me almost half an hour to find the location, where Firefox saves the streamed video. And I made a script for it as I often need it. Here's the script, hope it helps you:

file /proc/$(pidof npviewer.bin)/fd/* | grep -i "flash" | \
  cut -d':'  -f1 | xargs -i{} cp {} ./ 

Details of what the command will do:
Fifefox-4 uses an external process (npviewer.bin) to manage external plugins. So what I did was grabbed a copy of the deleted flash file (yea it deletes the file, but keeps a secret opening for itself) from npviewer.
Finally all the cached video are copied to current path named with some random numbers (technically, the number is file-descriptor).

Warning: Execute the command after complete streaming and before closing the firefox(-tab).

Apr 4, 2011

Nikon Intervalometer using Nepaluino (Arduino)

Recently I got a chance to attend the first Nepaluino workshop (Sincere thanks to Ujwal Shrestha). It was real fun to program Nepaluino with hackers.
For those who don't know what Nepaluino is: its a Arduino clone. More on this from the founder of Nepaluino -> here

Few days after that we decided to build Intervalometer using Nepaluino. As I own a Nikon D90, I set myself to build one for it. Thanks for the help, Ujwal.

So lets start.
First connect the Circuit. Its pretty easy Just connect the Nepaluino digital pin-13, the IR transmitter, the resister and the Ground in series.

Next compile the following code in Arduino IDE and upload to Nepaluino.
int pinIRLED = 13;                                      // assign the Infrared emitter/ diode to pin 13
void setup() {
  pinMode(pinIRLED, OUTPUT);                            // set the pin as an output
}
// sets the pulse of the IR signal.
void pulseON(int pulseTime) {
  unsigned long endPulse = micros() + pulseTime;        // create the microseconds to pulse for
  while( micros() < endPulse) {
    digitalWrite(pinIRLED, HIGH);                       // turn IR on
    delayMicroseconds(13);                              // half the clock cycle for 38Khz (26.32×10-6s) - e.g. the 'on' part of our wave
    digitalWrite(pinIRLED, LOW);                        // turn IR off
    delayMicroseconds(13);                              // delay for the other half of the cycle to generate wave/ oscillation
  }
}
void pulseOFF(unsigned long startDelay) {
  unsigned long endDelay = micros() + startDelay;       // create the microseconds to delay for
  while(micros() < endDelay);
}
void takePicture() {
  for (int i=0; i < 2; i++) {
    pulseON(2000);                                      // pulse for 2000 uS (Microseconds)
    pulseOFF(27850);                                    // turn pulse off for 27850 us
    pulseON(390);                                       // and so on
    pulseOFF(1580);
    pulseON(410);
    pulseOFF(3580);
    pulseON(400);
    pulseOFF(63200);
  }                                                     // loop the signal twice.
}
void loop() {
  takePicture();                                        // take the picture
  delay(5000);                                          // delay in milliseconds which allows us to do timelapse photography - 1 second = 1000 milliseconds
}
Thats it. Now your Intervalometer is ready. It clicks the shutter every 5 secs. Notes: Compatible with: All Nikon Cameras supported by ML-L3

Ref: Arduino – IR remote/ intervalometer for Nikon D80 DSLR