Search This Blog

Monday, August 29, 2011

HowTo: Have Doxygen support Bash/Awk/Sed Script files.

OSDir.com - text.doxygen.general - Re: Having Doxygen support script languages - msg#00027

Doxygen doesn't support bash script files. While that probably makes sense, to not support them (define a bash script file in terms of functions and variables), there are always a few laying around in a source tree that should go into the document.

It's easiest to add the script files without changing them, so a doxygen input filter. Input filters work pretty good with command line sed or awk commands, so we'll do a simple one here that lets you add Doxygen commands comeent lines starting with ##.

Edit these lines in your Doxyfile:
FILE_PATTERNS = *.sh *.awk
INPUT_FILTER = "sed -e 's|##|//!|'"
FILTER_SOURCE_FILES = YES

Add a brief description to the top of each file:
## functions for OpenEmbedded, and Jenkins -*- shell-script -*-.
## @author rickfoosusa
## @file

Generally anything with # for a comment will work, but for languages you get a lot more documentation by using a filter like asm4doxy.pl http://rudy.mif.pg.gda.pl/~bogdro/inne/asm4doxy.txt

Sunday, August 28, 2011

HowTo: Find Earthquakes in Real Time

...A friend said her TV was shaking...Earthquake in Ohio? No way...
http://quakes.globalincidentmap.com/
This includes everything to worry about in real time :)
Not sure they actually have data to show all this stuff, maybe just for those who need some more adversity in their lives...
They do have earthquakes down really well, and track the little 2.0 ones.

Found this a few years ago after the Indonesia earthquakes ... surprised how many earthquakes there were.
http://www.iris.edu/seismon
Only tracks those over 4.0. It's located in southern california, and was not so real time when seismon itself was in a quake. Otherwise, it's been a great source of reality when earthquake articles start flying around...

Friday, August 19, 2011

HowTo: Build apt-rpm for embedded

APT-RPM
Yum, apt-get, the usual package managers are not exactly written for an embedded system. Yum is mostly python, and re-writing it would be unmaintanable overkill. Apt-get is possible, but for several reasons, rpm would be nicer to use at the moment.

So that leaves a little known, but known by everyone package called apt-rpm.
 
A package manager, possibly for an embedded system.

Here's how to build directly from git on FC15...

1001 git clone http://apt-rpm.org/scm/apt.git
1002 cd apt
1008 autoreconf -i -s
1011 sudo yum -y install bzip2-libs bzip2-devel rpm-devel
1031 sudo yum -y install sqlite2 sqlite-devel sqlite2-devel
1034 sudo yum -y install libxml2-devel
1038 sudo yum -y install lua-devel readline-devel
1009 ./configure
1039 make
1040 sudo make install
1042 apt-get
1043 apt
apt-cache apt-cdrom apt-config apt-get apt-shell

the package is also still available on the upstream repo, so that is good.

=============================== Matched: apt-rpm ===============================
apt.i686 : Debian's Advanced Packaging Tool with RPM support
apt.x86_64 : Debian's Advanced Packaging Tool with RPM support
fedora-package-config-apt.noarch : Fedora configuration files for the apt-rpm
: package manager
apt-devel.i686 : Development files and documentation for APT's libapt-pkg
apt-devel.x86_64 : Development files and documentation for APT's libapt-pkg
apt-plugins-list.x86_64 : Additional commands to list extra packages and leaves
apt-plugins-log.x86_64 : Log the changes being introduced by the transaction
apt-python.x86_64 : Python bindings for libapt-pkg

For embedded, it definitely needs to be stripped.
[14:34]<rickfoosusa>rwxr-xr-x. 1 root root 967980 Aug 19 14:24 /usr/local/bin/apt-cache
[14:34]<rickfoosusa>-rwxr-xr-x. 1 root root 761665 Aug 19 14:24 /usr/local/bin/apt-cdrom
[14:34]<rickfoosusa>-rwxr-xr-x. 1 root root 79131 Aug 19 14:24 /usr/local/bin/apt-config
[14:34]<rickfoosusa>-rwxr-xr-x. 1 root root 1252005 Aug 19 14:24 /usr/local/bin/apt-get

Added -Os to the build...
./configure, and ./configure --enable-static
make install-strip
-rwxr-xr-x. 1 root root 110592 Aug 19 15:27 /usr/local/bin/apt-cache
-rwxr-xr-x. 1 root root 788088 Aug 19 15:26 /usr/local/bin/apt-cache-static
-rwxr-xr-x. 1 root root 77848 Aug 19 15:27 /usr/local/bin/apt-cdrom
-rwxr-xr-x. 1 root root 728984 Aug 19 15:26 /usr/local/bin/apt-cdrom-static
-rwxr-xr-x. 1 root root 11944 Aug 19 15:27 /usr/local/bin/apt-config
-rwxr-xr-x. 1 root root 160376 Aug 19 15:27 /usr/local/bin/apt-get
-rwxr-xr-x. 1 root root 827448 Aug 19 15:26 /usr/local/bin/apt-get-static
-rwxr-xr-x. 1 root root 163808 Aug 19 15:27 /usr/local/bin/apt-shell

