For a small slide show I wanted to randomize the filenames. I first thought
about random numbers but I realized that there can be collisions. Then I came
over the idea to use a hashing algorithm. The first few characters should be
sufficient (like in git).
Here is a short snippet. It’s quick and dirty but it works. Maybe it would be nice to specify file extensions, too.
At home i have an external monitor connected via HDMI to my laptop. Before disconnecting you have to disable the output, or KDE will go crazy and display windows out ouf the visible desktop.
I don’t like the mouse intensive way of going to the menu, start the settings and click to the display configuration.
There is a simpler way to configure the display from the commandline with xrandr. I just created two scripts, one to enable the HDMI output and set it right of the LVDS output, and one to disable the HDMI output.
In our current c++ program we used getopt for the argument processing. Compiling the program with Fedora16 was no problem. Today the code didn’t compile with Fedora17. The error was
getopt is not in cstdlib anymore. The includes are extended with getopt.
AirDroid is a Android app which provides a webinterface to your Android device. The webinterface is accessed through the local WiFi.
The most useful feature for me is to write Textmessages (SMS) from your Laptop. Another nice feature is to make screenshots and download it directly with the browser. The interface is very well designed and the app is for free.
This time I am sharing a simple design for a H-Bridge with used parts and an mbed ARM Cortex-M0 controller.
I had a bit difficulties to control the PNP transistors with the controller. The deal was to lift the voltage for the base of the PNP.
My design is based on used parts out of old cheap 5.1 dvd / audio combination and other stuff. Basically I think it doesn’t really matter which type of transistor you use unless you are dealing with high powered motors.
Not so much text, here is the schematic:
Here a picture of the breadboard prototype:
To control the motor with the mbed you can write a program based on the following source:
You know this situation you started eclipse in a terminal and after opening a few files you want to type some commands in the terminal but you forgot the & after the command.
You can kill the programm (eclipse) with strg+c or you can pause it with strg+z and send it to the background with the bg command. After that your programm is continuing normal and you can use the terminal.
Using gPhoto and libgphoto2 you can control your Camera with your Linux PC and the Commandline. I’m using fedora16 and a Nikon D5000. With this setup you can easily shoot and download pictures using the USB cable. It is used as control and after the capture downloads the picture to your local folder.
To install gphoto2 on fedora use following command:
sudo yum install gphoto2
Connect your Camera to your PC or Laptop. Run following command to capture and download a Image:
I had to install Windows 7 Home Premium on a Laptop where the DVD drive doesn’t work. I ordered DVDs, and realized it doesn’t boot.
After creating a .iso image of the DVD I realized the Windows USB tool isn’t accepting custom .iso images, just the ordered from the windows shop.
To make the Windows tool accepting your .iso file you can use the tool from withinwindows:
http://www.withinwindows.com/2009/11/01/use-the-windows-7-usbdvd-download-tool-with-custom-isos/
After using it the Windows USB tool is accepting my image.
Sometimes I shoot my pictures with Nikons NEF/RAW format but keep also shooting JPEGs. To sort bad pictures out I only view the JPG and delete them if I don’t like them. After this process I end up with sometimes very much NEF/RAW images which I don’t want.
To delete the unwanted NEF/RAW files you could probably just find them in the file explorer and delete them.
If you are at a Linux Box, there are better ways to do this. If also using the zsh, you can use this simple command to print all NEF files where no JPG exist:
print *.NEF(e_'[[ ! -e $REPLY:r.JPG ]]'_)
or just delete them:
rm *.NEF(e_'[[ ! -e $REPLY:r.JPG ]]'_)
Command based on http://grml.org/zsh/zsh-lovers.html
# Show me all the .c files for which there doesn't exist a .o file.
$ print *.c(e_'[[ ! -e $REPLY:r.o ]]'_)