<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Days of ... (ideas)</title><link>http://blog.yellowbluebus.com</link><description>Useful technology stuff</description><lastBuildDate>Wed, 03 Jul 2013 12:02:59 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>SOLVED: Save Hudson configs to Subversion. Automatically.</title><link>http://blog.yellowbluebus.com/posts/wordpress20101013solved-save-hudson-configs-to-subversion-automatically.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;I decided to save Hudson configs to Subversion repository just in case something goes wrong with the server later and would need to restore all projects. A bit of googling first, found that there are plugins to to a backup of workplaces and configs. But why would I need to have them? I am on Solaris, so I can create the same by my own hands. Here are my requirements:
&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Backup should be a job within Hudson - since Hudson is a best cron you could find and I already have it&lt;/li&gt;
    &lt;li&gt;Backup should automatically discover added jobs and add then into Subversion - thus I will forget about it forever, no maintenance required&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Simples! So I created a custom build job within Hudson, pointed it to a Subversion location, where I will store backups and backup shell script, which will gather all Hudson configs and deal with Subversion. I told Hudson that I don't want to create subfolder for a project within its workplace. Then I set to execute script this way: &lt;code&gt; ${WORKPLACE}/hudsonbackup.sh &lt;/code&gt;Here is the script itself:&lt;/p&gt;