The stock fedora versions (64 bit) are about the same size.
yum -y install fedora-package-config-apt.noarch
-rwxr-xr-x. 1 root root 110952 May 6 01:19 /usr/bin/apt-cache
-rwxr-xr-x. 1 root root 78064 May 6 01:19 /usr/bin/apt-cdrom
-rwxr-xr-x. 1 root root 11880 May 6 01:19 /usr/bin/apt-config
-rwxr-xr-x. 1 root root 160680 May 6 01:19 /usr/bin/apt-get
-rwxr-xr-x. 1 root root 164488 May 6 01:19 /usr/bin/apt-shell

So there, more to come later...



Wednesday, August 17, 2011

HowTo: Admin a Memcached Server

phpmemcacheadmin - Memcached server admin in php for monitoring and debugging - Google Project Hosting

A new admin package for Memcached servers is available at google code. phpMemcachedAdmin is used to display the memcached admin data.
The current project location is in google code at: http://code.google.com/p/phpmemcacheadmin
There is a google code repo for RHEL based systems, but I have not checked if this package is available there.
The install is trivial, by default it looks for a Memcached server on localhost. The documented install needed a little modernization, so here are the steps for RHEL based systems.

First execute the following code as root.
mkdir /usr/share/phpMemcachedAdmin 
cd /usr/share/phpMemcachedAdmin 
wget http://phpmemcacheadmin.googlecode.com/files/phpMemcachedAdmin-1.2.1-r233.tar.gz 
tar -xvzf phpMemcachedAdmin-1.2.1-r233.tar.gz 
chmod 0777 Config/Memcache.php 

Next create the file phpMemcachedAdmin.conf. This will allow access to the application.
# The order is important, the top level directory last or it will overwrite. 
#Alias /phpMemcachedAdmin/docs /usr/share/phpMemcachedAdmin/docs/html  
Alias /phpMemcachedAdmin /usr/share/phpMemcachedAdmin
 
    Options FollowSymlinks
    Order Deny,Allow
    Deny from All 
    Allow from All
    #Allow from ::1
 
Finally, as root, make a link from your conf file into the web server and restart.
ln -s /usr/share/resultsdb/etc/conf.d/phpMemcachedAdmin.conf /etc/httpd/conf.d/phpMemcachedAdmin.conf service httpd restart 
And now you have a working admin system for Memcached at http://localhost/phpMemcachedAdmin/
Note:
The Ubuntu apache2 configuration wasn't described, but is quite similar. On Ubuntu apache2, you could add something similar to the available sites directory (/etc/apache2/available-sites/phpMemcachedAdmin.conf).


HowTo: Nvidia HDMI out and Analog audio out combined!

Nvidia HDMI out and Analog audio out combined! - FedoraForum.org

There are many, gmixer crashes in my configiuration.

Editing the sound card files is the trick. The GUI can't pick up the onboard AC97 vs. the NVidia HDMI location (0).


HowTo: Benchmark TCP

LeWiz Communications - The Wizard of Internet Communications - Press Releases

This was the best TCP benchmark I've done, and made a good comparison of TCP offload engines at the time.

A lot of TCP, or web server benchmarking gets done. Most of the results are wrong. A lot of web server traffic is measured, across an internet that never maxes out the web server. The web server is doing many other things, so you never know if it can actually run the network at full speed - because it never does.

If it's a 1G network, can your PC or whatever actually put out 1G of data? Most benchmarks don't really go there. Most setups can't measure it.

Get two routers, could be home quality as long as its' 1G.

While you could do this with a switch, you don't want your benchmark machines running other TCP things. There's not much to do, so the router should not interfere with the speed. We are trying to measure the network at maximum speed.

Make cheap transmit and receive subnets.

Measure something (target) that has two ethernet ports...

Put a server for transmits on one subnet, a server for recieving on the other subnet.

Make sure the servers with thier OS/drivers etc can run 1G...Otherwise the obvious bottleneck will occur.

Put the target on both subnets. Start with running something like ttcp with the target recieving data from the transmit server, and sending to the receive server which just throws away the data (no follow on traffic).

With this base, you are set to run some more real world benchmarks and applications to get some good numbers.



HowTo: Restore Google Toolbar on Firefox 5,6,7...

Add-on Compatibility Reporter :: Add-ons for Firefox
I don't need, but with an android phone, would like to have Google Toolbar back.

Download the add-on compatibility reporter, and re-enable the toolbar.

It is an official download in the plugin area, search for "compatibility".

--- begin soapbox
Firefox and Google are going desperate, or separate ways. Google Chrome is now a desktop PC competitor to Firefox - which helps IE by dividing the userbase. Firefox is flipping version numbers every month because of Chrome - which helps IE by alienating IT departments.

I use both IE and Firefox - I would like to have at least two browsers that run all the plugins, and comply with WWW standards. Other than that, I'm just happy to have a free browser that works. I write web pages occasionally, so I will always have more than one browser...
--- end soapbox

Saturday, August 13, 2011

HowTo: Reset a Galaxy S SPH D700 Android Phone

