Migration Complete

Just for posterity, I am writing this post to see how much I update my site after the first post on the new site.

I just finished decommissioning droidtutorials.net and moved the content here.  I realized that the information on droidtutorials.net was more Ubuntu than Android.  Additionally, I find I am more interested in other things than tutorials.

Migration: Complete

Being Interesting:  In Progress

-Zach

Comments Off on Migration Complete

Filed under Site Updates

Fixing grub issues

I recently wanted to try Ubuntu 12.04 on my laptop (Dell mini 10). I messed around quite a bit and ended up destroying some vital part of the mbr or the partition table. I finally fixed the partition error by wiping and reinstalling. I copied all my data first and this time I went for Ubuntu 11.04 (minimal install) which I had earlier. After getting it installed I had a strange problem–it would only boot if the usb drive was plugged in.

I thought that maybe it had copied the grub2 information to the usb instead of the harddrive. What I did to correct the problem was simple. I booted up, with the usb plugged in then I typed:

sudo grub-install /dev/sda

Then unplugged the usb and rebooted I was good to go.

 

Other Links:

https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

Leave a Comment

Filed under Ubuntu

Fixing adb “no permissions” usb error in Ubuntu

I am running a minimal Ubuntu 11.10 install–as you can see from other posts–inside a virtual box, strictly for development purposes.

I am trying to use my old Droid 1 for dev because my virtual pc has almost no ram. I got adb to detect my Droid 1 but now I’m getting this error:

dev@DevVbox:~/android-sdk-linux/platform-tools$ ./adb devices
List of devices attached
????????????   no permissions

Ok it looks like the problem is solved by creating a file in the /etc/udev/rules.d/ folder.  developer.android.com recommends 51-android.rules thus I will use that name.

In a terminal type:

sudo gedit /etc/udev/rules.d/51-android.rules

Now you need to add your device definition to this file.  My file is looking like:

SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"

For your own device change the ATTR{idVendor}==”Your Device Number” to the device you want to use.  Find your vendor id here.

Now I make my file readable:

sudo chmod a+r /etc/udev/rules.d/51-android.rules

Next I restarted udev:

sudo service udev restart

Then I restarted adb:

dev@DevVBox:~/android-sdk-linux/platform-tools$ ./adb kill-server
dev@DevVBox:~/android-sdk-linux/platform-tools$ ./adb start-server

Then I unplugged my phone and plugged it back in. (On virtual box I had to tell it that I wanted my virtual pc to attach that device)

presto now I get:

dev@DevVBox:~/android-sdk-linux/platform-tools$ ./adb devices
List of devices attached 
0403683B0A023017	device

Other links:

http://developer.android.com/guide/developing/device.html#VendorIds  (start here)

http://www.reactivated.net/writing_udev_rules.html

http://ubuntuforums.org/showthread.php?t=168221

http://ptspts.blogspot.com/2011/10/how-to-fix-adb-no-permissions-error-on.html

 

 

 

Leave a Comment

Filed under Android Development, Ubuntu

Getting Quicktime Trailers to work on Ubuntu Minimal Install

I love watching trailers with my wife so apple trailers has to work on my computer.  I have a Minimal Ubuntu install, so how do I get it to work?

I am running only Chromium and I needed something that will work and to install too much.  It does install about 40 megs of stuff so if you are wanting less space it might not be the solution for you.

I found it was pretty easy actually.  From a command line type:

sudo apt-get install mplayer gecko-mediaplayer

Say yes at the appropriate time, and restart your Chromium browser if it is open.  Now go watch some movie trailers!

 

Other links:

http://trailers.apple.com

 

Leave a Comment

Filed under Uncategorized

Ubuntu – Setting up a SSH Server on a Minimal Install

On a minimal install there is no SSH server setup automatically so I’m having to add that.  Here is what I did:

SSH client is installed in the minimal (Ubuntu 11.04), but the SSH Server is not.

From the Terminal type:

sudo apt-get install openssh-server

 

That seems like all you need to do.  If you have connected to the computer previously and it is a fresh install you may run into an error regarding the Key not matching.  To fix this in Ubuntu delete the ~/.ssh/known_hosts file on the client PC.

 

https://help.ubuntu.com/10.04/serverguide/C/openssh-server.html

 

 

Leave a Comment

Filed under Ubuntu

Ubunut Minimal Install – Fixing Locale Error After Removing language-pack-en-base

I read on a low memory install site that I could save some space by removing language-pack-en-base. Great!  I did it but now I’m getting all kinds of errors on locale not configured.

To fix this problem it was rather simple from the terminal I ran:
sudo dpkg-reconfigure locales

It creates errors while reconfiguring but afterwards it seems to fix the problem.

Other links:
https://help.ubuntu.com/community/Installation/LowMemorySystems
http://www.myscienceisbetter.info/repair-perl-locale-errors-on-ubuntu-server.html

