Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Record Audio playing in your computer

Hi! In this post I'm going to explain you one of those things that the music industry doesn't want you to know: how to record audio playing in your computer. :)
Some years ago, back in the days when I was still using Micro$oft Windows XP, I remember that in the sound properties there was an option named "stereo mix" that would allow you to do record the audio being sent to the output of your sound card. However, from what I've read some time ago, that useful option has vanished from the sound controls in more recent versions of Micro$oft Windows.
When I heard about it I started wondering why would they remove a useful feature from the audio options. I googled about it and the history is that the music industry made some pressure next to sound card manufacturers, Micro$oft and Apple so that they would drop that feature in hardware and software, so that people wouldn't be able to copy music. If the history is true or false, I do not now, but, honestly, it wouldn't surprise me and certainly is a kind of measure that fits within the spirit of SOPA, PIPA, ACTA, etc. : limiting the freedom of people to get money at all cost.
However, using linux gives you back that freedom. Moreover, using the audio-recorder application you can do it in an even better way! :)

(Click the photo for better resolution in Picasa Photostream)
The audio-recorder application allows you to record audio being played by any program of your choice, instead of the final sound card output mix. To install it you can download the appropriate package for your Ubuntu version and computer architecture (32- or 64-bit) here.

Headless start with the Raspberry Pi

Hi! Some time ago I made two posts about the the Raspberry Pi (Raspberry Pi has Arrived and First Impressions on the Raspberry Pi) and unfortunately since then it has been closed inside its box. I really wanted to do something with it but other projects always got in the way. Finally I'm doing a project where I'll use the Raspberry Pi and I hope to make some posts about Raspberry Pi stuff while I work on it. To begin I'll show you how to start playing with your Raspberry Pi without having to connect it to an external HDMI monitor or screen with RCA connector and using Ubuntu on your computer.

(Click the photo for better resolution in Picasa Photostream)
The first thing to do is get yourself a 4GB (or greater) class 4 SD card. Branded cards are usually better and more trustful. If you have one, then its time to prepare the card to be used in the Raspberry Pi.

How to install HeeksCAD in Ubuntu 12.04

Hi! In a previous post where I wrote about the CNC Software Toolchain for Linux I mentioned HeeksCAD, which is a great software to generate the toolpaths from the 3D models for CNC machining. Since I upgraded to Ubuntu 12.04 I started having some problems with the HeeksCNC plugin and some features like the pocketing and profile operations stopped working. I tried to reinstall it in Ubuntu 12.04 but then I found out that it wasn't a so straight forward process as with previous Ubuntu versions. As such, I decided to make a small tutorial on how to install it under Ubuntu 12.04 Precise Pangolin.

(Click the photo for better resolution in Picasa Photostream)
So, the first trick is that you cannot install the official version from the official HeeksCAD git repository.

How to locate files in linux

Hi! Have you ever needed to find some files in linux? Here's a quick and easy "How To" on it. To locate files you can use the command "locate" (yes, to locate, use "locate", pretty obvious, huh? :P). If you know the name of the file just launch a terminal and write:
locate "filename" 

(Click the photo for better resolution in Picasa Photostream)

Hi! This post is about a common need for everyone. That's highly probable that, at least once, you needed to resize lots of pictures, either to spare some storage space or just because you needed them to have a specific size for some reason. Below you'll find a script to do it with no effort :) It is based on my previous script for Overlaying a logo in multiple images at once. Once again we'll use the "convert" program from the Imagemagick toolkit.

(Click the photo for better resolution in Picasa Photostream)

Using Piklab with Tiny PIC Bootloader


Piklab already has programming interfaces for various programmers, including the Tiny Bootloader. To configure it you must go to "Settings > Configure Programmers... > Tiny Bootloader" and then set your serial port and it's specific settings. In my case, since I use a USB <->Serial TTL Cable (see my previous post on how to make a Low Cost (1,85€) USB to RS232 LVTTL Serial Cable), I configure it with the following data:
  • Port Selection: /dev/ttyUSB0
  • Specific > Port Speed: 19200
  • Specific > Timeout: 300
  • Specific > No of Retries: 5
