<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Days of ... (howto)</title><link>http://blog.yellowbluebus.com</link><description>Useful technology stuff</description><lastBuildDate>Wed, 03 Jul 2013 12:03:00 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Revised: Save Hudson/Jenkins settings and installed plugins</title><link>http://blog.yellowbluebus.com/posts/wordpress20130423revised-save-hudsonjenkins-settings-and-installed-plugins.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;
.. code:: bash
 #!/bin/bash
&lt;p&gt;JENKINS_FOLDER="/shared/jenkins"&lt;/p&gt;
&lt;p&gt;DEST_FOLDER="/jenkins-backup"&lt;/p&gt;
&lt;p&gt;if [ ! -d "${DEST_FOLDER}" ]; then
  mkdir -p ${DEST_FOLDER}
fi&lt;/p&gt;
&lt;p&gt;if [ ! -d "${DEST_FOLDER}/jobs" ]; then
  mkdir -p ${DEST_FOLDER}/jobs
fi&lt;/p&gt;
&lt;p&gt;cd ${JENKINS_FOLDER}&lt;/p&gt;
&lt;p&gt;pwd&lt;/p&gt;
&lt;p&gt;/usr/bin/rsync -v -a --relative --checksum ./*.xml ${DEST_FOLDER}&lt;/p&gt;
&lt;p&gt;/usr/bin/rsync -v -a --relative --checksum ./plugins/ ${DEST_FOLDER}/&lt;/p&gt;
&lt;p&gt;cd ${JENKINS_FOLDER}/jobs&lt;/p&gt;
&lt;p&gt;pwd&lt;/p&gt;
&lt;p&gt;find . -maxdepth 2 -name "config.xml" -print0 | /usr/bin/rsync -v -a --relative --checksum --files-from=- --from0 ./ ${DEST_FOLDER}/jobs/&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20130423revised-save-hudsonjenkins-settings-and-installed-plugins.html</guid><pubDate>Tue, 23 Apr 2013 07:42:07 GMT</pubDate></item><item><title>SOLVED: VIM in terminal not rendering backround color properly</title><link>http://blog.yellowbluebus.com/posts/wordpress20130419solved-vim-in-terminal-not-rendering-backround-color-properly.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;a title="The solution in many words." href="http://snk.tuxfamily.org/log/vim-256color-bce.html"&gt;The long worded solution&lt;/a&gt;
&lt;p&gt;TL;DR&lt;/p&gt;
&lt;pre&gt;

if &amp;amp;term =~ '256color'
  set t_ut=
endif

&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20130419solved-vim-in-terminal-not-rendering-backround-color-properly.html</guid><pubDate>Fri, 19 Apr 2013 02:37:23 GMT</pubDate></item><item><title>SOLVED: Apply only security updates in Ubuntu</title><link>http://blog.yellowbluebus.com/posts/wordpress20110710solved-apply-only-security-updates-in-ubuntu.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Sometimes I don't want to update everything on my Ubuntu, but I want to keep it up to date with all patched security holes. At the same time I don't like when updates happen automatically, like &lt;a href="https://help.ubuntu.com/community/AutomaticSecurityUpdates" target="_blank"&gt;Ubuntu documentation suggests&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;This is the way to apply only security fixes:&lt;/p&gt;&lt;p&gt;1. Copy update sources list to a new file&lt;/p&gt;&lt;p&gt;&lt;code lang="bash"&gt;sudo cp /etc/apt/sources.list /etc/apt/security.sources.list&lt;/code&gt;&lt;/p&gt;&lt;p&gt;2. Comment out everything in new file, but leave only security repositories&lt;/p&gt;&lt;p&gt;3. Use following command to apply updates using new file:&lt;/p&gt;&lt;p&gt;&lt;code lang="bash"&gt;sudo apt-get upgrade -o Dir::Etc::SourceList=/etc/apt/security.sources.list&lt;/code&gt;&lt;/p&gt;&lt;p&gt;I created an alias in my .bash_aliases for it:&lt;/p&gt;&lt;p&gt;&lt;code lang="bash"&gt;alias updatesecurity='sudo apt-get upgrade -o Dir::Etc::SourceList=/etc/apt/security.sources.list'&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Now I simply type &lt;code&gt;&lt;u&gt;updatesecurity&lt;/u&gt;&lt;/code&gt; to stay up to date.&lt;/p&gt;&lt;p&gt;I found this solution via &lt;a href="http://serverfault.com/questions/270260/how-do-you-use-apt-get-to-only-install-critical-security-updates-on-ubuntu/282518#282518" target="_blank"&gt;ServerFault.com&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20110710solved-apply-only-security-updates-in-ubuntu.html</guid><pubDate>Sun, 10 Jul 2011 21:07:56 GMT</pubDate></item><item><title>Short list of how-to's for new Linux installation</title><link>http://blog.yellowbluebus.com/posts/wordpress20110626short-list-of-how-tos-for-new-linux-installation.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Install Sun Java:&lt;/p&gt;
&lt;p&gt;&lt;code lang="bash[lines]"&gt;sudo vi /etc/apt/sources.list&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code lang="bash[lines]"&gt;deb http://archive.canonical.com/ubuntu maverick partner&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code lang="bash[lines]"&gt;sudo apt-get update&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;sudo apt-get install sun-java6-jdk&lt;/p&gt;
&lt;p&gt;Install Google Chrome unstable:&lt;/p&gt;
&lt;p&gt;Add this to /etc/apt/sources.list:&lt;/p&gt;
&lt;p&gt;&lt;code lang="bash[lines]"&gt;deb http://dl.google.com/linux/deb/ stable non-free main&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code lang="bash[lines]"&gt;sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub &amp;gt; google.pub&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;sudo apt-key add google.pub &lt;/p&gt;
&lt;p&gt;sudo apt-get update&lt;/p&gt;
&lt;p&gt;sudo apt-get install google-chrome-unstable&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20110626short-list-of-how-tos-for-new-linux-installation.html</guid><pubDate>Sun, 26 Jun 2011 07:10:45 GMT</pubDate></item><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>Recursive Linux "Find Files Containing"</title><link>http://blog.yellowbluebus.com/posts/wordpress20100106recursive-linux-find-files-containing.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;code&gt;find . -name "*.ext" -exec grep -i -H -n "texttofind" {} ;&lt;/code&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20100106recursive-linux-find-files-containing.html</guid><pubDate>Wed, 06 Jan 2010 10:30:35 GMT</pubDate></item><item><title>Problem testing Postfix</title><link>http://blog.yellowbluebus.com/posts/wordpress20091210problem-testing-postfix.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;I am installing Postfix on my unmanaged VPS hosting machine and I am doing it first time ever. I followed the installation manual on Ubuntu site and everything looks all right except one tiny thing: I can’t send email using Telnet. Here is the response:&lt;/p&gt;  &lt;pre&gt;421 4.3.0 collect: Cannot write ./dfnBA9gfVO030273 (bfcommit, uid=0, gid=111): No such file or directory&lt;/pre&gt;
&lt;p&gt;I googled for an answer, but nothing useful came up so I tried to debug the problem myself. By looking into mail logs (/var/log/mail.log, found by examining /etc/syslog.conf) I found following strange response: &lt;/p&gt;

&lt;pre&gt; start postfix/master[15758]: fatal: bind 0.0.0.0 port 25: Address already in use&lt;/pre&gt;

&lt;p&gt;That means only one thing: there is another process listening on this port. Hmm, what could it be? Sendmail, perhaps. I uninstalled it, according to guides I was using, but it was still running.&lt;/p&gt;

&lt;p&gt;It’s time to stop it and start postfix!&lt;/p&gt;

&lt;pre&gt;sudo service sendmail stop



sudo service postfix restart&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Problem solved!&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20091210problem-testing-postfix.html</guid><pubDate>Thu, 10 Dec 2009 10:16:44 GMT</pubDate></item><item><title>Make Home/End/Delete keys work in Solaris bash</title><link>http://blog.yellowbluebus.com/posts/wordpress20090622make-homeend-key-work-in-solaris-bash.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;This is most frustrating thing that I experience when I encounter Solaris bash prompt: the Home, End and Delete keyboard keys will not work because for some reason Solaris doesn’t understand them as useful keys. But there is the way to enable those keys!&lt;/p&gt;  &lt;p&gt;Add following lines to your ~/.bashrc file:&lt;/p&gt;  &lt;p&gt;# home key    &lt;br&gt;bind '"e[1~":beginning-of-line'     &lt;br&gt;# del key     &lt;br&gt;bind '"e[3~":delete-char'     &lt;br&gt;# end key     &lt;br&gt;bind '"e[4~":end-of-line'     &lt;br&gt;# pgup key     &lt;br&gt;bind '"e[5~":history-search-forward'     &lt;br&gt;# pgdn key     &lt;br&gt;bind '"e[6~":history-search-backward'&lt;/p&gt;  &lt;p&gt;Save and source file. Now keys will work as they should.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20090622make-homeend-key-work-in-solaris-bash.html</guid><pubDate>Mon, 22 Jun 2009 16:14:14 GMT</pubDate></item><item><title>VMWare DHCP service wont’start - SOLVED</title><link>http://blog.yellowbluebus.com/posts/wordpress20090508vmware-dhcp-service-wontstart-solved.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;I use VMWare to run a bunch of different Linux VMs on my home PC, which is running Vista SP1. Today I encountered strange thing: Linux VM won’t get an IP address from VMWare DHCP. I’ve opened VMWare Virtual Networks management console (as Administrator, of course, or it won’t let you make and save any changes) just to find out that DHCP service is not started. I tried to start it from there, but it failed to do so.&lt;/p&gt;  &lt;p&gt;So I went to Vista Services console and tried to start “VMWare DHCP service from there”. Again, failed to start with no explanation, even cryptic one. So I went to Windows Events viewer and there, under Windows Logs-System, I found a lot of messages from VMNetDHCP:&lt;/p&gt; &lt;span lang="RU"&gt;   &lt;blockquote&gt;     &lt;p&gt;The description for Event ID 2 from source VMnetDHCP cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.&lt;/p&gt;      &lt;p&gt;If the event originated on another computer, the display information had to be saved with the event.&lt;/p&gt;      &lt;p&gt;The following information was included with the event: &lt;/p&gt;      &lt;p&gt;Can't open C:ProgramDataVMwarevmnetdhcp.conf: Access is denied.&lt;/p&gt;      &lt;p&gt;/ The data is invalid&lt;/p&gt;      &lt;p&gt;the message resource is present but the message is not found in the string/message table&lt;/p&gt;   &lt;/blockquote&gt;    &lt;p&gt;Though the message says that the message is not found, it has enough information to fix the problem. &lt;/p&gt; So, I’ve taken a look at the security properties for C:ProgramDataVMWare folder and found that SYSTEM account somehow is not in a list of permitted users. The only account, who was permitted to access that folder, was my Windows user account. So I added SYSTEM account with all permissions to this folder, waited when Windows propagated my change to all files and tried to start VMWare DHCP service again. It worked!&lt;/span&gt;  &lt;p&gt;Then I simply restarted network within Linux VM (sudo /etc/init.d/networking restart) and got back to work.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20090508vmware-dhcp-service-wontstart-solved.html</guid><pubDate>Fri, 08 May 2009 12:43:22 GMT</pubDate></item><item><title>JBOSS Seam 2.1.1GA on JBOSS AS 5.0.1GA: Table is not mapped</title><link>http://blog.yellowbluebus.com/posts/wordpress20090507jboss-seam-211ga-on-jboss-as-501ga-table-is-not-mapped.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;I created sample JBOSS Seam project in Eclipse and decided to generate entity code from  existing database. It worked fine, but when I try to run it, it shows me that Hibernade is not able to map entity beans to the corresponding tables. The error message is like this:&lt;/p&gt;  &lt;p&gt;&lt;span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 13px arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="border-collapse: collapse; font-family: arial; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px" class="Apple-style-span"&gt;org.hibernate.hql.ast.QuerySyntaxException: &amp;lt;your table&amp;gt; is not mapped&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;I spent around three hours trying to read all available information on it, but most of it just useless – it looks like people don’t know whats happening, so they recommend bizarre tricks. Like, for example, having empry seam.settings file in each folder, meh.&lt;/p&gt;  &lt;p&gt;Finally, I found the solution in Seam Jira: &lt;a href="https://jira.jboss.org/jira/browse/JBSEAM-3821"&gt;&lt;u&gt;&lt;font color="#0066cc"&gt;https://jira.jboss.org/jira/browse/JBSEAM-3821&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;They rocemmend to to force Hibernate to use Seam’s EntityManager by changing two files:&lt;/p&gt;    &lt;p&gt;1. components.xml&lt;/p&gt; &lt;blockquote&gt;     &lt;br&gt;    &amp;lt;persistence:entity-manager-factory name="bookingDatabase" installed="false"/&amp;gt;      &lt;br&gt;    &amp;lt;!-- If Seam loads the persistence unit (JBoss 4.x), the EntityManagerFactory will be resolved from #{bookingDatabase}.      &lt;br&gt;         On JBoss AS 5, the EntityManagerFactory is retrieved from JNDI (the binding occurs during application deployment). --&amp;gt;      &lt;br&gt;    &amp;lt;persistence:managed-persistence-context name="em" auto-create="true"      &lt;br&gt;       entity-manager-factory="#{bookingDatabase}" persistence-unit-jndi-name="java:/bookingEntityManagerFactory"/&amp;gt; &lt;/blockquote&gt;    &lt;p&gt;2. persistence.xml&lt;/p&gt; &lt;blockquote&gt;     &lt;br&gt; &amp;lt;!-- Binds the EntityManagerFactory to JNDI where Seam can look it up.      &lt;br&gt;              This is only relevant when the container automatically loads the persistence unit, as is the case in JBoss AS 5. --&amp;gt;      &lt;br&gt;         &amp;lt;property name="jboss.entity.manager.factory.jndi.name" value="java:/bookingEntityManagerFactory"/&amp;gt; &lt;/blockquote&gt;    &lt;p&gt;Hope that Google will find that page and the proper solution would be much more easily found!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://blog.yellowbluebus.com/posts/wordpress20090507jboss-seam-211ga-on-jboss-as-501ga-table-is-not-mapped.html</guid><pubDate>Thu, 07 May 2009 18:37:46 GMT</pubDate></item></channel></rss>