Leave a Comment

Filed under Uncategorized

Ubuntu 11.10 Command Line Quick Reference

I’m finding myself searching the web for tons of command line references for Ubuntu, and then forgetting what I looked up a few days later.  The mind is a terrible thing to watch waste.  Well Here is a list of the things I’m finding so that I can get it easily later.

 

Find Files:

find -iname ‘fileiwant.blah’

This is a case insensitive file search in the directory you are in.

 Drive mounting/finding info

sudo fdisk -l

This will display a list of drives and their sizes as well as the important /dev/sdXX

First find the /dev/sdXX that you want to mount, it should look like /dev/sda1 or /dev/sdb1 or something similar.Next you must mount it to a directory using:

sudo mount /dev/sda1 /media/mountdirectory

Insert your dev number where sda1 is and /media/mountdirectory is the location of the directory where you want to mount it.

To find your mount points for already mounted drives simply type:

mount

File Manipulation

cp -Rv filetocopy.file /directorytocopyto/

Copy filetocopy.file to /directorytocopyto/.  It will also copy subdirectories (-R) and -v will show all the files which are copied (verbose).

sudo chmod u+xwr filename

Add execute, write and read to filename for the file owner.  You can change Owner, Group and Other permissions for read, write, and execute.  There is another way and it may be easier if you can understand the numbers.  here is an example: chmod 777 In this example the file would be set to read, write, execute for owner, group and other.

Permission Owner Group Other
Total 7 7 7
Add x 1 w 2 r 4 x 1 w 2 r 4 x 1 w 2 r 4

Unzipping .tgz (tar gz) Files:

Files ending in .tgz are files which have been zipped and tared.  They are the Linux equivalent of .zip files.  To undo them simply type:
tar -xzvf myarchive.tgz
Explanation of options:

x is extract

f FILE is the file to extract

v verbose mode (optional)

z gzip or gunzip mode, necessary for gz files and tgz.

 

Other Links:

https://help.ubuntu.com/community/FilePermissions

https://help.ubuntu.com/community/FileCompression

Leave a Comment

Filed under Ubuntu

Ubuntu – NFS quick and simple

I found a few tutorials which went into depth on various aspects of NFS (Linux file sharing) and finally used this method. There is no security and I currently have clients set to manually mount shared drives after reboot. I may work on that later.

On the Server:
install NFS files from a terminal:
sudo apt-get install nfs-kernel-server nfs-common portmap

You can create a folder to house your shares or use an existing one.
create an export file which will define what folders will be shared using your favorite editor edit /etc/exports (using sudo). I have added a few lines like these:

/exports 192.168.1.1/24(rw,no_root_squash,async)
/exports/anotherfolder 192.168.1.1/24(rw,no_root_squash,no_subtree_check,async)

The first part (/exports) is the location of the folder can be anything.

The second part (192.168.1.1/24) is the ip addresses allowed to access this can be a single address or a subnet like this example.

The third part ((rw,no_root_squash,no_subtree_check,async)) defines the permissions.  These are read/write.

Last you have to edit /etc/default/nfs-common change the following lines to reflect these settings:

# Do you want to start the idmapd daemon? It is only needed for NFSv4.
NEED_IDMAPD=yes
# Do you want to start the gssd daemon? It is required for Kerberos mounts.
NEED_GSSD=no

After editing this file you have to restart the nfs using:

sudo exportfs -a

On the Client:

Install the necessary files:

sudo apt-get install nfs-common portmap

On the client you have to edit /etc/default/nfs-common to match the server:

# Do you want to start the idmapd daemon? It is only needed for NFSv4.
NEED_IDMAPD=yes
# Do you want to start the gssd daemon? It is required for Kerberos mounts.
NEED_GSSD=no

Next create a folder where you want to have the shared file exist:

mkdir ~/sharedfiles

now simply mount the shared drive to the directory (let’s assume that the server ip is 192.168.1.10):

sudo mount 192.168.1.10:/export/anotherfolder ~/sharedfiles

That should do it.

Next I’ll try and figure out how to remount these files after reboot on the client.  You will have to re-run the mount command above if you reboot your client.

Other Links:

http://www.ubuntugeek.com/nfs-server-and-client-configuration-in-ubuntu.html

https://help.ubuntu.com/community/NFSv4Howto

http://www.ubuntugeek.com/mount-network-file-systems-nfssamba-in-ubuntu.html

 

Leave a Comment

Filed under Ubuntu

Ubuntu Sound Saga

This post is to document my saga with a usb sound card and getting it to work. I know that I can get sound out of this card because I already had it working. I changed a setting and now no sound.

What I have tried so far:
Reinstall of Ubuntu, this time I’m going for minimal install.

installed packages for sound:
sudo apt-get install linux-sound-base alsa-base alsa-utils

aplay -vv /usr/share/sounds/alsa/Front_Center.wav  (Verbose tells me no card)