Get the flash player here: http://www.adobe.com/flashplayer

After inserting all the correct configurations for your serial connection, Click "Apply" and you're ready to go. To program you just have to go to "Programmer > Program". Do not forget to click the Reset button of your development board to reset the PIC and initiate bootloader when you want to program it.

Easy, right? Yes, but it doesn't always work. :( I had it working when I used Ubuntu 11.04 Natty Narwhal and some version of Piklab that I can't remember now but since I upgraded to Oneiric Ocelot and a new version of Piklab, the Tiny Bootloader programming interface stopped working. However, there is another easy way to use Tiny Bootloader with Piklab.

How to setup a Cisco VPN Client in Ubuntu 11.10

In this post I'll guide you through the very simple process of setting up a VPN client to a Cisco VPN using the Ubuntu's Network Manager. A VPN is a Virtual Private Network. What does this mean? It means you can connect your computer to a Local Area Network through the Internet and do everything you could do in that network (access files in a local server, access specific websites, etc.) as if your computer is connected to that network by cable or Wi-Fi.
The first thing you have to do is to install the VPNC plugin for Network Manager, so that it becomes able to support the Cisco VPN protocols. To install the plugin open a terminal and run the following command:
sudo apt-get install network-manager-vpnc
Now you just have to click on the network connections icon on the top menu bar, click "VPN Connections" and then "Configure VPN". The Network Manager window will popup and then you can add a new VPN and insert all the info to connect to the desired remote VPN server or import a configuration file (.pcf), if you have one.
Finally, restart your computer and if you entered all the correct settings, you're ready to go! Simple, isn't it? :)



Did you find this post helpful? Do you wish to contribute to other projects regarding computer science, electronics, robotics or mechatronics that will be posted in this blog? If you wish to do so, you can donate via paypal using the button below. Thanks! :)

Donate

Hi! This time I'm writing to talk about a great organizer for electronic components that I found, zParts. Some days ago I decided it was time to organize the lots of electronic components that I have in my home lab. I thought about developing an application were I could insert the parts references, the amount of each component I had, and also with some button to open the datasheet without having to browse the folder with lots and lots of datasheets. However, before developing the application I decided to search if no one had done that work before and I found zParts, by Jon Ziebell. I gave it a try, and that's exactly what I needed. It is written in Java, so it works in whatever operating system you have.

(Click the photo for better resolution in Picasa Photostream)
It's very simple to use and allows you to create categories of components, subcategories, and components with as many fields as you desire. You can also relate each component to an image and a datasheet. What else do you need? :D In my case I don't remember anything else I would need, but if you do, you can always program it yourself, since it is an open source project and its source is available in sourceforge. If you need to organize your components, give it a try! To run it just open a console, enter the folder where you extracted the zParts files and enter the following command
java -jar zParts.jar
If you have tested it, liked it and want to add a shortcut for zParts in Unity in Ubuntu 11.10 just do the following steps:
  1. Create a file under /usr/share/applications named zparts.desktop and paste the following code into it 
    [Desktop Entry]
    Version=1.0
    Type=Application
    Terminal=false
    Icon[en_GB]=/usr/share/icons/hicolor/scalable/apps/gdu-category-multipath.svg
    Name[en_GB]=zParts
    Exec=/<path to folder where you have zparts>/zparts_start.sh
    Name=zParts
    Icon=/usr/share/icons/hicolor/scalable/apps/gdu-category-multipath.svg
    NOTE: Don't forget to put the correct path in the 'Exec' line. You can also change the Icon line with the path to the icon that you prefer.
  2. Go to the folder where you have zParts and create a file named .zparts_start.sh and paste the following script into it 
    !/bin/bash
    cd <path to your zparts folder>
    java -jar zParts.jar
    NOTE: Don't forget to put the correct path in the second line.
  3. Give the script permissions to be executed
    chmod +x .zparts_start.sh
    And that's it! Now when you open the Unity board and type zParts its shortcut will appear.
