Wednesday, February 15, 2012

Patch for TAHI's v6eval on FreeBSD after the switch to utmpx

After FreeBSD made the switch to utmpx, which you can read about here:

 http://thread.gmane.org/gmane.os.freebsd.current/122932

Certain programs, like the TAHI organizations v6eval package will fail to compile.   This means the recent 9.0-RELEASE of FreeBSD will no longer work out of the box.  This really only required a minor change to get it working.  I've published a patch here.

v6eval-3.3.1-utmpx.patch

Enjoy!

EDIT: ed@ kindly worked up a functional patch that works with utmpx's binary format, this might explain why sometimes your child processes are left hanging after a run:
http://80386.nl/pub/v6eval.txt

Thanks Ed!

Friday, February 10, 2012

Linux patches for TAHI v6eval 3.3.2

In my previous, ancient post running-tahi-v6eval-suite-on-linux I put out some information for posterity on converting v6eval to run on Linux systems.   Most Linux systems have moved on since three years ago and so has the v6eval suite.

I've kept up with porting the suite @$work to do automatic, unattended evaluation and reporting of our product, but I've neglected to keep it nice and clean for the rest of world.

Seeing that quite a few searches end up on that old post, I've cleaned it up and present a new patch for use against TAHI v6eval-3.3.2 .   You can download the patch HERE.

A few points about the patch and the v6eval suite:

  • To apply, extract the v6eval-3.3.2 package somewhere cd to v6eval-3.3.2 and run patch -p1 < (path to patch filel)
  • v6eval is not 64-bit clean, although it compiles fine, pktbuf will dump core.  I have not investigated or fixed this yet.   The TAHI maintainers are aware that it's not 64-bit capable.    Try to compile only in a 32bit environment.  In addition, I have not tested with -m32 compiles, if they work, let me know.
  • This compiles on a fairly recent Gentoo and a recent version of basically Centos/Redhat.(gcc 4.4.5).
  • Read the INSTALL.linux file for hints
  • Since the patch creates new files, some of these files may need permissions fixes, mainly build.sh and lorder need execute permissions.
  • Use build.sh to build, or incorporate the environment variables.
  • Getting a valid pmake is the hardest part, however Gentoo made it easy:
*  sys-devel/pmake
      Latest version available: 1.111.3.1
      Latest version installed: 1.111.3.1
      Size of files: 289 kB
      Homepage:      http://www.netbsd.org/
      Description:   BSD build tool to create programs in parallel. Debian's version of NetBSD's make
      License:       BSD
  • The patch tries to do the minimum against the distributed code to get it to work with one exception.
  • The patch contains my custom pcap filter enhancement for the tn.def file:
Normally the engine only supports filtering for just ipv6 packets with a single line in the tn.def file:

filter ipv6


Since the automation harness at work has a busy network, I've modified the filter expression to be capable of any valid bpf filter, which means you need use similar syntax to tcpdump, so
filter ipv6
becomes
filter ip6
.

I use something similar to the following example to restrict tests to only the NUT, using the NUT's mac address:

filter ether host aa:bb:cc:dd:ee:ff and ip6


REF:
http://dl.dropbox.com/u/18896363/v6eval-3.3.2-linux.patch

Monday, September 12, 2011

pidgin sipe win32 compiles w/ pidgin 2.10 (libpurple 2.10.0 & sipe-1.12.0)

UPDATE: The sipe project appears to have official builds now:

http://sourceforge.net/projects/sipe/files/sipe/

UPDATE/EDIT: As some of you have figured out from the config.h blurb below, this is actually pidgin-sipe 1.12.0.  I just re-upped to dropbox with a name change on the .zip.   I guess I was trying to brain dump to this blog too fast so I wouldn't forget the steps to compiling it.

Well I did it.



What  a mess it is to compile some of these programs on win32.

I followed the basic instructions on compile pidgin and got that all working.    These instructions are actually pretty good.  They are begging to be automated similar to a FreeBSD port build:

http://developer.pidgin.im/wiki/BuildingWinPidgin

Then I tried to follow the pidgin sipe wiki entry for windows:

http://sourceforge.net/apps/mediawiki/sipe/index.php?title=Windows_Build

These are a bit out of date.   The good thing is that if you're building post 2.7.0 then most dependencies are already there.