No sound.  Displays:

ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4663:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:660: audio open error: No such file or directory

Now I search to see why my usb card is not detected.

sudo aplay -l
Displays (just aplay -l says no sound card... maybe this is my problem):
**** List of PLAYBACK Hardware Devices ****
card 1: default [Generic USB Audio Device ], device 0: USB Audio [USB Audio]
 Subdevices: 1/1
 Subdevice #0: subdevice #0

Now I’m trying:

lspci -v | grep -A7 -i "audio"

Shows nothing, this could be a problem (turns out this is because I’m using a usb sound card and my pci card is disabled).  I am going to try reseating the usb card.  Looks like I had the cable plugged into the mic input.  Still no sound and same error when aplay is used.  On to the next thing.  Reading the SoundTroubleShooting guide leads me to think it might be bios, checking settings in bios.

alsamixer does not run.  But if I specify the card alsamixer –card=1 it will work.

I changed USB bootable in my bios and now I can use aplay -l with no sudo but still same error when trying to play some file.  Still nothing shows up with lspci. Next I will look to see if my driver is loading correctly.

Step 1: what is my sound driver supposed to be called?  snd-usb?

lsusb

Gives more info, my card is:

Bus 004 Device 002: ID 0d8c:000e C-Media Electronics, Inc. Audio Adapter (Planet UP-100, Genius G-Talk)

This sounds familiar from the last time, at least the Planet UP-100. Ok what driver do I need?

Perhaps the driver is snd-usb-audio?  Taking a look at the file: /etc/modprobe.d/alsa-base.conf this file prevents the loading of the snd-usb-audio driver as the 0 device.  Since I disabled my primary card (it doesn’t work with Ubuntu) the usb has to be the primary card.  I will comment out the lines that prevent it from loading (there happen to be two of them exactly the same):

options snd-usb-audio index=-2 (just add a # in front of the line)

Restarting alsa:

sudo alsa force-reload

It also gave me a nice list of the drivers being loaded by alsa.  Retesting.

SUCCESS!!

Recap:

1. Check cables.

2. Play sound: aplay -vv /usr/share/sounds/alsa/Front_Center.wav

3. Check if there is a card: sudo aplay -l

4. Use either lsusb or lspci -v | grep -A7 -i “audio” to find out if there is a sound card detected.

5. Check that the drivers are loading correctly.  If usb and it has to be the primary card edit /etc/modprobe.d/alsa-base.conf to allow usb as card 0.

Reloading alsa: sudo alsa force-reload

 

**Update**

I got a new computer and there were some audio problems with it as well after a minimal install.  Here is what I did:

After running the requisite aplay I got an error message saying:

ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4663:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:660: audio open error: No such file or directory

Next I tried to run aplay sound with sudo, it worked fine.  My hunch is that there is some sort of permission problem and my user is not setup for access to sound where the root user is.  Now I will check to see if there is a group problem.

First I tried adding my user to the audio group:

sudo adduser username audio

I get the same error running aplay.  Restarting alsa does not fix the problem.  Reboot the computer.

Success!
Links:

https://help.ubuntu.com/community/SoundTroubleshooting

http://mauroandres.wordpress.com/2007/04/18/minimal-ubuntu-install/#Sound

http://www.alsa-project.org/main/index.php/SoundcardTesting

http://www.maenad.net/geek/di8k-debian/node23.html

 

https://help.ubuntu.com/8.04/serverguide/C/user-management.html

 

 

 

2 Comments

Filed under Ubuntu

Grub 2 – Adding a Boot Option

I always forget how to add an option so here is the quick and dirty.

Add to grub 2 by adding a file to the /etc/grub.d/ folder. There are several in there already (those are the current options) Grub organizes them by name so 00_header comes before 10_linux. Add a new file ie: (12_newfile) and edit it in your favorite editor.

I am going to use this file for an install drive from the mini.iso
so you may have to determine what the correct settings are here is my file:

#!/bin/sh -e
echo “#HD Ubuntu Install”
cat << EOF
menuentry “HD Install” {
set root=(hd0,1)
linux /linux
initrd /initrd.gz vga=normal ramdisk_size=14972 root=/dev/rd/0 rw —
}
EOF

The important part is the root=(hd0,1) and the linux/initrd

root is the drive you want to use, for instance if you want to use /dev/sda1 it is (hd0,1) sda2 would be (hd0,2) sdb1 would be (hd1,1) etc.

linux is the linux image names are often: linux vmlinuz

initrd is often initrd.gz  these things can change so best to do a search to get the right options.

Once your write this file you have to make it executable and have grub reconfigure the grub.cfg file, from the command line type:

sudo chmod +x 12_filename

sudo update-grub

Reboot and your new option will be there.

Links:

http://ubuntuforums.org/showthread.php?t=28948

Leave a Comment

Filed under Ubuntu