Published on
31. March 2011 in
Linux.
Hi peeps,
I’ve been stumbling on this so many times, so I decided to dedicate this post to the following issue:
If you connect an USB device to your computer, trying to access it under Linux, you might run into permission issues caused by the UDEV daemon.
In my case, I was trying to connect an Android smartphone in order to work with it.
However, somehow, I had no permissions to access it, due to UDEV.
Here’s how to fix such a problem:
-
Determine the vendor-id and the product-id of your device using lsusb:
1
2
3
4
5
6
7
| Bus 002 Device 009: ID 0bb4:0c97 High Tech Computer Corp.
Bus 002 Device 004: ID 04b3:310c IBM Corp. Wheel Mouse
Bus 002 Device 003: ID 046d:c318 Logitech, Inc. Illuminated Keyboard
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub |
-
Create a new udev rule for this device, i.e., create a file /etc/udev/rules.d/51-mydevice (for instance), with the following contents:
1
| SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct} =="41db", 2 MODE="0666", OWNER="%username%" |
Published on
29. March 2011 in
Emacs.
Good morning folks out there,
I’ve got another neat little feature of emacs for you today, it’s called quoted insert.
I stumbled on this, because I use spaces for code indentation in my emacs, but I needed to insert an actual TAB character.
So, in this situation, the combination C-q <TAB> is the way to go, which interprets the next typed character in a quoted fashion.
Also, refer to this link for further reading.
Published on
15. March 2011 in
MacOS.
Hey people out there,
daddy’s got a brand new toy to play with. I’ve bought myself a macBook pro and this piece of pleasure impresses me again day after day. I’ve just discovered that one can sync the addressbook app with their google account.
Here you go:
- Edit the file ~/Library/Preferences/com.apple.iPod.plist
1
| { Devices = { red-herring = { 'Family ID' = 10001; }; }; } |
If the file is not present, then create it. If the file is present and too heavy to read, use some property browser.
-
Now, open up Mac addressbook and go to preferences. There, the “Sync with google” option should now be available on the “accounts” tab. Activate it and enter your Google credentials.
-
An actual sync can be triggered with the following command:
1
| $ /System/Library/PrivateFrameworks/GoogleContactSync.framework/Versions/A/Resources/gconsync --sync com.google.ContactSync |
I don’t know, if this only has to be done initially or anytime a sync is wanted… TBD.
Hey folks,
I’ve just discovered another neat feature of gdb: command.
I was in a situation where I needed to watch a certain variable on each breakpoint hit.
Generally, this is pretty easy in gdb using its watch-feature. Unfortunately, the variable under consideration was a QString.
Now, we already have some experience with those little brothers. If we only would have a way to call functions on each breakpoint hit…
… and here it is: command:
Once you have a breakpoint, you can assign a command to it, which will be executed each time the breakpoint is hit. For example:
1
2
3
4
5
6
7
8
9
| (gdb) b main
Breakpoint 1 at 0x804db90: file main.cpp, line 11.
(gdb) command 1
>p argc
>end
(gdb) r
[Thread debugging using libthread_db enabled]
Breakpoint 1, main (argc=1, argv=0xbffff184) at main.cpp:11
$1 = 1 |
In the example above, the command p argc is assigned to breakpoint #1, which will simply print the number of arguments. If a QString variable is considered, one would’ve to replace the p with some gdb macro that is able to print a QString. If no breakpoint number is given, gdb uses the number of the last created one. To tell gdb to leave the command mode, just type end