There were a couple things broken at this point preventing success:

  • one file was missing an include for glib.h -- already fixed in the sipe git rep
  • you need gmime installed in your pidgin-devel/win32-dev directory (linked on the sipe wiki)
  • you need the rest of libiconv installed in your pidgin-devel/win32-dev directory (grab libiconv-1.13.1-1-mingw32-dev.tar.lzma from the mingw site)
  • libxml2 needed the libs renamed to libxml2-2.lib in their win32-dev directory.
  • sipe-core.c wouldn't compile with several entries from config.h which are only generated when running configure.   Since running configure correctly in this setup would be a veritable pain, I managed to get what it wanted figured out:
config.h

#define PACKAGE_NAME "pidgin-sipe"
#define PACKAGE_TARNAME "pidgin-sipe"
#define PACKAGE_VERSION "1.12.0"
#define PACKAGE_STRING "pidgin-sipe 1.12.0"
#define PACKAGE_BUGREPORT "https://sourceforge.net/tracker/?atid=949931&group_id=194563"
#define PACKAGE_URL "http://sipe.sourceforge.net/"
#define SIPE_TRANSLATIONS_URL "https://www.transifex.net/projects/p/pidgin-sipe/r/mob/"



Save this as config.h and plop it in src/core and delete the #ifdef HAVE_CONFIG_H stanza in sipe-core.c to allow it to be included.  This will allow sipe_core_about() to compile.

Successful compile.   Yay.

After this I copied libxml2-2.dll and libiconv-2.dll to my pidgin-2.10.0/win32-install-dir directory and src/core/libsipe.dll to the win32-install-dir/plugins directory.   Viola, it worked.

You can download it here win32 libpurple 2.10.0 pidgin-sipe-1.12.0

Thursday, July 7, 2011

moved from livejournal...