If you use M$ Window$ you can also try out Component Organizer, which is a similar free software developed by a portuguese guy (user msr @ the portuguese robotics forum Lusorobotica. You can check the entire thread about it here).



Did you find this post helpful? Do you wish to contribute to other projects regarding computer science, electronics, robotics or mechatronics that will be posted in this blog? If you wish to do so, you can donate via paypal using the button below. Thanks! :)

Donate

Hi! In this blog entry I'll show you how to setup a development environment to develop and compile code for Microchip's PIC microcontrollers. We'll need three main packages:
  1. gputils - a collection of tools for the Microchip (TM) PIC microcontrollers. It includes gpasm, gplink and gplib.
  2. sdcc - small device C compiler
  3. piklab - an integrated development environment (IDE) for applications based on Microchip PIC and dsPIC microcontrollers similar to the MPLAB environment. It integrates with several compiler and assembler toolchains. It supports the most common programmers (serial, parallel, ICD2, Pickit2, Picstart+), the ICD2 debugger, and several bootloaders (Tiny, Pickit2 and Picdem).

Today I had to merge multiple PDFs into a single PDF and had no clue on how to do it. It was fairly easy to find out how to do it and I decided to share it. First you have to install two programs
sudo apt-get install gs
sudo apt-get install pdftk
Then you just have two open a console and run the following command
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=resulting_file.pdf -dBATCH file1.pdf file2.pdf file3.pdf
And that's just it. You can change the final document's name from "resulting_file.pdf" to whatever you want and add as many files as you want to be merged into a single PDF.



Did you find this post helpful? Do you wish to contribute to other projects regarding computer science, electronics, robotics or mechatronics that will be posted in this blog? If you wish to do so, you can donate via paypal using the button below. Thanks! :)

Donate

How to use OpenCV with CMake and Codeblocks on Ubuntu

Continuing the previous posts on How to Install OpenCV 2.3.1 in Ubuntu 11.10 Oneiric Ocelot with Python support and How to use CMake ith OpenCV now I'll show you how to use both OpenCV and CMake with Codeblocks IDE. Codeblocks is an open source, cross platform, free, great C++ IDE built to meet the most demanding needs of users. It is very extensible and fully configurable. I have been using codeblocks for about 2 years and I never felt the need to change to another IDE. It supports debugging and code completion which are very useful features.

(Click the photo for better resolution in Picasa Photostream)
In Ubuntu 11.10 Oneiric Ocelot it is pretty easy to add a custom shortcut. Just clink the icon on the upper right of the screen, then System Settings > Keyboard > Shortcuts > Custom Shortcuts ( I'm not sure if this names are exact since my Ubuntu is in portuguese, but it should be something like this ). Then you just have to click the "+" to add a new shortcut, name it and write it's command. After that, apply and then define the keypresses that will call such command. As an example, I defined a shortcut named Banshee which calls the command "banshee" when I press Shift+F4.

Pretty easy, right? However, if you use desktop effects you won't be able to add a shortcut that runs a script the same way, since metacity is not your window manager. Compiz is.

How to use CMake with OpenCV

CMake is a cross platform, open-source build system. It consists in a family of tools designed to build, test and package software. It is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates makefiles that can be used in the compiler environment of your choice.

OpenCV is an open-source computer vision library which was already mentioned in this blog (see How to install OpenCV 2.3.1 in Ubuntu 11.10 Oneiric Ocelot with Python support).

This "how to" will guide you through the process of using CMake to compile and build OpenCV projects. It is based on the tutorial made by Damiles but has some minor changes.

OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. It is written in C/C++ and is used worlwide in many computer vision applications.

This "how to" is a mix of two other great tutorials on OpenCV installations: A Compreehensive Guide to Installing and Configuring OpenCV 2.3.1 on Ubuntu from ozbots.org; and the OpenCV Installation Guide on Debian and Ubuntu from the OpenCV Wiki. I used this procedure to successfully install OpenCV on two amd64 computers (a laptop and a desktop) running Ubuntu 11.10 Oneiric Ocelot. However, if you find any problem you can check the Comprehensive OpenCV Installation Troubleshooting Guide from ozbots.

top