&lt;p&gt;&lt;code lang="bash[lines]"&gt;#!/bin/bash&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;SRC_FOLDER=${WORKSPACE}&lt;/p&gt;
&lt;p&gt;SVN_PARAMS="--config-dir /.subversion/ --non-interactive --trust-server-cert --username f_tc_ci1 --password &lt;strong&gt;*&lt;/strong&gt;"&lt;/p&gt;
&lt;p&gt;SVN_COMMAND="/opt/csw/bin/svn"&lt;/p&gt;
&lt;p&gt;JOBS=&lt;code&gt;ls -al /.hudson/jobs/|grep -v job1|grep -v job2|awk ' NR&amp;amp;gt;3 {print $9}'&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;CURR_FOLDER=&lt;code&gt;pwd&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;echo "Copying Hudson configs"&lt;/p&gt;
&lt;p&gt;cp /.hudson/*.xml ${SRC_FOLDER}&lt;/p&gt;
&lt;p&gt;echo "Done."&lt;/p&gt;
&lt;p&gt;cd ${SRC_FOLDER}&lt;/p&gt;
&lt;p&gt;echo "Processing Hudson jobs"&lt;/p&gt;
&lt;p&gt;for JOB in ${JOBS}&lt;/p&gt;
&lt;p&gt;do
  echo "Processing ${JOB}"
  if [ ! -e ${JOB} ]
  then
    echo "New job. Creating folder and adding it to SVN"
    mkdir  ${JOB}
    ${SVN_COMMAND} add ${SVN_PARAMS} ${JOB}  &lt;br&gt;
    SVN_COMMENT="${SVN_COMMENT} Added ${JOB}"
  fi  &lt;/p&gt;
&lt;p&gt;echo "Saving ${JOB}/config.xml"
  if [ -e ${JOB}/.svn ]
  then
    if [ -e ${JOB}/config.xml ]
    then
      # config.xml already exist - don't need to add it to subversion
      cp /.hudson/jobs/${JOB}/config.xml ${JOB}/
    else
      echo "New job - new config.xml"
      cp /.hudson/jobs/${JOB}/config.xml ${JOB}/
      ${SVN_COMMAND} add ${SVN_PARAMS} ${JOB}/config.xml
    fi
  else
    echo "Problem creating and adding folder to Subversion"
    exit 1
  fi
done&lt;/p&gt;
&lt;p&gt;echo "Job processing is done. Committing..."&lt;/p&gt;
&lt;p&gt;${SVN_COMMAND} ci ${SVN_PARAMS} -m "Config saved by Hudson. ${SVN_COMMENT}"&lt;/p&gt;
&lt;p&gt;echo "All done."&lt;/p&gt;
&lt;p&gt;Note 1: My Subversion is on HTTPS server with the self-signed certificate, so I have to tell Subversion client to trust it explicitly. Its on line 4. On line 5 I constructed the path to Subversion client because Hudson executing shell scripts with quite limited PATH. Note 2: I need to ignore some jobs, so I added them on line 6. Also on this line I have hardcoded Hudson location ("/.hudson") - it needs to be changed if your Hudson somewhere else. After all that I set this job to execute daily. It works!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20101013solved-save-hudson-configs-to-subversion-automatically.html</guid><pubDate>Wed, 13 Oct 2010 07:51:41 GMT</pubDate></item><item><title>Faces component: Table with subtotals</title><link>http://blog.yellowbluebus.com/posts/wordpress20070309faces-component-table-with-subtotals.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;I tried to search all over the web for a Java Faces component, which will do a simple thing: totals and subtotals. And I failed. It seems that whole web is about how much more AJAX you could put everywhere, not how more useful your product could be for average user.&lt;/p&gt;
&lt;p&gt;It could be done through a facet tag, which is obvious. &lt;/p&gt;
&lt;p&gt;I think about that as competitive advantage for myself. If nobody done it - I should do it and be recognised for it!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20070309faces-component-table-with-subtotals.html</guid><pubDate>Fri, 09 Mar 2007 08:44:11 GMT</pubDate></item><item><title>Microsoft Origami</title><link>http://blog.yellowbluebus.com/posts/wordpress20060225microsoft-origami.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Microsoft has opened a viral marketing site about something called Origami. It was discovered by &lt;a href="http://www.designtastesgood.com/?p=34"&gt;Design Tastes Good&lt;/a&gt;, they sent an email to Scoble with questions and &lt;a href="http://scobleizer.wordpress.com/2006/02/23/what-is-the-origami-project/"&gt;Scoble responded in his snobby manner&lt;/a&gt; "I know everything, but I can't say it to you". And not the hell broke loose. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.engadget.com/2006/02/24/microsofts-origami-project/"&gt;Engadged posted the pictures&lt;/a&gt; of the future gadget, but denying the validity. &lt;a href="http://blog.seattlepi.nwsource.com/microsoft/archives/101676.asp"&gt;Todd Bishop remembered&lt;/a&gt; the Bill Gates' WinHEC speech about new device, and Transmeta's announcement about some agreement with Microsoft.&lt;/p&gt;
&lt;p&gt;I hope that Microsoft will create something really useful and with neat design. What I need in such device is:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It should be small. Preferably fits on one palm&lt;/li&gt;
    &lt;li&gt;It should have keyboard. Even if it has touch screen - I ltype much better, than scribble.&lt;/li&gt;
    &lt;li&gt;USB 2.0 connector/charger&lt;/li&gt;
    &lt;li&gt;Bluetooth and Wifi.&lt;/li&gt;
    &lt;li&gt;If it has IrDA - it's beam must be strong enough, so I can use gadget as remote control&lt;/li&gt;
    &lt;li&gt;No special (iTunes like) software required to connect to device&lt;/li&gt;
&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20060225microsoft-origami.html</guid><pubDate>Sat, 25 Feb 2006 09:50:51 GMT</pubDate></item><item><title>Keeping phone call records</title><link>http://blog.yellowbluebus.com/posts/wordpress20060215keeping-phone-call-records.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;a href="http://www.iwillteachyoutoberich.com/"&gt;Ramit Sethi&lt;/a&gt;  writes &lt;a href="http://www.iwillteachyoutoberich.com/archives/2006/02/use_this_whenev.html"&gt;about capturing and keeping a records&lt;/a&gt; of every calls to customer services and provides an Excel file to do that.
&lt;p&gt;This is wonderful idea. I do some of the call notes in my Moleskine, but never though of having Excel of Word file for this purpose.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20060215keeping-phone-call-records.html</guid><pubDate>Wed, 15 Feb 2006 14:58:08 GMT</pubDate></item></channel></rss>