Not sure that it requires any explanation (all you have to do is look at livejournal's front page).   


Used google-blog-converters to grab all the posts and convert them to blogger.xml.   Then used the import feature here on the settings tab.   Worked great!

I then promptly deleted my livejournal account.

Monday, April 11, 2011

konsole tabs with dbus in kde4.6

In the continuing automation saga with konsole at my job, KDE has come far enough with the dbus interface in 4.6 to allow me to bring up tabs again and perform actions in them with a script.

For this I created the following shell functions:


# konsole dbus functions
newtab()
{
dbus-send --session --dest=${KONSOLE_DBUS_SERVICE} --type=method_call --print-reply /konsole/MainWindow_1 org.kde.KMainWindow.activateAction string:"new-tab"
}

renametab()
{
sessionno=$1
tabname=$2
session="/Sessions/${sessionno}"
dbus-send --session --dest=${KONSOLE_DBUS_SERVICE} --type=method_call --print-reply ${session} org.kde.konsole.Session.setTabTitleFormat int32:0 string:"$tabname"
dbus-send --session --dest=${KONSOLE_DBUS_SERVICE} --type=method_call --print-reply ${session} org.kde.konsole.Session.setTabTitleFormat int32:1 string:"$tabname"
dbus-send --session --dest=${KONSOLE_DBUS_SERVICE} --type=method_call --print-reply ${session} org.kde.konsole.Session.setTitle int32:1 string:"$tabname"
}

sendtab()
{
sessionno=$1
cmd=$2
session="/Sessions/${sessionno}"
" dbus-send --session --dest=${KONSOLE_DBUS_SERVICE} --type=method_call --print-reply ${session} org.kde.konsole.Session.sendText string:"$cmd
}

closetab()
{
dbus-send --session --dest=${KONSOLE_DBUS_SERVICE} --type=method_call --print-reply ${KONSOLE_DBUS_SESSION} org.kde.konsole.Session.close
}



In scripts that I want automation, I include these functions:


# konsole functions
. ~/bin/kons-fn.sh



I can then open a whole bunch of tabs at once and send them a command:



PORTS=( 2022 2021 )

SESSIONS="
A_FU
B_BAR
"

command="telnet ${CONSOLE_SERVER}"

j=1
index=0
for i in ${SESSIONS}
do
newtab
let index=$j-1
let j=$j+1
renametab $j $i
sendtab $j "${command} ${PORTS[${index}]}"
done

closetab
exit 0



However I haven't gotten this to work from starting 'konsole -script' from a shortcut. Launching a script like this creates an infinite number of tabs launching the script in sequence. Very weird stuff.

For now, just start a konsole session and launch the script within the first tab. As you can deduce from the functions, it has to be the first tab you launch konsole with.

Thursday, December 3, 2009

tbird on FreeBSD

I recently moved to using thunderbird on freebsd and away from pine. I did this mainly because there are just too many oddly formatted html emails floating around work from people who are chained to lookout and don't know any better.

My pine config is still active and available but serves now only as a remote-in, or console bound backup mailer.

The first problem I encountered with t-bird is the helper apps. The list comes up blank from the installed freebsd port and there are no helper apps listed and no way to activate them. This was unlike pine where a url-viewer could be defined. With t-bird I discovered after much web digging if you have Freebsd/KDE/qt without gtk helper infrastructure, you'll need to define the url viewer for firefox. You do this under the advanced config editor, or in prefs.js:


user_pref("network.protocol-handler.app.ftp", "/usr/local/bin/firefox3");
user_pref("network.protocol-handler.app.http", "/usr/local/bin/firefox3");
user_pref("network.protocol-handler.app.https", "/usr/local/bin/firefox3");

For anything else, under pine/alpine you'd be editing your .mailcaprc, but under t-bird you'll need mimeTypes.rdf and Mime Edit. It was ridiculous how hard it was to find this functionality and for a long time I was hand editing the Mimetypes.rdf to add helper apps.

Friday, November 6, 2009

converting

In my ancient post on Scripting up some tabs with konsole in kde was for 3.5 era and dcop. I had a lot of scripts that would just blast open windows in a konsole session, automatically connecting to my various machines in the remote computer lab. Depending on what I was doing, I could just exec a sript from the desktop to connect and use a suite of machines in a tabbed konsole session.

With dbus, and the 4.x kde upgrade I lost all that. Recently I've started trying to convert the old stuff to dbus.

For example, setting tab titles:


$ dbus-send --session --dest=$KONSOLE_DBUS_SERVICE --type=method_call --print-reply /Sessions/35 org.kde.konsole.Session.setTitle int32:1 string:"title"
method return sender=:1.88 -> dest=:1.187 reply_serial=2


It unfortuantely took me a long time to figure this out. One, since dbus-send spits out an incorrect error when the parameters are wrong. Instead of 'incorrect parameter,' you get 'no such method.' This makes sense from a OO standpoint since 'no such method' exists with 'those parameters''



$ dbus-send --session --dest=$KONSOLE_DBUS_SERVICE --type=method_call --print-reply /Sessions/35 org.kde.konsole.Session.setTitle
Error org.freedesktop.DBus.Error.UnknownMethod: No such method 'setTitle' in interface 'org.kde.konsole.Session' at object path '/Sessions/35' (signature '')


dbus-send supports all sorts of types, and from introspection, I knew setTitle needed a int and a string. dbus-send supports all types of things int16, int32, etc..
Without looking at the source, you just kind of have to guess which types to send.


$ qdbus $KONSOLE_DBUS_SERVICE /Sessions/35
method void org.kde.konsole.Session.close()
method QByteArray org.kde.konsole.Session.codec()
method QStringList org.kde.konsole.Session.environment()
method bool org.kde.konsole.Session.flowControlEnabled()
method int org.kde.konsole.Session.foregroundProcessId()
method bool org.kde.konsole.Session.isMonitorActivity()
method bool org.kde.konsole.Session.isMonitorSilence()
method int org.kde.konsole.Session.processId()
method void org.kde.konsole.Session.sendMouseEvent(int buttons, int column, int line, int eventType)
method void org.kde.konsole.Session.sendText(QString text)
method bool org.kde.konsole.Session.setCodec(QByteArray codec)
method void org.kde.konsole.Session.setEnvironment(QStringList environment)
method void org.kde.konsole.Session.setFlowControlEnabled(bool enabled)
method void org.kde.konsole.Session.setMonitorActivity(bool)
method void org.kde.konsole.Session.setMonitorSilence(bool)
method void org.kde.konsole.Session.setMonitorSilenceSeconds(int seconds)
method void org.kde.konsole.Session.setTitle(int role, QString title)
method QString org.kde.konsole.Session.title(int role)
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()


Now onto, auto new tabs, title naming, and finishing the conversion.