Hi I locked my Samsung Galaxy S as I used wrong pattern 20 times. Now it is asking me to enter my google username - Google Mobile Help

It appears that many people's children have found that the "pattern lock" is a fun video game to play. My kids are old. It get's worse when they get older. They can now do much more devious things to my phone...so they have their own phones.

Problem solved? No. Edward the Dalmatian Puppy took off after some random small prey, dragging me through cactus and pricker bushes (not the first time)...stuffed my phone in my pocket, it happened to roll over the phone lock password, and set one. Not the pattern kind, a number from a keypad. No way around it, Factory Reset...

The Galaxy S SPH D700, doesn't reset like the others...I didn't find a post like this one.

Hold the Power Button + Volume Button + Camera Button + Home Button (the lighted ones on the bottom)

In 5 seconds or so, you will get a screen of blue characters.
  • reboot system now
  • apply sdcard:update.zip
  • wipe data/factory reset
  • wipe cache partition
(It doesn't tell you what the OK button is on the system recovery screen)
The OK button is the Home Button on the bottom row lighted buttons.

Move up and down the selections with the Volume Button.

Factory reset only if you need to (the screen lock password is not in the cache partition). Your contacts will be erased... Did you back up your contacts first? Do you really need all those contacts? If so, why do you keep them on a cell phone?


That will do it. I own my phone again. It's 1am and this dog still isn't asleep...

Monday, August 1, 2011

HowTo: Install gitolite (gitosis replacement) on Fedora

gitolite-tutorial - senawario
gitolite documentation

After working to get my old gitosis working again, I found that development had stopped, and gitolite is the new project, that is now gitolite3 on Fedora 17 - knowing this is the most valuable part of this Howto :)

Gitolite replacement for Gitosis, Gitolite3 is a replacment for Gitolite on Fedora 17. This does NOT cover migration from gitolite 2. We are going to set up gitolite3 with user gitolite.
# Fedora
yum -y install gitolite3 git-all teamgit cgit
 #Ubuntu
apt-get install gitolite3 cgit

# Optional, allow login to gitolite3 account. 
vipw
# Change gitolite shell to /bin/bash (FC 17 is /bin/sh, I prefer bash)
#gitolite:x:492:485:git repository hosting:/var/lib/gitolite:/bin/bash

# Fix up gitolite account for bash
su - gitolite
cp /etc/skel/.* .
# Fixes prompt for funny nis logins...
ln -s .bashrc .profile
# pick-a-password, or not and su - gitolite as root.
passwd
exit
# Set the admin account user account.
su - rfoos
# set up key, take the defaults or use the one you have.
ssh-keygen -t rsa
scp .ssh/id_rsa.pub gitolite@localhost:`whoami`.pub
exit

# Set up the admin repo
su - gitolite
# replace rfoos with `whowasi` :)
gitolite setup -pk rfoos.pub
exit

# Step 7: ADDING NEW USERS AND REPOS
# The tutorial is good, these commands are for reference.
# (add manifest.git for repo...a good start for new projects :) )
su - rfoos
# The admin database, add users and repos
git clone gitolite@localhost:gitolite-admin
cd gitolite-admin/
# Add new user public keys like this.
# cp /tmp/newuser.pub keydir/.
# Add a repo, give users permissions to repos.
vi conf/gitolite.conf
#repo    manifest
#        RW+     =   rfoos
#repo @all R = gitweb daemon

git add keydir conf
git commit -m 'Added repo manifest.git, no new users.'
# On a new git install, you will get a message to set up name and email.
git config --global user.name "Rick Foos"
git config --global user.email rickfoosusa-nospam@nospam-gmail.com
git commit --amend --reset-author
# The push will trigger gitolite to create any new repo's.
git push origin master
# remote: creating manifest...
# remote: Initialized empty Git repository in /var/lib/gitolite/repositories/manifest.git/
exit

# Start using the new repository.
su - rfoos
# List all repositories you have access to.
# ssh gitolite:localhost info -h
ssh gitolite:localhost info
git clone gitolite@localhost:manifest
# Bare repo, create the first file, put it on master branch.
cd manifest
echo "This repository contains repo manifests." > README
git add .
git commit -m 'initial project version'
git push origin master
# Gui interface.
echo "AVAHI_COMPAT_NOWARN=1" >>.bashrc
teamgit manifest
exit

# Set up cgit.

#
# The gitolite documentation.

http://gitolite.com/gitolite/gitolite.html


linux - gitosis: configuration does not exist - Stack Overflow

linux - gitosis: configuration does not exist - Stack Overflow
I remembered installing gitosis on Fedora 14 being a lot more complete. On Fedora 15, couldn't find the admin package. After several HowTo's:
"You should switch to gitolite anyway. Gitosis is no longer being actively developed."

yum -y install git-all teamgit gitolite

Accidentally found teamgit today. A gui interface to git, like svn tortoise. It worked with the example it brought up, so I'll try it - says a lot when the front door of a product is closed or open. Teamgit's front door is open, supported by Fedora and Ubuntu, so looks like a winner.
http://www.devslashzero.com/teamgit/foss_in_2008_workout