<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6426783599253857495</id><updated>2012-01-27T05:03:01.714-08:00</updated><category term='dual core'/><category term='9.04'/><category term='logging'/><category term='python glade application'/><category term='flash'/><category term='gpg'/><category term='beast-0.7.1'/><category term='postgresql'/><category term='development'/><category term='freenx'/><category term='reverse tethering'/><category term='web based configuration'/><category term='studio 1558'/><category term='VAC'/><category term='upgrade'/><category term='x windows'/><category term='compression proxy'/><category term='fan speed problem arch linux'/><category term='gutsy gibon'/><category term='mozilla calendar'/><category term='VPN'/><category term='SVN repository merge'/><category term='epkg'/><category term='apt-cacher'/><category term='programmatic configuration'/><category term='Windows automatic proxy authentication NTLM'/><category term='knowledge tree install guide'/><category term='jaunty'/><category term='compiere'/><category term='linux and windows'/><category term='mac address of a machine'/><category term='Automated FTP'/><category term='seti'/><category term='PPTP with wicd'/><category term='java'/><category term='svn command line'/><category term='authentication'/><category term='including external jars'/><category term='ntfs'/><category term='Xorg'/><category term='webdav'/><category term='Moving mouse with keyboard'/><category term='glade tutorial'/><category term='selective backup'/><category term='nxclient'/><category term='linux from scratch'/><category term='ziproxy'/><category term='django'/><category term='apt cache'/><category term='USB'/><category term='display problems'/><category term='broadcast address'/><category term='asterisk'/><category term='parallels'/><category term='svn msn messages'/><category term='code repository'/><category term='drivers'/><category term='speed up internet connection'/><category term='unique url'/><category term='64bit linux installs'/><category term='remote desktop'/><category term='mp3'/><category term='table modification'/><category term='init-d template'/><category term='ubuntu'/><category term='mac address'/><category term='free vpn'/><category term='you tube'/><category term='nvidia'/><category term='json'/><category term='startup script'/><category term='dbus error'/><category term='VPN through firewall'/><category term='dom'/><category term='java connection pooling'/><category term='creating xml document'/><category term='write support'/><category term='tomcat'/><category term='dump'/><category term='jackaudio.org'/><category term='project manager'/><category term='gradle'/><category term='installing java'/><category term='sound'/><category term='9.1'/><category term='virtual machine'/><category term='encap'/><category term='drop box'/><category term='startup template'/><category term='runit'/><category term='fedora 6 upgrade'/><category term='unique file access'/><category term='9.0'/><category term='general linux applications'/><category term='svn verify bash script'/><category term='login'/><category term='Google Web Toolkit'/><category term='streaming sql database dump'/><category term='switch vpn'/><category term='Locales ubuntu apt error'/><category term='unique url http file access'/><category term='ssh'/><category term='automatic source list updater'/><category term='linksys WRT56G'/><category term='revert'/><category term='smartbootmanager'/><category term='Arch Linux'/><category term='remote to local database dump'/><category term='glade'/><category term='joomla install guide'/><category term='plain'/><category term='unique url http access'/><category term='automatic ssh authentication'/><category term='FTP linux'/><category term='Java on VPS'/><category term='public directory'/><category term='xubuntu'/><category term='limit table size'/><category term='linux vpn'/><category term='samba'/><category term='ip address'/><category term='dar'/><category term='Netbeans 7.01'/><category term='install'/><category term='mac to ip'/><category term='hamchi'/><category term='arch laptop'/><category term='installation'/><category term='trac adminstration'/><category term='PPTP'/><category term='mounting dd image'/><category term='network bridging'/><category term='knowledge tree'/><category term='gwt'/><category term='sharing files over unique url'/><category term='burning'/><category term='settings'/><category term='open source'/><category term='sunbird'/><category term='windows and linux encryption'/><category term='LFS'/><category term='Dar backup script'/><category term='trac project updater'/><category term='ubuntu boot floppy'/><category term='dell'/><category term='firefox'/><category term='fedora 7'/><category term='phppgadmin setup'/><category term='automated build'/><category term='anonymous  file sharing'/><category term='gaim'/><category term='anonymous file access'/><category term='svn msn message'/><category term='org.w3c.dom'/><category term='piping'/><category term='recording from soundcard'/><category term='ssh port fowarding'/><category term='how to get ip address'/><category term='kismet'/><category term='laptop'/><category term='bittorrent'/><category term='xml'/><category term='byte[] to string'/><category term='svn msn notifier'/><category term='mac address to byte[]'/><category term='netbeans 5.5'/><category term='screen resolution'/><category term='mysql'/><category term='vmware'/><category term='browsable directory'/><category term='Arch Linux 64 bit installation'/><category term='passwordless authentcation'/><category term='stream data'/><category term='coloured jbutton'/><category term='XJSONDataSource'/><category term='tomcat socket exception'/><category term='sendmail'/><category term='source list script'/><category term='trac'/><category term='apache tomcat ssl'/><category term='ubuntu boot from floppy disk'/><category term='intel'/><category term='Integrating Tomcat with Apache'/><category term='netear wg111v2'/><category term='android internet connection'/><category term='remote connection'/><category term='ssl'/><category term='virtual box'/><category term='apache ssl'/><category term='E1750 mobile broadband'/><category term='remote monitoring'/><category term='svn add'/><category term='share internet connection with phone'/><category term='mac address to ip address'/><category term='Redmine'/><category term='Teila'/><category term='divx'/><category term='tomcat ssl'/><category term='mysql java AccessControlException'/><category term='wireless router'/><category term='authenticated get request'/><category term='SmartGWt'/><category term='joomla'/><category term='apache put access'/><category term='verify svn repository'/><category term='stress testing'/><category term='google talk'/><category term='sip'/><category term='recursive backup'/><category term='cdrecord'/><category term='manual setup'/><category term='command line applications'/><category term='Gentoo'/><category term='controlling mouse with keyboard'/><category term='non-login file sharing'/><category term='tinc'/><category term='scm manager'/><category term='cms'/><category term='python'/><category term='linux on a ipaq rx3715'/><category term='cd rom'/><category term='logback'/><category term='burn iso command line linux'/><category term='svn errors'/><category term='incremental backup'/><category term='send msn message on svn commit'/><category term='free online storage'/><category term='Forwarding Apache to Tomcat'/><category term='msn svn commit notification'/><category term='database'/><category term='operating system'/><category term='ubuntu startup services'/><category term='linux'/><category term='cygwin'/><category term='full installation'/><category term='manual configuration'/><category term='php'/><category term='programming'/><category term='wireless on toshiba L510'/><category term='Fedora 6 64bit'/><category term='auto increment'/><category term='mod-jk'/><category term='Tomcat 5.5'/><category term='remote x windows'/><category term='core2 duo'/><category term='ssh automatic login'/><category term='8192 ubuntu wireless driver'/><category term='psql delete oldest rows function'/><category term='command line'/><category term='mod-proxy'/><category term='automatic table size limit postgres'/><title type='text'>Linux, Java &amp; Open Source</title><subtitle type='html'>Yet Another blog about GNU Linux, Java, and various open source projects.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>94</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-8391204094403673672</id><published>2012-01-27T00:10:00.000-08:00</published><updated>2012-01-27T00:15:44.199-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='manual configuration'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='manual setup'/><category scheme='http://www.blogger.com/atom/ns#' term='logging'/><category scheme='http://www.blogger.com/atom/ns#' term='programmatic configuration'/><category scheme='http://www.blogger.com/atom/ns#' term='logback'/><title type='text'>Manual Logback Configuration</title><content type='html'>Programmatic configuration of Logback&amp;nbsp;is really simple, when you know how. I'm not sure why they&amp;nbsp;don't&amp;nbsp;have more examples like this in the manual, because in some&amp;nbsp;situations, its really important that logs don't get lost even if a configuration file isn't found (particularly&amp;nbsp;when STDOUT goes nowhere). Anyway, here's one for you to get you started.&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;ch.qos.logback.classic.Logger&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;ch.qos.logback.classic.LoggerContext&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;ch.qos.logback.classic.encoder.PatternLayoutEncoder&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;ch.qos.logback.classic.spi.ILoggingEvent&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;ch.qos.logback.core.FileAppender&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;FileAppender&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ILoggingEvent&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; fa &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;FileAppender&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ILoggingEvent&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;();&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setName&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"file"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setFile&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"mylog.log"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;LoggerContext&lt;/span&gt; con &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;LoggerContext&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="n"&gt;LoggerFactory&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getILoggerFactory&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;PatternLayoutEncoder&lt;/span&gt; &lt;span class="n"&gt;pl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;PatternLayoutEncoder&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;pl&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setContext&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;con&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;pl&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setPattern&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d %5p %t [%c:%L] %m%n)"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;pl&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;fileAppender&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setEncoder&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pl&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;fileAppender&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;Logger&lt;/span&gt; &lt;span class="n"&gt;rootLogger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;con&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getLogger&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Logger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ROOT_LOGGER_NAME&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;rootLogger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addAppender&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fa&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="o"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="o"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-8391204094403673672?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/8391204094403673672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=8391204094403673672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8391204094403673672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8391204094403673672'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2012/01/manual-logback-configuration.html' title='Manual Logback Configuration'/><author><name>Benjamin Leov</name><uri>https://profiles.google.com/101353496905973038699</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-DWnDFB5ihhM/AAAAAAAAAAI/AAAAAAAAAaM/0H5qGaCMNeo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-8291264281463896009</id><published>2011-11-30T00:05:00.001-08:00</published><updated>2011-12-15T08:15:06.196-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='code repository'/><category scheme='http://www.blogger.com/atom/ns#' term='scm manager'/><category scheme='http://www.blogger.com/atom/ns#' term='web based configuration'/><title type='text'>Open source repository manager</title><content type='html'>&lt;br /&gt;Looking for a open source, web based, code repository manager? Sick of having to ssh into the code server to configure new repositories? Try this out:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.scm-manager.org/"&gt;http://www.scm-manager.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Its easy to setup, supports git, svn, bzr, hg, and it works on both Windows and Linux. No need to edit configuration files; everything can be done via the web interface.&lt;br /&gt; &lt;br /&gt;It has a plug-in framework, (and you can install them completely within the interface) which extend its functionality which includes integration with continuous build systems (such as Bamboo and Jenkins), and support for LDAP authentication.&lt;br /&gt;&lt;br /&gt;I would love to see this project take off, so get behind it, if you can.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-8291264281463896009?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/8291264281463896009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=8291264281463896009' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8291264281463896009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8291264281463896009'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2011/11/open-source-repository-manager.html' title='Open source repository manager'/><author><name>Benjamin Leov</name><uri>https://profiles.google.com/101353496905973038699</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-DWnDFB5ihhM/AAAAAAAAAAI/AAAAAAAAAaM/0H5qGaCMNeo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-7171349035668037330</id><published>2011-11-24T23:31:00.001-08:00</published><updated>2011-11-24T23:43:38.692-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows automatic proxy authentication NTLM'/><title type='text'>Auto authenticating proxy - Windows</title><content type='html'>If your running Windows applications that either don't support Windows (NTLM) proxy authentication, or don't support it well, it can be difficult to connect them to the internet in a&amp;nbsp;corporate&amp;nbsp;environment. Often the effort in making changes to a firewall (if indeed it's possible) outweighs the&amp;nbsp;benefits&amp;nbsp;of using the application.&lt;br /&gt;&lt;br /&gt;I found myself in this position, and spent a while looking for a local proxy that would automatically authenticate connections from localhost to the internet. After some hours of searching, I came across this:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ntlmaps.sourceforge.net/"&gt;http://ntlmaps.sourceforge.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Which did the trick! This also has an added&amp;nbsp;benefit&amp;nbsp;of keeping all your authentication details in once place. Unfortunately it stores the password in an un-encrypted configuration file, but it does have an option to leave it blank so you can enter it once when the application starts.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-7171349035668037330?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/7171349035668037330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=7171349035668037330' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7171349035668037330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7171349035668037330'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2011/11/auto-authenticated-proxy.html' title='Auto authenticating proxy - Windows'/><author><name>Benjamin Leov</name><uri>https://profiles.google.com/101353496905973038699</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-DWnDFB5ihhM/AAAAAAAAAAI/AAAAAAAAAaM/0H5qGaCMNeo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-3771314224140185885</id><published>2011-10-02T02:46:00.000-07:00</published><updated>2011-12-15T07:55:04.893-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='9.0'/><category scheme='http://www.blogger.com/atom/ns#' term='upgrade'/><category scheme='http://www.blogger.com/atom/ns#' term='postgresql'/><category scheme='http://www.blogger.com/atom/ns#' term='9.1'/><title type='text'>Postgres 9.0 to 9.1 upgrade - Gentoo</title><content type='html'>If your running a virtual machine, with an automatic upgrade script you may find you need up upgrade your data to work with 9.1, and that the old version has been removed. To do the upgrade you need both version installed. &lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First step, install the old version of 9.0, if its not already there. You can check via:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;eselect postgresql  list&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Check /var/lib/postgres, and see if the 9.0 data directory exists. Before doing anything else, make a copy this folder to a safe place, so you can revert if required.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If eselect didn't come up with any 9.0 version, install it using this.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;emerge =dev-db/postgresql-server-9.0.5&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Try and start 9.05, and make sure there are no errors. I found I had to move some configuration files around, and change some permissions, but the errors were very explicit and easy to solve.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, copy 9.0's configuration files.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;cp -R /etc/postgresql-9.0/* /etc/postgresql-9.1/&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Next step, create a blank 9.1 database in /var/lib/postgresql/9.1/data&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;su postgres&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;initdb91 /var/lib/postgresql/9.1/data&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Make sure 9.1 can start.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;/etc/init.d/postgresql-9.1 start&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Stop it again, and your ready to run the conversion. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;su postgres&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;pg_upgrade91 -v --old-datadir=/var/lib/postgresql/9.0/data/ --new-datadir=/var/lib/postgresql/9.1/data --old-bindir=/usr/lib/postgresql-9.0/bin/ --new-bindir=/usr/lib/postgresql-9.1/bin/&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;If this completes, start 9.1. You can run it using the init.d script, but I found I had an error which was not going to the logs. You can debug it by running pg_ctrl directly, which will print any errors to the screen. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;code&gt;su -l postgres -c 'env PGPORT="5432"  /usr/lib/postgresql-9.1/bin/pg_ctl start -w -t 60 -s -D /var/lib/postgresql/9.1/data -o '\''-D /etc/postgresql-9.1/ --data-directory=/var/lib/postgresql/9.1/data'\'''&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;If everything is fine, your data migration should be complete, and all thats left to do is tidy up by removing 9.0's binary and the old data. i.e&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;emerge --unmerge dev-db/postgresql-server-9.0.3&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-3771314224140185885?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/3771314224140185885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=3771314224140185885' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3771314224140185885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3771314224140185885'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2011/10/postgres-90-to-91-upgrade-gentoo.html' title='Postgres 9.0 to 9.1 upgrade - Gentoo'/><author><name>Benjamin Leov</name><uri>https://profiles.google.com/101353496905973038699</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-DWnDFB5ihhM/AAAAAAAAAAI/AAAAAAAAAaM/0H5qGaCMNeo/s512-c/photo.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-3545816578441127025</id><published>2011-08-28T01:59:00.000-07:00</published><updated>2011-08-28T02:37:20.740-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Redmine'/><category scheme='http://www.blogger.com/atom/ns#' term='project manager'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch Linux'/><title type='text'>Redmine on Arch Linux</title><content type='html'>&lt;div&gt;Installing redmine seems a bit "clunky" to me, but thats probably because I've never used ruby jems before. I've put down steps involved in getting it working, in an NON-PRODUCTION enviroment (I.e not secure, just quick and dirty to get it running fast). This worked with release 1.2.1, and it installs mysql, but redmine works off other databases too, so modify to your needs.&lt;/div&gt;&lt;div&gt;First up, install all the prerequisits.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;pacman -S rubygems&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;gem install -v=0.4.2 i18n&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;gem install rack -v=1.1.0&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;pacman -S mysql&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;/etc/rc.d/mysqld start&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;/usr/bin/mysqladmin -u root password 'root'&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;code&gt;pacman -S make&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;gem install mysql&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Download and unpack the release. All the configuration files are in ./config/, so you need to go there next. We just change a few things in the example configs, so move them into place.&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;mv database.yml.example database.yml&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;mv configuration.yml.example configuration.yml&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Edit database.yml, and change the top to this.&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;production:&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;  adapter: mysql&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;  database: redmine&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;  host: localhost&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;  username: root&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;  password: root&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;  encoding: utf8&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Next, you have to edit the environment.rb file. Within the &lt;b&gt;Rails::Initializer.run do |config|&lt;/b&gt; section,&lt;/div&gt;&lt;div&gt;add this line:&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;    config.action_controller.session = { :key =&amp;gt; "_myapp_session", :secret =&amp;gt; "$t =&amp;gt;"ee7f29f2bb6f5006ff0674b7838e5dd7" }&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally, populate the database.&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;RAILS_ENV=production rake db:migrate&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;RAILS_ENV=production rake redmine:load_default_data&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And now your ready to go. Start the server and browse to http://localhost:30003&lt;/div&gt;&lt;div&gt;The default login is admin/admin.&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;script/server -e production&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-3545816578441127025?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/3545816578441127025/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=3545816578441127025' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3545816578441127025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3545816578441127025'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2011/08/redmine-on-arch-linux.html' title='Redmine on Arch Linux'/><author><name>Benjamin Leov</name><uri>https://profiles.google.com/101353496905973038699</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-DWnDFB5ihhM/AAAAAAAAAAI/AAAAAAAAAaM/0H5qGaCMNeo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-8185348554076745096</id><published>2011-08-03T02:34:00.001-07:00</published><updated>2011-08-03T02:40:08.615-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Netbeans 7.01'/><category scheme='http://www.blogger.com/atom/ns#' term='dbus error'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch Linux'/><title type='text'>Netbeans 7.01 Startup Error</title><content type='html'>I've come across a dbus error while starting Netbeans.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;code&gt;arguments to dbus_message_iter_append_basic() were incorrect, assertion "*bool_p == 0 || *bool_p == 1" failed in file dbus-message.c line 2541.&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;code&gt;This is normally a bug in some application using the D-Bus library.&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;  D-Bus not built with -rdynamic so unable to print a backtrace&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;/usr/share/netbeans/bin/../platform/lib/nbexec: line 548:  2593 Aborted &lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This was running Java 7, and Netbeans 7.01. I found the answer here:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="https://bbs.archlinux.org/viewtopic.php?pid=939873"&gt;https://bbs.archlinux.org/viewtopic.php?pid=939873&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This states that appending this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;-J-Dnetbeans.keyring.no.native=true&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;to netbeans_default_options in  netbeans.conf (in /usr/share/netbeans/etc using Arch Linux), will fix the problem; and it does!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-8185348554076745096?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/8185348554076745096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=8185348554076745096' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8185348554076745096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8185348554076745096'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2011/08/netbeans-701-startup-error.html' title='Netbeans 7.01 Startup Error'/><author><name>Benjamin Leov</name><uri>https://profiles.google.com/101353496905973038699</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-DWnDFB5ihhM/AAAAAAAAAAI/AAAAAAAAAaM/0H5qGaCMNeo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5911461484202782401</id><published>2011-07-22T12:33:00.000-07:00</published><updated>2011-07-22T12:56:05.657-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><category scheme='http://www.blogger.com/atom/ns#' term='jackaudio.org'/><category scheme='http://www.blogger.com/atom/ns#' term='recording from soundcard'/><category scheme='http://www.blogger.com/atom/ns#' term='linux and windows'/><category scheme='http://www.blogger.com/atom/ns#' term='VAC'/><title type='text'>Virtual Audio Cable - Linux and Windows</title><content type='html'>If your looking for a virtual audio cable (VAC), thats free, open source and works on Linux, Windows and OSX check out &lt;a href="http://jackaudio.org/"&gt;jackaudio&lt;/a&gt;. For some reason this neat bit of software doesn't get nearly the attention it deserves and despite what you'll read out on the net, its most definitely &lt;b&gt;does &lt;/b&gt;work on Windows (even Windows 7, 64 bit). Its really simple to use, just:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Install it.&lt;/div&gt;&lt;div&gt;Start Jack Control  (will come up in your list of programs after the install).&lt;/div&gt;&lt;div&gt;Go into the settings, and select "portaudio" as the driver.&lt;/div&gt;&lt;div&gt;Start Jack Port Audio.&lt;/div&gt;&lt;div&gt;Restart Jack control.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you right click on the sound control icon (on the far right of your task bar), and select recording devices, you should see a new device called "Rec. Playback".   You can record from this device and it will capture the sound from your sound card. (Note you have to set it to the "default" recording device if your just using the standard windows recorder). If you need any fancy routing, you can specify what you want where in the "Connect" screen within Jack Control.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Theres ALOT of other options, none of which I've played with but for just recording your soundcard output to a file this will do the job well.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5911461484202782401?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5911461484202782401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5911461484202782401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5911461484202782401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5911461484202782401'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2011/07/virtual-audio-cable-linux-and-windows.html' title='Virtual Audio Cable - Linux and Windows'/><author><name>Benjamin Leov</name><uri>https://profiles.google.com/101353496905973038699</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-DWnDFB5ihhM/AAAAAAAAAAI/AAAAAAAAAaM/0H5qGaCMNeo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-362534201499092647</id><published>2011-06-01T00:56:00.000-07:00</published><updated>2011-06-01T01:26:17.004-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='byte[] to string'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='android internet connection'/><category scheme='http://www.blogger.com/atom/ns#' term='mac address to byte[]'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Mac Address String to byte[]</title><content type='html'>The Android SDK returns a String mac address, while the Java SDK returns a byte array. This makes it somewhat difficult to compare the two.&lt;br /&gt;&lt;br /&gt;Android:&lt;br /&gt;&lt;pre&gt;WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE);&lt;br /&gt;WifiInfo info = manager.getConnectionInfo();&lt;br /&gt;String address = info.getMacAddress());&lt;br /&gt;&lt;/pre&gt;Java SDK&lt;br /&gt;&lt;pre&gt;InetAddress inet = InetAddress.getLocalHost();&lt;br /&gt;NetworkInterface ni = NetworkInterface.getByInetAddress(inet);&lt;br /&gt;byte[] address = ni.getHardwareAddress();&lt;br /&gt;&lt;/pre&gt;The code below illustrates how to convert the string returned by Android, into a byte[].&lt;br /&gt;&lt;pre&gt;public static byte[] parseMacAddress(String macAddress)&lt;br /&gt;    {&lt;br /&gt;        String[] bytes = macAddress.split(":");&lt;br /&gt;        byte[] parsed = new byte[bytes.length];&lt;br /&gt;&lt;br /&gt;        for (int x = 0; x &lt; bytes.length; x++)&lt;br /&gt;        {&lt;br /&gt;            BigInteger temp = new BigInteger(bytes[x], 16);&lt;br /&gt;            byte[] raw = temp.toByteArray();&lt;br /&gt;            parsed[x] = raw[raw.length - 1];&lt;br /&gt;        }&lt;br /&gt;        return parsed;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-362534201499092647?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/362534201499092647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=362534201499092647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/362534201499092647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/362534201499092647'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2011/06/mac-address-string-to-byte.html' title='Mac Address String to byte[]'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-2607376214962365292</id><published>2011-05-29T11:21:00.000-07:00</published><updated>2011-06-01T01:02:07.828-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='json'/><title type='text'>Django and processing JSON</title><content type='html'>Django ships with the JSON processing library simplejson. Although there is talk that it may be removed in the future, I see no disadvantage in using it; if it is removed then just install it manually. &lt;br /&gt;&lt;br /&gt;This tutorial will explain how to create a form that allows the user to upload a file, then processes the json contained within it.&lt;br /&gt;&lt;br /&gt;First, define your model (models.py)&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;br /&gt;        &lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FileField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;upload_to&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;tmp&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;br /&gt; &lt;br /&gt;        &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__unicode__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;br /&gt;                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt; &lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Then define the form (forms.py)&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ImportForm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;forms&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;br /&gt; &lt;br /&gt; &lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="n"&gt;forms&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FileField&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;br /&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Meta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;br /&gt;  &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ImportModel&lt;/span&gt; &lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Create your template, &lt;b&gt;making sure&lt;/b&gt; you include enctype="multipart/form-data" in your html form declaration.&lt;br /&gt;&lt;br /&gt;Now, the actual processing of the file goes into your form's view.&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="c"&gt;# other standard django imports here..&lt;/span&gt; &lt;br /&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.utils&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;simplejson&lt;/span&gt; &lt;br /&gt; &lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;import_form&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;POST&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;br /&gt;        &lt;span class="n"&gt;form&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ImportForm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FILES&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;br /&gt;        &lt;br /&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;is_valid&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;br /&gt;            &lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FILES&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;file&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="c"&gt;# get reference to the file here&lt;/span&gt; &lt;br /&gt;            &lt;span class="n"&gt;my_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;simplejson&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;br /&gt;            &lt;br /&gt;            &lt;span class="c"&gt;# now you can process &lt;/span&gt; &lt;br /&gt;            &lt;span class="n"&gt;items&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="n"&gt;my_data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;items&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;br /&gt; &lt;br /&gt;            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;br /&gt;                &lt;span class="c"&gt;# do your processing here...&lt;/span&gt; &lt;br /&gt;                &lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;item is: &amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;attribute&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;br /&gt; &lt;br /&gt;            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;HttpResponseRedirect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;/somewhere&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;br /&gt;        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;br /&gt;            &lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;form invalid!&amp;quot;&lt;/span&gt; &lt;br /&gt;    &lt;br /&gt;    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;br /&gt;        &lt;span class="n"&gt;form&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ImportForm&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;br /&gt;            &lt;br /&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;render_to_response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;your_template.html&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;form&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="n"&gt;context_instance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;RequestContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-2607376214962365292?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/2607376214962365292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=2607376214962365292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2607376214962365292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2607376214962365292'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2011/05/django-and-processing-json-file.html' title='Django and processing JSON'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-7033844565210028561</id><published>2011-04-06T00:24:00.000-07:00</published><updated>2011-06-01T00:59:08.557-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fan speed problem arch linux'/><category scheme='http://www.blogger.com/atom/ns#' term='installation'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch Linux'/><title type='text'>Arch Linux DELL Studio 1558 Notebook Video card problems</title><content type='html'>I was having problems with the fan going really fast all the time (at max speed) with my laptop, after switching from the propriety ATI graphics card driver to the open source one. The only reason I switched was because an update caused the propriety one to die, and I couldn't get it back again. &lt;br /&gt;&lt;br /&gt;This problem is especially bad for laptops, when running on battery. The card this laptop has is:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;02:00.0 VGA compatible controller: ATI Technologies Inc Manhattan [Mobility Radeon HD 5000 Series]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Anyway, long story short, with the open source driver (at least), you need to enable KMS. Its enabled via a kernel option in your boot loader (radeon.modeset=1), by adding the radeon module in /etc/rc.conf on the MODULES line. A complete explanation is here:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://wiki.archlinux.org/index.php/ATI#Enabling_KMS"&gt;https://wiki.archlinux.org/index.php/ATI#Enabling_KMS&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After you have done that, you can then specify the profiles, which is stated here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.overclock.net/9332962-post1.html"&gt;http://www.overclock.net/9332962-post1.html&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-7033844565210028561?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/7033844565210028561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=7033844565210028561' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7033844565210028561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7033844565210028561'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2011/04/arch-linux-dell-studio-1558-notebook.html' title='Arch Linux DELL Studio 1558 Notebook Video card problems'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-7630360574351463267</id><published>2011-02-25T02:21:00.001-08:00</published><updated>2011-06-01T00:59:31.824-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sip'/><category scheme='http://www.blogger.com/atom/ns#' term='stress testing'/><category scheme='http://www.blogger.com/atom/ns#' term='asterisk'/><title type='text'>Stress testing Asterisk with Sipp</title><content type='html'>Firstly, I had problems with running &lt;a href="http://sipp.sourceforge.net/"&gt;sipp&lt;/a&gt; in client mode from Ubuntu 10.10. The UDP packets were leaving my machine, but never gettting to the remote machine. I have no idea why, but I suggest you build sipp from scrach (its pretty easy), and use that.&lt;br /&gt;&lt;br /&gt;There is heaps of documentation on sipp's website, but it assumes you have a decent knowledge of sip, in which case you probably won't be reading this anyway.&lt;br /&gt;&lt;br /&gt;For a start, you need to understand that sipp can run in a client and server mode. This means, it can act as caller, or a reciever of calls. Thus, in order for you to be able to record statistics, you need to setup your asterisk box so there is a loop; the client creates calls, which end calling the server. Both the client and server display statistics about the calls being made, and from that you can see how your box is handling it.&lt;br /&gt;&lt;br /&gt;To setup asterisk, you need to edit the sip.conf and extensions.conf. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;------------ sip.conf --------------&lt;br /&gt;&lt;br /&gt;[sippuac]&lt;br /&gt;type=friend&lt;br /&gt;username=sippuac&lt;br /&gt;host=&lt;wherever SIP UAC IS RUNNING&gt;&lt;br /&gt;port=5060&lt;br /&gt;context=default&lt;br /&gt;dtmfmode=rfc2833&lt;br /&gt;insecure=very&lt;br /&gt;canreinvite=no&lt;br /&gt;nat=yes&lt;br /&gt;&lt;br /&gt;[sippuas]&lt;br /&gt;type=friend&lt;br /&gt;username=sippuas&lt;br /&gt;host=&lt;wherever SIP UAS IS RUNNING&gt;&lt;br /&gt;port=5061&lt;br /&gt;context=default&lt;br /&gt;dtmfmode=rfc2833&lt;br /&gt;insecure=very&lt;br /&gt;canreinvite=no&lt;br /&gt;nat=yes&lt;br /&gt;------------ sip.conf --------------&lt;br /&gt;&lt;/pre&gt;There are two extensions setup in this example, one is for client(sippuac), and one is outbound to the server(sippuas). The client will connect on the default sip port 5060 in this example, and the server connection will be made to 5061. I have disabled security in this example just to make things simple, as thats all the default senario can handle. You need to change the host for each to wherever each sipp client and server is running. You cannot set the host to dynamic, as asterisk needs to make the connection (I could be wrong here, but dynamic did not work for me).&lt;br /&gt;&lt;br /&gt;Next is extensions.conf. &lt;br /&gt;&lt;pre&gt;---------- extensions.conf ---------&lt;br /&gt;&lt;br /&gt;[default]&lt;br /&gt;exten=&gt;testing,1,Dial(SIP/sippuas,20)&lt;br /&gt;---------- extensions.conf ---------&lt;br /&gt;&lt;/pre&gt;In the default context I put an extension called "testing", which then calls the server. Reload asterisks using the cli, so all we have to do is setup sipp to call this extension, and listen using sippuas. &lt;br /&gt;&lt;br /&gt;To run sipp in server mode, you need to specify something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sipp -sn uas -p 5061&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The -sn flag specifies a seneriao. UAS is a built in scenario, which just receives a call and hangs up. the -p flag is the UDP port that it will listen for incoming calls on (this port must match whats in sippuas).&lt;br /&gt;&lt;br /&gt;To run sipp in client mode, you need to specify something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sipp -sn uac 127.0.0.1 -s testing&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The scenario uac now specifys a built in client scenario. 127.0.0.1 is the IP address of the asterisk box (Im running it from the asterisk server itself, but you don't need to), and -s testing specifies the extension to call. The default port is 5060 which we are using anyway.&lt;br /&gt;&lt;br /&gt;So, hopefully now, you should see stats appear on your screen!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-7630360574351463267?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/7630360574351463267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=7630360574351463267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7630360574351463267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7630360574351463267'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2011/02/stress-testing-asterisk-with-sipp.html' title='Stress testing Asterisk with Sipp'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-4701557415049645606</id><published>2011-02-23T06:54:00.000-08:00</published><updated>2011-06-01T01:00:18.878-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='E1750 mobile broadband'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='installation'/><category scheme='http://www.blogger.com/atom/ns#' term='Teila'/><title type='text'>Telia E1750 Mobile Broadband on Linux</title><content type='html'>This explains how I got my Telia Mobile Broadband (Telia Mobilt bredband) usb modem working with Arch linux. The theory should be the same though, for any distribution.&lt;br /&gt;&lt;br /&gt;What you need:&lt;br /&gt;&lt;br /&gt;1. A Huawei E1750 usb modem&lt;br /&gt;2. Windows installation (To reset the pin and test the modem)&lt;br /&gt;3. An existing internet connection (To install packages)&lt;br /&gt;4. Linux with ppp and ppp/usb support built into its kernel (*)&lt;br /&gt;&lt;br /&gt;*Any big distribution should have this by default.&lt;br /&gt;&lt;br /&gt;Firstly, install and connection your modem in Windows using Telia's software. You need to do this to establish that your modem is working properly, and, more importantly to disable the PIN on it (Its in the options menus). (Note that doing this makes your usb unsecure as anybody can steal it and start using your modem, but I can't seem to get the pin to enter in correctly within Linux).&lt;br /&gt;&lt;br /&gt;Once you have connected properly, and disabled your pin, boot into linux. You first need to install usb_modeswitch(http://www.draisberghof.de/usb_modeswitch/), as this will allow your modem to be detected as both a usb drive and as a modem. In arch linux you do it like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;pacman -S usb_modeswitch&lt;br /&gt;ldconfig&lt;br /&gt;&lt;/pre&gt;Connect your usb. In dmessg you should see this:&lt;br /&gt;&lt;pre&gt;usbcore: registered new interface driver usbserial&lt;br /&gt;USB Serial support registered for generic&lt;br /&gt;usbcore: registered new interface driver usbserial_generic&lt;br /&gt;usbserial: USB Serial Driver core&lt;br /&gt;USB Serial support registered for GSM modem (1-port)&lt;br /&gt;option 2-1.1:1.0: GSM modem (1-port) converter detected&lt;br /&gt;usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB0&lt;br /&gt;option 2-1.1:1.1: GSM modem (1-port) converter detected&lt;br /&gt;usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB1&lt;br /&gt;option 2-1.1:1.2: GSM modem (1-port) converter detected&lt;br /&gt;usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB2&lt;br /&gt;usbcore: registered new interface driver option&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And if you do lsusb you should see something like this:&lt;br /&gt;&lt;pre&gt;Bus 002 Device 006: ID 12d1:1001 Huawei Technologies Co., Ltd. E620 USB Modem&lt;br /&gt;&lt;/pre&gt;Now that your USB modem is detected, its time to install the ppp applications used to manage it, and they are ppp and wvdial. Again, with arch&lt;br /&gt;&lt;pre&gt;pacman -S ppp&lt;br /&gt;pacman -S wvdial&lt;br /&gt;&lt;/pre&gt;Setting up wvdial is as simple as editing /etc/wvdial.conf and adding the following:&lt;br /&gt;&lt;pre&gt;[Dialer Defaults]&lt;br /&gt;Init1 = ATZ&lt;br /&gt;Init2 = ATQ0 V1 E1 S0=0 &amp;C1 &amp;D2 +FCLASS=0&lt;br /&gt;Init3 = AT+CGDCONT=1,"IP","online.telia.se"&lt;br /&gt;Modem Type = Analog Modem&lt;br /&gt;ISDN = 0&lt;br /&gt;Password = dummy&lt;br /&gt;Username = dummy&lt;br /&gt;Phone = *99#&lt;br /&gt;Modem = /dev/ttyUSB0&lt;br /&gt;Baud = 9600&lt;br /&gt;Dial Command = ATDT&lt;br /&gt;Stupid Mode = 1&lt;br /&gt;&lt;/pre&gt;Type wvdial and hopefully this appears:&lt;br /&gt;&lt;pre&gt;--&gt; WvDial: Internet dialer version 1.61&lt;br /&gt;--&gt; Cannot get information for serial port.&lt;br /&gt;--&gt; Initializing modem.&lt;br /&gt;--&gt; Sending: ATZ&lt;br /&gt;ATZ&lt;br /&gt;OK&lt;br /&gt;--&gt; Sending: ATQ0 V1 E1 S0=0 &amp;C1 &amp;D2 +FCLASS=0&lt;br /&gt;ATQ0 V1 E1 S0=0 &amp;C1 &amp;D2 +FCLASS=0&lt;br /&gt;OK&lt;br /&gt;--&gt; Sending: AT+CGDCONT=1,"IP","online.telia.se"&lt;br /&gt;AT+CGDCONT=1,"IP","online.telia.se"&lt;br /&gt;OK&lt;br /&gt;--&gt; Modem initialized.&lt;br /&gt;--&gt; Sending: ATDT*99#&lt;br /&gt;--&gt; Waiting for carrier.&lt;br /&gt;ATDT*99#&lt;br /&gt;CONNECT&lt;br /&gt;--&gt; Carrier detected.  Starting PPP immediately.&lt;br /&gt;--&gt; Starting pppd at Wed Feb 23 15:35:31 2011&lt;br /&gt;--&gt; Pid of pppd: 4416&lt;br /&gt;--&gt; Using interface ppp0&lt;br /&gt;--&gt; local  IP address &lt;ip ADDRESS&gt;&lt;br /&gt;--&gt; remote IP address &lt;ip ADDRESS&gt;&lt;br /&gt;--&gt; primary   DNS address &lt;ip ADDRESS&gt;&lt;br /&gt;--&gt; secondary DNS address &lt;ip ADDRESS&gt;&lt;br /&gt;&lt;/pre&gt;Your now connected to the internet! For some reason pppd did not set my default gateway the first time, so I needed to add it myself by doing this, although you may not need to.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;route add default gw &lt;remote_ip_address_here&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-4701557415049645606?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/4701557415049645606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=4701557415049645606' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4701557415049645606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4701557415049645606'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2011/02/telia-e1750-mobile-broadband-on-linux.html' title='Telia E1750 Mobile Broadband on Linux'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5040875567476590850</id><published>2011-02-18T09:36:00.000-08:00</published><updated>2011-06-01T01:01:11.988-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gentoo'/><category scheme='http://www.blogger.com/atom/ns#' term='USB'/><category scheme='http://www.blogger.com/atom/ns#' term='operating system'/><category scheme='http://www.blogger.com/atom/ns#' term='full installation'/><title type='text'>Gentoo Install (Not live) on a USB stick</title><content type='html'>Here is a quick tutorial of how to install Gentoo on a USB stick, using the gentoo minimal cd. We start out installing the live cd onto the USB, then migrate it to a proper installation. You don't need to be running any particular distribution, you don't need a cdrom drive, but what you will need is:&lt;br /&gt;&lt;br /&gt;1. unetbootin&lt;br /&gt;2. extlinux&lt;br /&gt;3. A usb stick&lt;br /&gt;4. Something to partition the usb stick with&lt;br /&gt;5. The usb minimal iso&lt;br /&gt;&lt;br /&gt;First of all, partition your usb stick (using gparted or similar). As we are going to start installing straight from the usb, you need to set this up now, so make room for a swap partition and your root partition. I created one root partition EXT4, and one swap partition, without bothering for a boot partition.&lt;br /&gt;&lt;br /&gt;Use unetbootin to install the live cd onto the usb, and specify the root partition that you created just before. When thats done, mount the usb, go to the mount point and run these commands:&lt;br /&gt;&lt;pre&gt;mv isolinux extlinux&lt;br /&gt;mv extlinux/isolinux.cfg extlinux/extlinux.conf&lt;br /&gt;rm extlinux/isolinux.bin&lt;br /&gt;rsync -av extlinux&lt;br /&gt;extlinux -i extlinux&lt;br /&gt;&lt;/pre&gt;Unmount the USB. You should now be able to boot with it.&lt;br /&gt;&lt;br /&gt;The USB will boot to the livecd console. If your running DHCP everything should be working (if not, look at gentoo.org), and you can now begin setting up your operating system. &lt;br /&gt;&lt;br /&gt;If you check fdisk, your root partition should be mounted in /mnt/cdrom, as readonly. Remount it as read/write.&lt;br /&gt;&lt;pre&gt;mount -n -o remount,rw /mnt/cdrom&lt;br /&gt;&lt;/pre&gt;Now, chroot there.&lt;br /&gt;&lt;pre&gt;chroot /mnt/cdrom&lt;br /&gt;mount -t proc none /proc&lt;br /&gt;mount -o bind dev /dev&lt;br /&gt;mount -t devpts devpts /dev/pts&lt;br /&gt;env-update&lt;br /&gt;source /etc/profile&lt;br /&gt;&lt;/pre&gt;You will need to put in a nameserver in /etc/resolv.conf, as the live cd doesn't have anything in there. Once your done, you should now be able to continue with section 5 of the gentoo handbook, "Installing the Gentoo Installation files". That is, download the stage 3 file, untar in the root directory, and extract portage into /usr.&lt;br /&gt;&lt;br /&gt;When its time to compile your kernel, make sure you have all the drivers required for USB (i.e SATA). In this example I have not created a boot partition, so, you will need grub to mount the boot partition rw, and enable Support for large (2TB) block devices (Under enable block devices) EVEN if your USB is no where near that size.&lt;br /&gt;&lt;br /&gt;Also, you will need to add another parameter into grub on your kernel line, otherwise risk the error "cannot find root". This delays the kernel from accessing the root partition, allowing your usb drivers to setup properly. Heres an example grub.conf&lt;br /&gt;&lt;pre&gt;title Gentoo Linux 2.6.34&lt;br /&gt;root (hd0, 1)&lt;br /&gt;kernel /boot/kernel-2.6.34-gentoo-r1 root/dev/hda2 rw rootdelay=10&lt;br /&gt;&lt;/pre&gt;If its still not detected, try making it longer.&lt;br /&gt;&lt;br /&gt;All thats left to do is remove all the old live cd install files, such as the ones I've listed below in the root directory, and your ready to go.&lt;br /&gt;&lt;pre&gt;extlinux           livecd               ubninit&lt;br /&gt;extlinux.conf           menu.c32             ubnkern&lt;br /&gt;gentoo.efimg            stage3-i686-20110215.tar.bz2  &lt;br /&gt;gentoo.efimg.mountPoint syslinux.cfg         ubnpathl.txt&lt;br /&gt;image.squashfs          ubnfilel.txt&lt;br /&gt;&lt;/pre&gt;Finally, be careful about the USB devices you have; your usb stick may not be always /dev/hda!&lt;br /&gt;&lt;br /&gt;Good Luck!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5040875567476590850?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5040875567476590850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5040875567476590850' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5040875567476590850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5040875567476590850'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2011/02/gentoo-on-usb-stick.html' title='Gentoo Install (Not live) on a USB stick'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-8364022851179233409</id><published>2010-12-22T02:29:00.001-08:00</published><updated>2011-06-01T01:01:35.834-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='gradle'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='automated build'/><category scheme='http://www.blogger.com/atom/ns#' term='including external jars'/><title type='text'>Simple Java Project with Gradle</title><content type='html'>Heres how to setup a very simple project in &lt;a href="http://gradle.org/"&gt;Gradle&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;I don't use any repositories. All the jar files required for compiling the project are contained within a sub-directory of the project. I use TestNG for unit testing.&lt;br /&gt;&lt;br /&gt;Ive found Gradle easier to use than Maven, not least because the documentation is clearer with examples all the way through. In addition, setting up Gradle for small projects seems to require a lot less effort.&lt;br /&gt;&lt;br /&gt;This is the contents of build.gradle, which is placed in the root directory of the project. ./lib contains all the required jar files for the source, which is in ./src. Likewise, the test code is in ./test/src, and associated libraries (I.e TestNG's libraries) are in ./test/lib. &lt;br /&gt;&lt;br /&gt;You don't need to include the "jar" section unless your planning on deploying the project as a jar file.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;apply plugin: 'java'&lt;br /&gt;&lt;br /&gt;sourceCompatibility = 1.6&lt;br /&gt;version = '1.0'&lt;br /&gt;&lt;br /&gt;dependencies {&lt;br /&gt;   compile files(fileTree(dir: 'lib', includes: ['*.jar'])) &lt;br /&gt;   testCompile files(fileTree(dir: 'test/lib', includes: ['*.jar']))&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sourceSets {&lt;br /&gt;    main {&lt;br /&gt;        java {&lt;br /&gt;            srcDir 'src'&lt;br /&gt;        }&lt;br /&gt;    }    &lt;br /&gt;&lt;br /&gt;    test {&lt;br /&gt;        java {&lt;br /&gt;            srcDir 'test/src'&lt;br /&gt;        }&lt;br /&gt;    } &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;jar {&lt;br /&gt;    manifest {&lt;br /&gt;        attributes 'Implementation-Title': 'My Project', &lt;br /&gt;                   'Implementation-Version': version,&lt;br /&gt;                   'Main-Class': 'package.Main'&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;test {&lt;br /&gt;    useTestNG()&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-8364022851179233409?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/8364022851179233409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=8364022851179233409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8364022851179233409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8364022851179233409'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2010/12/simple-gradle-project.html' title='Simple Java Project with Gradle'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-59914184149640497</id><published>2010-08-20T13:37:00.000-07:00</published><updated>2010-08-20T13:40:08.621-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XJSONDataSource'/><category scheme='http://www.blogger.com/atom/ns#' term='SmartGWt'/><title type='text'>SmartGWT cross domain JSON Data Source</title><content type='html'>I was struggling to find an XJSON data source example (That is, a data source that is capable of loading JSON from a domain other than where the scripts resides), so battled through it myself.&lt;br /&gt;The example below shows how to do it.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;// Create your XJSONDataSource object. Its just a standard data source with a few whistles.&lt;br /&gt;&lt;br /&gt;DataSource ds = new XJSONDataSource();&lt;br /&gt;ds.setRecordXPath("/item");&lt;br /&gt;&lt;br /&gt;// Set it up with whatever fields you want, as per usual&lt;br /&gt;&lt;br /&gt;DataSourceTextField name = new DataSourceTextField("name", "Data Name");&lt;br /&gt;name.setValueXPath("name");&lt;br /&gt;&lt;br /&gt;DataSourceIntegerField id = new DataSourceIntegerField("id", "Data Id");&lt;br /&gt;id.setValueXPath("id");&lt;br /&gt;id.setPrimaryKey(true);&lt;br /&gt;&lt;br /&gt;ds.setFields(id, name);&lt;br /&gt;&lt;br /&gt;// DataSource is now ready for data. Give it a url.&lt;br /&gt;&lt;br /&gt;ds.setDataURL("http://your_json_url_feed");&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Once this loads (and remember to fetch the data through your tree grid or whatever else is viewing it), it will send a request that looks something like this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;http://your_json_url_feed?callback=isc.Comm._scriptIncludeReply_0&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;The JSON that your server must send must be wrapped around this callback label. For example:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;isc.Comm._scriptIncludeReply_0 ({"item": [ {"id": "1","name": "Monkey"}, &lt;br /&gt;{"id": "2","name": "Tree"}, &lt;br /&gt;{"id": "3","name": "Banana"} ] })&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;The callback value can change, so make sure your server code picks it up and puts it in the right place within the response accordingly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-59914184149640497?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/59914184149640497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=59914184149640497' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/59914184149640497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/59914184149640497'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2010/08/smartgwt-cross-domain-json-data-source.html' title='&lt;h2&gt;SmartGWT cross domain JSON Data Source&lt;/h2&gt;'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5093714737006020988</id><published>2010-07-21T05:05:00.000-07:00</published><updated>2010-08-04T03:56:14.651-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse tethering'/><category scheme='http://www.blogger.com/atom/ns#' term='android internet connection'/><category scheme='http://www.blogger.com/atom/ns#' term='share internet connection with phone'/><title type='text'>Connecting your android phone to the internet via your PC or Laptop</title><content type='html'>First, lets get one thing straight. This explains how to connect your PHONE to the internet VIA your computer, which which already has a internet connection. It does NOT explain how to connect your laptop or computer to the internet VIA your phone (i.e using your phone as a modem).&lt;br /&gt;&lt;br /&gt;If you want to do this, there are a multitude of ways, but probably the easiest is by using an application called &lt;a href="http://www.junefabrics.com/android/"&gt;PDAnet&lt;/a&gt;. The process of doing this is called "tethering". What I am going to explain is known as "reverse tethering".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Why would I want this?&lt;/h3&gt;&lt;br /&gt;Because your laptop has internet access, and your phone doesnt, and you want it on your phone. &lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Options that didnt work&lt;/h3&gt;&lt;br /&gt;&lt;h4&gt;USB Cable&lt;/h4&gt;Unless you have a rooted phone, you cant do this. And if you've already rooted your phone, then I doubt you'll be reading this anyway.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;VIA an ADHOC network&lt;/h4&gt;&lt;br /&gt;You can create an adhoc network in windows quite easily. Most(?) phones cant connect to adhoc networks, and searching for it in your wifi settings comes up with nothing.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Solution&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;VIA &lt;a href="http://www.connectify.me/"&gt;Connectify&lt;/a&gt;&lt;/h4&gt;&lt;br /&gt;You will need, windows 7, your phone and the connectify software.&lt;br /&gt;&lt;br /&gt;This method works on the Samsung GT-7500, and probably ANY phone that supports wifi.&lt;br /&gt;&lt;br /&gt;Download the connectify application from http://www.connectify.me/&lt;br /&gt;&lt;br /&gt;Install the application and create a new wifi hotspot.&lt;br /&gt;&lt;br /&gt;Make sure "Share internet" is ticked in your Connectify settings (A box should popup as soon as its started)&lt;br /&gt;&lt;br /&gt;Connect to it using your phone.&lt;br /&gt;&lt;br /&gt;If you cant get onto the internet, make sure the connection (In Network Connections) that has internet is set to allow other network users to connect through this computers internet connection, and specify the newly created connectify network in the drop box. Press OK. &lt;br /&gt;&lt;br /&gt;You should now be able to connect to the internet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5093714737006020988?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5093714737006020988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5093714737006020988' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5093714737006020988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5093714737006020988'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2010/07/connecting-your-android-phone-to.html' title='&lt;h2&gt;Connecting your android phone to the internet via your PC or Laptop&lt;/h2&gt;'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5241468246758337269</id><published>2010-05-07T01:38:00.000-07:00</published><updated>2010-06-21T13:39:38.158-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='arch laptop'/><category scheme='http://www.blogger.com/atom/ns#' term='studio 1558'/><category scheme='http://www.blogger.com/atom/ns#' term='laptop'/><category scheme='http://www.blogger.com/atom/ns#' term='dell'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch Linux 64 bit installation'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch Linux'/><title type='text'>Arch Linux on a DELL Studio 1558 Notebook</title><content type='html'>Ive switched to Arch from Ubuntu for the moment. For a couple reasons; I wanted a more configurable system from the start but mostly Im getting a little bored of Ubuntu. No other reason than that. I went with the 64bit version.&lt;br /&gt;&lt;br /&gt;Before I get any further, the following things are working:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Wireless&lt;/li&gt;&lt;li&gt;Network Card&lt;/li&gt;&lt;li&gt;ATI Graphics card (Propritary driver)&lt;/li&gt;&lt;li&gt;Web Cam&lt;/li&gt;&lt;li&gt;Sound&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Untested&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;HDMI Port&lt;/li&gt;&lt;li&gt;Card Reader&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Whats not working&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Media Buttons (*)&lt;/li&gt;&lt;li&gt;CD-ROM Eject Button(**)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;* Seems to work but crashes the computer&lt;br /&gt;** You can still right click in gnome and eject the cd. This comes up in dmessg.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;dell-wmi: Unknown key 0 pressed&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Product Description&lt;/h2&gt;This is what is described on the receipt from dell.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;- DELL Studio 1558 Notebook-OCQT&lt;br /&gt;- Intel(R)Core(TM)i7-620M(2.66GHz,4 Threads,turbo boost up to 3.33GHz,4M cache)&lt;br /&gt;- 15.6 " Full HD(1080p)WLED (1920 x 1080)Display with True&lt;br /&gt;- ATI Mobility Radeon 5470 1GB&lt;br /&gt;- Dell(TM) Wireless 365 Bluetooth Module&lt;br /&gt;- Dell(TM) Wireless 1520 802.11n Mini-Card&lt;br /&gt;- 640GB 5400RPM SATA Hard Drive&lt;br /&gt;- 4GB Dual-channel 1333MHz DDR3 SDRAM (2 x 2GB)&lt;br /&gt;- Bezel with Integrated 2.0MP Web Cam&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;lspci&lt;/h2&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 12)&lt;br /&gt;00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port (rev 12)&lt;br /&gt;00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)&lt;br /&gt;00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)&lt;br /&gt;00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)&lt;br /&gt;00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06)&lt;br /&gt;00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 06)&lt;br /&gt;00:1c.3 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 4 (rev 06)&lt;br /&gt;00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 (rev 06)&lt;br /&gt;00:1c.5 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 6 (rev 06)&lt;br /&gt;00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)&lt;br /&gt;00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a6)&lt;br /&gt;00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 06)&lt;br /&gt;00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA AHCI Controller (rev 06)&lt;br /&gt;00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06)&lt;br /&gt;00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 06)&lt;br /&gt;02:00.0 VGA compatible controller: ATI Technologies Inc Device 68e0&lt;br /&gt;02:00.1 Audio device: ATI Technologies Inc Device aa68&lt;br /&gt;04:00.0 Network controller: Broadcom Corporation Device 4353 (rev 01)&lt;br /&gt;07:00.0 SD Host controller: Ricoh Co Ltd Device e822 (rev 01)&lt;br /&gt;07:00.1 System peripheral: Ricoh Co Ltd Device e230 (rev 01)&lt;br /&gt;07:00.2 System peripheral: Ricoh Co Ltd Device e852 (rev 01)&lt;br /&gt;07:00.3 FireWire (IEEE 1394): Ricoh Co Ltd Device e832 (rev 01)&lt;br /&gt;09:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03)&lt;br /&gt;ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 02)&lt;br /&gt;ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 02)&lt;br /&gt;ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 02)&lt;br /&gt;ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 02)&lt;br /&gt;ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 02)&lt;br /&gt;ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 02)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;lsusb&lt;/h2&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Bus 001 Device 006: ID 413c:8162 Dell Computer Corp. &lt;br /&gt;Bus 001 Device 005: ID 413c:8161 Dell Computer Corp. &lt;br /&gt;Bus 001 Device 004: ID 0c45:6417 Microdia &lt;br /&gt;Bus 001 Device 003: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)&lt;br /&gt;Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub&lt;br /&gt;Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Installation&lt;/h2&gt;&lt;br /&gt;I had some issues with partitions. I wanted to keep the inital Windows 7 install and have another partition for Arch (Well two, / and swap). My inital solution was to resize the partitions using gparted with Ubuntu's live cd. This worked; I created some free space, and restarted with the Arch installation cd. When it changed to the disk resizing tool, cfdisk (when using manually set up partitions) I got this error message:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;FATAL ERROR: Bad primary partition 3: Partition ends after end-of-disk&lt;br /&gt;Press any key to exit cfdisk&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Everywhere on the web seemed to suggest that I had to remove all the partitions and start again. This isn't the case; use fdisk, remove the parititions that were created in Ubuntu, create two new blank partitions, and write the partition table to disk. When you restart the installer, you should be able to format and select your new partitions without error.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Wireless&lt;/h2&gt;&lt;br /&gt;First thing I fixed was wireless. The wireless card requires the broadcom-wl driver, which is only available from yaourt.  Append the yaourt repo to you pacman configuration file.&lt;br /&gt;&lt;br /&gt;/etc/pacman.conf&lt;br /&gt;&lt;code&gt;&lt;br /&gt;[archlinuxfr]&lt;br /&gt;Server = http://repo.archlinux.fr/x86_64&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Install it.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;pacman -Sy yaourt&lt;br /&gt;pacman -S base-devel&lt;br /&gt;yaourt -S broadcom-wl&lt;br /&gt;modprobe wl&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Now, eth0 or eth1 should be your wireless card.&lt;br /&gt;&lt;br /&gt;dmesg:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;eth0: Broadcom BCM4353 802.11 Hybrid Wireless Controller 5.60.48.36 &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I install wicd. Its, in my opinion the easiest way to connect to wireless internet. Sure, there are more lightweight options but this allows you to easily find, connect, and create profiles very easily.&lt;br /&gt;&lt;br /&gt;pacman -S wicd&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Fix for eth0 and eth1 swapping&lt;/h2&gt;&lt;br /&gt;Sometimes eth0 and eth1 swap, which is a bit of a pain when using wicd as you have to keep changing the settings. You can fix this by creating/editing the following file, and assigning the appropriate ATTR parameter to your wifi cards mac address.&lt;br /&gt;&lt;br /&gt;File: /etc/udev/rules.d/10-network.rules&lt;br /&gt;&lt;code&gt;&lt;br /&gt;SUBSYSTEM=="net", ATTR{address}=="ff:ee:dd:cc:bb:aa", NAME="wlan0"&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Graphics Card&lt;/h2&gt;&lt;br /&gt;I tried using the standard radeon driver (radeonhd does not work with this card). It worked ok, but the graphics card was going full speed all the time. This isn't very good when running on battery, but installing the propriety driver (now also in yaourt) fixed this.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# Note, you only have to run the first two commands if you currently have the open source&lt;br /&gt;# driver installed.&lt;br /&gt;&lt;br /&gt;# pacman -Rd libgl&lt;br /&gt;# pacman -Rd xf86-video-ati&lt;br /&gt;&lt;br /&gt;yaourt catalyst&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now, just follow the instructions as copied directly from yaourt.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;You can use the tool 'aticonfig' to generate an xorg.conf file.&lt;br /&gt;Remember to add fglrx to the MODULES list in /etc/rc.conf.&lt;br /&gt;--------------------------------------------------------------&lt;br /&gt;Add nomodeset to your kernel line in /boot/grub/menu.lst , ie.:&lt;br /&gt;kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/1aa731c0-f626-3d01-a551-8eed1c2a34f3 ro nomodeset&lt;br /&gt;--------------------------------------------------------------&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Sound&lt;/h2&gt;&lt;br /&gt;Note, I did not install pulseaudio. All i installed alsautil, and added alsa to the DAEMONS line in rc.conf.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;pacman -S alsautils&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;ls -l /sys/module/snd/holders&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;lrwxrwxrwx 1 root root 0 May  6 13:08 snd_hda_codec -&gt; ../../snd_hda_codec&lt;br /&gt;lrwxrwxrwx 1 root root 0 May  6 13:08 snd_hda_codec_idt -&gt; ../../snd_hda_codec_idt&lt;br /&gt;lrwxrwxrwx 1 root root 0 May  6 13:08 snd_hda_intel -&gt; ../../snd_hda_intel&lt;br /&gt;lrwxrwxrwx 1 root root 0 May  6 13:08 snd_hwdep -&gt; ../../snd_hwdep&lt;br /&gt;lrwxrwxrwx 1 root root 0 May  6 13:08 snd_mixer_oss -&gt; ../../snd_mixer_oss&lt;br /&gt;lrwxrwxrwx 1 root root 0 May  6 13:08 snd_pcm -&gt; ../../snd_pcm&lt;br /&gt;lrwxrwxrwx 1 root root 0 May  6 13:08 snd_pcm_oss -&gt; ../../snd_pcm_oss&lt;br /&gt;lrwxrwxrwx 1 root root 0 May  6 13:08 snd_seq -&gt; ../../snd_seq&lt;br /&gt;lrwxrwxrwx 1 root root 0 May  6 13:08 snd_seq_device -&gt; ../../snd_seq_device&lt;br /&gt;lrwxrwxrwx 1 root root 0 May  6 13:08 snd_seq_oss -&gt; ../../snd_seq_oss&lt;br /&gt;lrwxrwxrwx 1 root root 0 May  6 13:08 snd_timer -&gt; ../../snd_timer&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The module required for this sound card is snd_hda_intel.&lt;br /&gt;&lt;br /&gt;As per the instructions on the wiki, I added this line to /etc/modprobe.d/modprobe.conf&lt;br /&gt;&lt;code&gt;&lt;br /&gt;options snd_hda_intel index=0&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;After restarting or modprobing snd_hda_indel, you aplay -l should look something like this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]&lt;br /&gt;Subdevices: 1/1&lt;br /&gt;Subdevice #0: subdevice #0&lt;br /&gt;card 1: Generic [HD-Audio Generic], device 3: ATI HDMI [ATI HDMI]&lt;br /&gt;Subdevices: 1/1&lt;br /&gt;Subdevice #0: subdevice #0&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;You can test your sound with this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Center.wav&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Add your user to audio group, and restart. Sound should be working.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Webcam&lt;/h2&gt;&lt;br /&gt;The driver for the webcam is included in the stock kernel. Just modprobe uvcvideo.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;modprobe uvcvideo&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;CPU Frequency Scaling&lt;/h2&gt;&lt;br /&gt;I set cpu frequency governor to powersave. There are plenty of tutorials on the arch wiki on how to do this. One thing to watch out for though, is that you have to set the governor for EACH core. Setting it for one will not affect the other. I didn't install a daemon, so I have to change between the modules manually (Not a big deal; powersave seems fast enough anyway).&lt;br /&gt;All you need is:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;pacman -S cpufrequtils&lt;br /&gt;modprobe acpi-cpufreq &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;So, add something like the below to a script that gets run on startup, say /etc/rc.local&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# set all cores to powersave governer&lt;br /&gt;&lt;br /&gt;cpufreq-set -c 0 -g powersave&lt;br /&gt;cpufreq-set -c 1 -g powersave&lt;br /&gt;cpufreq-set -c 2 -g powersave&lt;br /&gt;cpufreq-set -c 3 -g powersave&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;# add to rc.conf, along with the governors you want to use.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;MODULES=(acpi-cpufreq cpufreq_powersave ....)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Upgrading the kernel&lt;/h1&gt;After a kernel upgrade its more than likely your wireless and graphics cards will stop working.&lt;br /&gt;&lt;br /&gt;When you try and start X11, you'll get:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;(EE) unable to load module fglrx&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Add this line to your /etc/pacman.conf&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;[catalyst]&lt;br /&gt;Server = http://catalyst.apocalypsus.net/repo/catalyst/x86_64&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Then&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;pacman -Syu # this should prompt you to upgrade catalyst; if not reinstall it anyway&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Your broadcom wireless driver will have to be rebuilt again.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;pacman -S base-devel&lt;br /&gt;yaourt -S broadcom-wl&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Note, if you get the error&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Unable to read PKGBUILD &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Try running yaourt as a NON root user (which you should be doing anyway).&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Extras &lt;/h1&gt;&lt;br /&gt;&lt;h2&gt;Gnome - "unable to mount DEVICE - not authorized"&lt;/h2&gt;&lt;br /&gt;This is not an Arch/Dell issue, but something I came across. Making your xinitrc read as below, fixes it.&lt;br /&gt;&lt;br /&gt;[~/.xinitrc]&lt;br /&gt;&lt;code&gt;&lt;br /&gt;exec ck-launch-session gnome-session&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;br /&gt;Thats pretty much everything I use my laptop for, so I'm happy with Arch for the moment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5241468246758337269?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5241468246758337269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5241468246758337269' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5241468246758337269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5241468246758337269'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2010/05/arch-linux-on-dell-studio-1558-notebook.html' title='&lt;h2&gt;Arch Linux on a DELL Studio 1558 Notebook&lt;/h2&gt;'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5636513960379769380</id><published>2010-02-06T05:54:00.001-08:00</published><updated>2010-02-06T06:08:50.350-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='8192 ubuntu wireless driver'/><category scheme='http://www.blogger.com/atom/ns#' term='wireless on toshiba L510'/><title type='text'>Ubuntu Wireless On Toshbia L510</title><content type='html'>This is on the Ubuntu forums, but I wanted to keep a reference here, as so I wouldn't forget.&lt;br /&gt;The current release of Ubuntu (Karmic) does NOT have the latest kernel which includes the required drivers for the wireless card on this laptop. The wifi card this laptop has is as described in by lspci below.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device 8192 (rev 01)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;At the time of writing, the development version (Ubuntu lucid) ships with the 2.6.32 kernel which HAS the required module but NOT the required FIRMWARE (I'll get to that later).&lt;br /&gt;&lt;br /&gt;So, either install this kernel manually, or update to lucid using synaptic or update-manager -d, or do-release-upgrade -d. &lt;br /&gt;&lt;br /&gt;Once you have done that, the network manager will list the wifi card as wlan0, but wifi operations will not be permitted (For example, the Network Manager will display "disconnected" under the wireless networks menu, as the firmware cannot be found, and you will not be able to do anything with it.&lt;br /&gt;&lt;br /&gt;To install the firmware, do as follows. (You will need to apt-get git-core if you haven't already done so)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;cd /tmp&lt;br /&gt;git clone git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/firmware.git&lt;br /&gt;sudo cp -av firmware/RTL8192E /lib/firmware/&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Reboot your system. You should now have wireless!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5636513960379769380?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5636513960379769380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5636513960379769380' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5636513960379769380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5636513960379769380'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2010/02/ubuntu-wireless-on-toshbia-l510.html' title='Ubuntu Wireless On Toshbia L510'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-4193545208038041312</id><published>2009-11-22T20:03:00.000-08:00</published><updated>2010-01-31T04:33:23.223-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='coloured jbutton'/><title type='text'>Colouring a Swing JButton - Java</title><content type='html'>This is extremely simple, but not intuitive. Without setting Opaque, and content area filled, the colour will not show; instead it will still display whatever is defined by the default look and feel. The below example will set the background of the button blue.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;JButton button = new javax.swing.JButton();&lt;br /&gt;button.setBackground(Color.BLUE);&lt;br /&gt;button.setContentAreaFilled(false);&lt;br /&gt;button.setOpaque(true);&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-4193545208038041312?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/4193545208038041312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=4193545208038041312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4193545208038041312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4193545208038041312'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/11/colouring-swing-jbutton-java.html' title='Colouring a Swing JButton - Java'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-2313698820502656373</id><published>2009-11-18T02:14:00.000-08:00</published><updated>2009-11-26T20:48:49.467-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='joomla'/><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='joomla install guide'/><title type='text'>Joomla On Ubuntu</title><content type='html'>Below is a simple installation guide for installing Joomla on Ubuntu. &lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Installing dependences&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;First, install these packages.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;# The mysql database that joomla uses&lt;br /&gt;apt-get install mysql-server&lt;br /&gt;&lt;br /&gt;# The Apache 2 web server&lt;br /&gt;apt-get install apache2&lt;br /&gt;&lt;br /&gt;# The php module for Apache 2&lt;br /&gt;apt-get install libapache2-mod-php&lt;br /&gt;&lt;br /&gt;# Note that if you have tried to access your site before installing the php mod or restarting &lt;br /&gt;# apache your browser may still prompt you to "download" the php file, rarther than run it.&lt;br /&gt;&lt;br /&gt;#  If you see this error:&lt;br /&gt;# *** Unable to connect to the database:The MySQL adapter "mysql" is not available.&lt;br /&gt;# you need to install the folowing package:&lt;br /&gt;&lt;br /&gt;apt-get install php5-mysql &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Pre Configuation&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Extract the joomla archive (you can download it from &lt;a href="http://www.joomla.org"&gt;www.joomla.org&lt;/a&gt; into a folder within /var/www/. From now on I am going to refer to that folder as "joomla_home".&lt;br /&gt;&lt;br /&gt;For some reason I need to create a blank configuration file in order for the configuration procedure to work.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;touch /var/www/joomla_home/configuration.php&lt;br /&gt;chown www-data /var/www/joomla_home/configuration.php&lt;br /&gt;chgrp www-data /var/www/joomla_home/configuration.php&lt;br /&gt;chmod 755 /var/www/joomla_home/configuration.php&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That should be all you need for the configuration stage. You need to set up the permissions for other parts of Joomla though;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;chown www-data joomla_home/ -R&lt;br /&gt;chmod 755 joomla_home/ -R&lt;br /&gt;&lt;br /&gt;#  If you get this error "*** uploading template - * Warning! Failed to move file."&lt;br /&gt;#  when trying to install a template, your web user (www-data) doesnt have write access to &lt;br /&gt;# joomla_home/tmp&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Setting up the database.&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;First, set password for root. Then login to mysql and create the database, and a user that joomla can use to access this database. In the example below the database name is "joomla_cms", the username is "joomla" and the password is "joomla_pass".&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;create database joomla_cms;&lt;br /&gt;CREATE USER 'joomla'@'localhost' IDENTIFIED BY 'joomla_pass'&lt;br /&gt;use joomla_cms;&lt;br /&gt;grant all privileges on joomla_cms.* to 'joomla'@'localhost';&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Configuration&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Now, you should be able to browse to the joomla configuration page.&lt;br /&gt;Once thats completed, remove the configuration folder, and you should be able to log into joomla.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Extras&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Some modules require the php-gd package to make thumbnails of bigger pictures.&lt;br /&gt;You can install it using this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install php5-gd       # required to to make thumbnails&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;permissions:&lt;br /&gt;&lt;br /&gt;-- installing GD library for event plugin&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install php5-gd # required to make thumbnails&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-2313698820502656373?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/2313698820502656373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=2313698820502656373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2313698820502656373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2313698820502656373'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/11/joomla-on-ubuntu.html' title='Joomla On Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-597641889596095627</id><published>2009-11-17T03:39:00.000-08:00</published><updated>2010-05-10T03:41:11.890-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PPTP with wicd'/><category scheme='http://www.blogger.com/atom/ns#' term='PPTP'/><category scheme='http://www.blogger.com/atom/ns#' term='manual setup'/><title type='text'>Manually setting up a PPTP connection</title><content type='html'>A Ubuntu upgrade rendered network-manager useless. So I switched to wicd, which I personally think is better, except for the fact that its missing PPTP vpn support. Turns out setting one of these via the command line is very easy. The script below demonstrates how to do it.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;#!/bin/bash&lt;br /&gt;pptpsetup --create work --server 10.0.0.1 --username yourusername \&lt;br /&gt;--password yourpassword --encrypt --start&lt;br /&gt;&lt;br /&gt;# add routes&lt;br /&gt;&lt;br /&gt;route add -net 192.168.7.0/24 ppp0&lt;br /&gt;route add -net 192.168.9.0/24 ppp0&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;10.0.0.1 is the IP address of your VPN server. This will more than likely be a public IP address.&lt;br /&gt;yourusername is the username you use to connect to the pptp vpn with.&lt;br /&gt;yourpassword is the password you use to connect to the pptp vpn with.&lt;br /&gt;&lt;br /&gt;Note pptpsetup seems to cache your password along side the created vpn. For example, you&lt;br /&gt;may have run the above command with an invalid command and got this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;MS-CHAP authentication failed: I don't like you.  Go 'way.&lt;br /&gt;CHAP authentication failed&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If your sure you now have the correct password, try changing "--create work" to some other name.&lt;br /&gt;&lt;br /&gt;After running the pptpsetup command, you'll hopefully get something like this:&lt;br /&gt;&lt;code&gt;Using interface ppp0&lt;br /&gt;Connect: ppp0 &lt;--&gt; /dev/pts/3&lt;br /&gt;CHAP authentication succeeded&lt;br /&gt;MPPE 128-bit stateless compression enabled&lt;br /&gt;local  IP address 192.168.7.29&lt;br /&gt;remote IP address 192.168.7.1&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;This tells us that the command has created adapter "ppp0" for our vpn connection.&lt;br /&gt;Finally, we must add the required routes into our routing table to route out this adapter. In the example it will route all traffic destined to .7 and .9 out our newly created vpn interface.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-597641889596095627?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/597641889596095627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=597641889596095627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/597641889596095627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/597641889596095627'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/11/manually-setting-up-pptp-connection.html' title='Manually setting up a PPTP connection'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-8605805969104090721</id><published>2009-11-12T19:11:00.000-08:00</published><updated>2011-12-15T07:56:28.835-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java on VPS'/><title type='text'>Running java with limited memory</title><content type='html'>If you've subscribed to a shared VPS service, chances are you have a limited amount of memory to worth with. This can be a problem for java. If java cannot reserve enough memory for the VM, you'll likely get the error below.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Error occurred during initialization of VM&lt;br /&gt;Could not reserve enough space for object heap&lt;br /&gt;Could not create the Java virtual machine.&lt;/pre&gt;&lt;br /&gt;My first instinct was to create a swap file. You can do this by doing the following.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# create a blank file (542 Megs)&lt;br /&gt;dd if=/dev/zero of=myswapfile bs=1024 count=524288&lt;br /&gt;# make it a swap file&lt;br /&gt;mkswap myswapfile&lt;br /&gt;# Activate swap space:&lt;br /&gt;swapon /myswapfile&lt;/pre&gt;&lt;br /&gt;This command is restricted though, on most VPS, meaning you'll get this error.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;swapon: myswapfile: Operation not permitted&lt;/pre&gt;&lt;h2&gt;Solution&lt;/h2&gt;By running the following command, you can set the amount of heap space that java will use. You will want to adjust the parameters to suit your situation.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;export _JAVA_OPTIONS="-Xms20m -Xmx64m -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 &lt;br /&gt;-XX:NewSize=10m -XX:MaxNewSize=10m -XX:SurvivorRatio=6 -XX:TargetSurvivorRatio=80 &lt;br /&gt;-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-8605805969104090721?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/8605805969104090721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=8605805969104090721' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8605805969104090721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8605805969104090721'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/11/running-java-with-limited-memory.html' title='Running java with limited memory'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-1977767609887640905</id><published>2009-11-10T19:56:00.000-08:00</published><updated>2011-12-15T07:58:28.024-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Moving mouse with keyboard'/><category scheme='http://www.blogger.com/atom/ns#' term='Xorg'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='controlling mouse with keyboard'/><title type='text'>Controlling mouse with keyboard in Ubuntu</title><content type='html'>Its only when your stuck on a machine where you don't have a mouse, or when your mouse decides not to work that the short-cut to control your mouse with your keyboard suddenly becomes &lt;b&gt;really&lt;/b&gt; handy. The short-cut is:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SHIFT + CTRL + ALT + NUM LOCK&lt;/pre&gt;&lt;br /&gt;Once you press this, you can then control your mouse using the keypad! Pressing 5, is the same as a left click. I believe this is a short-cut that's controlled by X-org, so should work in most Linux distributions, but I've only tested it with Ubuntu.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-1977767609887640905?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/1977767609887640905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=1977767609887640905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1977767609887640905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1977767609887640905'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/11/controlling-mouse-with-keyboard-in.html' title='Controlling mouse with keyboard in Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-3127945419008617493</id><published>2009-11-09T19:03:00.000-08:00</published><updated>2009-11-09T19:24:36.831-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Arch Linux 64 bit installation'/><category scheme='http://www.blogger.com/atom/ns#' term='Arch Linux'/><title type='text'>Arch Linux 64 bit installation</title><content type='html'>If you love linux, Arch Linux is great. The installer is easy to use (although follow the steps in order or you'll run into trouble), and you can create a very lean system, quite quickly. Dont get me wrong; Ubuntu is also great, and will suit alot of people, but for those that dont have the time for the builds of Gentoo (which I highly recommend for anybody wanting to dig a bit deeper) but want a more customized system, Arch Linux is a fantastic choice. &lt;br /&gt;Below, Ive listed a few hurdles I had getting up and running.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Fixing open office fonts&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;If you dont the correct fonts installed, you'll see squares instead of characters when using open office. The most common ones are in these packages. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;artwiz-fonts ttf-ms-fonts&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;See The open office &lt;a href="http://wiki.archlinux.org/index.php/OpenOffice"&gt;wiki&lt;/a&gt; for details.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Pidgin&lt;/h2&gt;&lt;br /&gt;to fix the spell check in Pidgin (assuming your using english) install the aspell english language pack:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;aspell-en&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;MP3, DivX, Xvid&lt;/h2&gt;&lt;br /&gt;If you want to play mp3's, DivX and Xvid in Banshee (or any other media player) you'll need to install these packages:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;gstreamer-bad-plugins&lt;br /&gt;gstreamer-ugly&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you dont, you might see errors like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;85] nereid Client Started&lt;br /&gt;** Message: don't know how to handle audio/mpeg, mpegversion=(int)1, mpegaudioversion=(int)1, layer=(int)3, rate=(int)44100, channels=(int)2, parsed=(boolean)true&lt;br /&gt;** Message: don't know how to handle audio/mpeg, mpegversion=(int)1, mpegaudioversion=(int)1, layer=(int)3, rate=(int)44100, channels=(int)2, parsed=(boolean)true&lt;br /&gt;[Error 14:09:41.784] GStreamer resource error: NotFound&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;No Gstreamer Plugins Found Error&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;If you get the error "no gstreamer plugins found" when trying to play mp3/xvid/divx files, you may need to add your user to the audio group, shown below.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sudo chmod -R a+rwx /dev/snd&lt;br /&gt;usermod --append audio your_username&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Display Settings&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;It took me some time to work out how to get the display to work correctly on my 1400x900 monitor working with the correct resolution. It wasnt until I found out that the default driver "vesa" does NOT support this resolution (!!!) that I was able to solve it. My graphics card is:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;00:02.0 VGA compatible controller: Intel Corporation 82Q35 Express Integrated Graphics Controller (rev 02)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can install the driver required for this using:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;pacman -S  xf86-video-intel&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then, in your /etx/X11/xorg.conf, make sure you specify the correct driver and resolution.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Section "Device"&lt;br /&gt;        Identifier  "Card0"&lt;br /&gt;        Driver      "intel"&lt;br /&gt;        VendorName  "All"&lt;br /&gt;        BoardName   "All"&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;Section "Screen"&lt;br /&gt;        Identifier "Screen0"&lt;br /&gt;        Device     "Card0"&lt;br /&gt;        Monitor    "Monitor0"&lt;br /&gt;        DefaultColorDepth 24&lt;br /&gt;        SubSection "Display"&lt;br /&gt;                Depth     24&lt;br /&gt;                Modes "1440x900"&lt;br /&gt;        EndSubSection&lt;br /&gt;EndSection&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-3127945419008617493?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/3127945419008617493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=3127945419008617493' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3127945419008617493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3127945419008617493'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/11/arch-linux-64-bit-installation.html' title='Arch Linux 64 bit installation'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-8160037401426693146</id><published>2009-11-09T17:03:00.000-08:00</published><updated>2009-11-09T17:55:26.023-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='svn verify bash script'/><category scheme='http://www.blogger.com/atom/ns#' term='verify svn repository'/><title type='text'>Simple SVN repository Verification Script</title><content type='html'>Ive been using rsync to back up an SVN repository, which has been working great. Unfortunately though, if a problem occurs within the repo, those problems will then be replicated to the backup location. Ive written a small script (below) that will detect if there is a problem reported by the svnadmin verify command. This obviously isnt the complete script; the complete one performs a backup if the verify is successful, and sends an email if not, but those tasks are well documented elsewhere on the net, so I'll leave them out for clarities sake.&lt;br /&gt;&lt;br /&gt;I would love to see a more elegant way of doing this, if anybody has one.&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# replace /path/to/svnroot to your svnroot&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;svnadmin verify /path/to/svnroot  2&amp;gt;&amp;amp;1 | grep svnadmin:&lt;span class="sb"&gt;`&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;/ /&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;then&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;        &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;SVN repo is verified.&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;        &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;SVN repo error!&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;span class="k"&gt;fi&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-8160037401426693146?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/8160037401426693146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=8160037401426693146' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8160037401426693146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8160037401426693146'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/11/simple-svn-repository-verification.html' title='Simple SVN repository Verification Script'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-4124280764303994537</id><published>2009-11-07T16:39:00.000-08:00</published><updated>2009-11-07T16:54:08.609-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='compression proxy'/><category scheme='http://www.blogger.com/atom/ns#' term='ziproxy'/><category scheme='http://www.blogger.com/atom/ns#' term='speed up internet connection'/><title type='text'>Ziproxy - Speed up your internet connection</title><content type='html'>If you have a slow Internet connection, or have been capped, using ziproxy can help speed up browsing by compressing all the html that goes through it. Its easy to setup, all you need is a server that has a fast connection, that you can connect to.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Installation&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;From your server, either get it from your repository, or download it (Its easy to compile from source) from &lt;a href="http://ziproxy.sourceforge.net/"&gt;http://ziproxy.sourceforge.net/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In ubuntu you can use:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install ziproxy&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Source Install&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;If its not in your repository, you can install it by downloading the source, then installing its dependancies.&lt;br /&gt;In fiesty, they are:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install libgif-dev&lt;br /&gt;apt-get install libungif4-dev&lt;br /&gt;apt-get install libjpeg62-dev&lt;br /&gt;apt-get install libpng12-dev&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If your missing these libries, you'll get one/more of these error messages:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;configure: error: Both libgif and libungif not found.&lt;br /&gt;configure: error: libjpeg not found.&lt;br /&gt;configure: error: libpng not found.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Once installed, it will look for the config file (unless otherwise specified on the command line) here;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/etc/ziproxy/ziproxy.conf &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The easiest way to configure ziproxy, is to create this file. You can now start ziproxy by using:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ziproxy --daemon&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;When you start it, it will then print out the process id. Please note that if it cant run (for example, it cant use the default port 8080) it will fail silently. &lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Configuring&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;There are alot of options you can play with in ziproxy.conf, mostly to do with the compression of various images, but some interesting ones are:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Port=9900&lt;br /&gt;ImageQuality={-15,20,25,0}&lt;br /&gt;UseContentLength=false&lt;br /&gt;ProcessJS=true&lt;br /&gt;ProcessCSS=true&lt;br /&gt;ProcessHTML=true&lt;br /&gt;ProcessHTML_CSS=true&lt;br /&gt;ProcessHTML_JS=true&lt;br /&gt;ProcessHTML_tags=true&lt;br /&gt;ProcessHTML_text=true&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Once thats done, change your proxy settings in your browser, and enjoy the speedy surfing!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-4124280764303994537?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/4124280764303994537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=4124280764303994537' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4124280764303994537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4124280764303994537'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/11/ziproxy-speed-up-your-internet.html' title='Ziproxy - Speed up your internet connection'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-1924165903893727123</id><published>2009-08-20T20:04:00.000-07:00</published><updated>2009-10-23T15:20:01.302-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='psql delete oldest rows function'/><category scheme='http://www.blogger.com/atom/ns#' term='limit table size'/><category scheme='http://www.blogger.com/atom/ns#' term='automatic table size limit postgres'/><category scheme='http://www.blogger.com/atom/ns#' term='postgresql'/><title type='text'>pl/sql trigger that limits table size</title><content type='html'>&lt;h2&gt;Description&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The trigger below executes a pl/sql function that will delete the oldest rows in a table. If a row is inserted into the database it will check to see if the number of rows is greater than 10. If it is,  it will then delete the last two. You will want to customise this&lt;br /&gt;to your needs. This function is particularly useful when dumping log4j records to a postgres database, as it ensures the table size does not get out of control.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;"table" should be replaced with the table name that you wish to limit&lt;br /&gt;"table_limit_trigger" is the name of the trigger.&lt;br /&gt;"limit_table_size()" is the name of the function that performs the delete&lt;br /&gt;Obviously you can replace the maximum size of the table (currently 10), and the number of&lt;br /&gt;records it deletes (currently 2) with whatever you require.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Code&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;TRIGGER&lt;/span&gt; &lt;span class="n"&gt;table_limit_trigger&lt;/span&gt; &lt;span class="k"&gt;on&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;table&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;OR&lt;/span&gt; &lt;span class="k"&gt;REPLACE&lt;/span&gt; &lt;span class="k"&gt;FUNCTION&lt;/span&gt; &lt;span class="n"&gt;limit_table_size&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;RETURNS&lt;/span&gt; &lt;span class="k"&gt;TRIGGER&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;table_limit_trigger&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;DECLARE&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="nb"&gt;INTEGER&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;BEGIN&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="c1"&gt;-- count the number of rows&lt;/span&gt;&lt;br /&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;table&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="n"&gt;cnt&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;&lt;br /&gt;  &lt;span class="c1"&gt;--- sql that deletes the oldest rows&lt;/span&gt;&lt;br /&gt;  &lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;table&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;table&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;ASC&lt;/span&gt; &lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="k"&gt;END&lt;/span&gt; &lt;span class="n"&gt;IF&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;RETURN&lt;/span&gt; &lt;span class="k"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;table_limit_trigger&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="k"&gt;LANGUAGE&lt;/span&gt; &lt;span class="n"&gt;plpgsql&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TRIGGER&lt;/span&gt; &lt;span class="n"&gt;table_limit_trigger&lt;/span&gt; &lt;span class="k"&gt;AFTER&lt;/span&gt; &lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;table&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="k"&gt;EACH&lt;/span&gt; &lt;span class="k"&gt;ROW&lt;/span&gt; &lt;span class="k"&gt;EXECUTE&lt;/span&gt; &lt;span class="k"&gt;PROCEDURE&lt;/span&gt; &lt;span class="n"&gt;limit_table_size&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-1924165903893727123?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/1924165903893727123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=1924165903893727123' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1924165903893727123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1924165903893727123'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/08/plsql-trigger-that-limits-table-size.html' title='pl/sql trigger that limits table size'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-688979940165020449</id><published>2009-08-15T05:26:00.000-07:00</published><updated>2009-08-15T05:40:29.293-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='svn add'/><category scheme='http://www.blogger.com/atom/ns#' term='revert'/><category scheme='http://www.blogger.com/atom/ns#' term='svn command line'/><title type='text'>SVN tools - All Distributions</title><content type='html'>&lt;h2&gt;Revert&lt;/h2&gt;&lt;br /&gt;To revert a folder on your working copy back to a revision within SVN, the following syntax can be used:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;svn copy -r 2450 svn+ssh://username@192.168.1.3/svnroot/project/trunk/dir@2450 ./dir&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This command will revert the specified directory to revision 2450.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Remove svn directories&lt;/h2&gt;&lt;br /&gt;The command below will remove all svn directories within a directory tree.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;find . -name .svn -exec rm -fdr {} \;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;SVN update cron&lt;/h2&gt;&lt;br /&gt;The command below is a crontab line that will automatically update your svn repository every day at 4am.  Make sure your ssh key is setup properly, so that svn doesn't prompt for a password.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;1 4     * * *   root   svn up --accept postpone /home/user/workspace/svnroot&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Adding directories to repository&lt;/h2&gt;&lt;br /&gt;The following command will add all folders from a directory, including subdirectories (even if that directory is already in svn) to the working copy.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;svn add --force ./dir&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-688979940165020449?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/688979940165020449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=688979940165020449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/688979940165020449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/688979940165020449'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/08/svn-tools-all-distributions.html' title='SVN tools - All Distributions'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-2567132735688474472</id><published>2009-08-05T23:08:00.000-07:00</published><updated>2009-08-05T23:22:00.384-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='trac'/><category scheme='http://www.blogger.com/atom/ns#' term='trac project updater'/><category scheme='http://www.blogger.com/atom/ns#' term='trac adminstration'/><title type='text'>Trac project updater script</title><content type='html'>Updates and upgrades all &lt;a href="http://trac.edgewall.org/"&gt;trac&lt;/a&gt; projects in a given directory.&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="c"&gt;# Updates from trac svn, then upgrades all trac projects in given directory.&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;# Finally, restarts apache.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;# files&lt;/span&gt;&lt;br /&gt;&lt;span class="nv"&gt;TRAC_INSTALL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/root/installs/trac_install/trac&lt;br /&gt;&lt;span class="nv"&gt;TRAC_PROJECTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/trac/trac_projects&lt;br /&gt;&lt;span class="nv"&gt;FILES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;ls -l | grep &lt;span class="nv"&gt;$1&lt;/span&gt;^d | gawk &lt;span class="s1"&gt;&amp;#39;{ print $8 }&amp;#39;&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="nv"&gt;APACHE_RESTART_CMD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/etc/init.d/apache2 restart&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;updating repository&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;svn up &lt;span class="nv"&gt;$TRAC_INSTALL&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# re-install&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="nv"&gt;$TRAC_INSTALL&lt;/span&gt;&lt;br /&gt;./setup.py install&lt;br /&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; -&lt;br /&gt;&lt;br /&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;update the projects/wiki&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="nv"&gt;$TRAC_PROJECTS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;for &lt;/span&gt;f in &lt;span class="nv"&gt;$FILES&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;do&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Processing project: $f&amp;quot;&lt;/span&gt;&lt;br /&gt;  trac-admin &lt;span class="nv"&gt;$f&lt;/span&gt; upgrade&lt;br /&gt;  trac-admin &lt;span class="nv"&gt;$f&lt;/span&gt; wiki upgrade&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;done&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;restarting apache&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="nv"&gt;$APACHE_RESTART&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-2567132735688474472?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/2567132735688474472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=2567132735688474472' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2567132735688474472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2567132735688474472'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/08/trac-project-updater-script.html' title='Trac project updater script'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5564628557947758190</id><published>2009-07-31T15:48:00.000-07:00</published><updated>2009-07-31T15:54:10.306-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux and windows'/><category scheme='http://www.blogger.com/atom/ns#' term='free online storage'/><category scheme='http://www.blogger.com/atom/ns#' term='drop box'/><title type='text'>DropBox - Online Storage</title><content type='html'>If your looking for some FREE online storage, and for a quick way to share files between computers, look no further than DropBox! The app supplied works flawlessly in BOTH Windows AND Linux (Ubuntu), and is very useful for storing...well pretty much anything! You get 2 gigs to use absolutely FREE, and can pay for more if required. Plus, you can view and manage all your files via the web, AND share folders with friends.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://www.getdropbox.com/referrals/NTE1MDk5ODc5"&gt;Get DropBox Here!&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5564628557947758190?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5564628557947758190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5564628557947758190' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5564628557947758190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5564628557947758190'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/07/dropbox-online-storage.html' title='DropBox - Online Storage'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-6148356268885272571</id><published>2009-07-25T18:07:00.000-07:00</published><updated>2009-07-25T18:11:35.276-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='you tube'/><category scheme='http://www.blogger.com/atom/ns#' term='9.04'/><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='sound'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='jaunty'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Flash Sound Not Working On Jaunty 9.04</title><content type='html'>If your sound isnt working with flash in Firefox (i.e youtube) on Ubuntu Jaunty (9.04), try installing this package:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sudo apt-get install  flashplugin-nonfree-extrasound&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then restart your browser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-6148356268885272571?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/6148356268885272571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=6148356268885272571' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6148356268885272571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6148356268885272571'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/07/flash-sound-not-working-on-jaunty-904.html' title='Flash Sound Not Working On Jaunty 9.04'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-7902418623718665773</id><published>2009-07-14T21:15:00.000-07:00</published><updated>2009-07-14T21:38:02.870-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ssh port fowarding'/><title type='text'>Port Fowarding via SSH</title><content type='html'>Port forwarding through SSH is really useful, for many reasons such as wrapping an insecure protocol with ssh, or if you need to bypass a restrictive server and have ssh access to a server within a required network.&lt;br /&gt;I think learning this is best by example, so I'll explain one below.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ssh -L &lt;b&gt;local_port&lt;/b&gt;:&lt;b&gt;end_server&lt;/b&gt;:&lt;b&gt;end_port&lt;/b&gt; user@&lt;b&gt;mid_point&lt;/b&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;local_port is the port that ssh will listen to on your local machine.&lt;br /&gt;end_server is the server at the end of the tunnel.&lt;br /&gt;end_port is the servers port at the end of the tunnel.&lt;br /&gt;user@mid_point is the ssh server in between you and the server.&lt;br /&gt;&lt;br /&gt;For example, if you want to tunnel terminal services, you could use this command&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ssh -L 3389:192.168.1.99:3389 myuser@192.168.1.55&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The first 3389 is the port on your local machine that ssh will listen on.&lt;br /&gt;&lt;br /&gt;192.168.1.99 is the ip address of the remote server that's running terminal services that you wish to connect to.&lt;br /&gt;&lt;br /&gt;The second 3389 is the port on the remote machine (in this case, the terminal services port).&lt;br /&gt;&lt;br /&gt;myuser@192.168.1.55 is the login details for the machine on the same network as the terminal services server.&lt;br /&gt;&lt;br /&gt;Running that command will then prompt for "myuser"'s password. Entering it in will open the port 3389 on your machine. To connect to the remote machine, point your terminal services client (in Ubuntu thats tsclient) to localhost, and put in the username and password that you usually use to log in to terminal service.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-7902418623718665773?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/7902418623718665773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=7902418623718665773' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7902418623718665773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7902418623718665773'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/07/port-fowarding-via-ssh.html' title='Port Fowarding via SSH'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-48279692055295333</id><published>2009-07-12T04:08:00.000-07:00</published><updated>2009-10-23T15:25:21.011-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gpg'/><category scheme='http://www.blogger.com/atom/ns#' term='windows and linux encryption'/><title type='text'>Simple Linux and Windows File Encryption</title><content type='html'>If your after a quick and easy way to encrypt files with a simple password (and cant be bothered with keys etc) in Linux AND Windows check out gpg. Gpg supports "symmetric", which only requires a pass phrase to encrypt &amp; decrypt. To encrypt in Linux, just use this command:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;gpg --symmetric&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If your lucky enough to be using Ubuntu (Im sure all the other major distro's will support this too), you can right click on a *.gpg, and it will prompt for the pass-phrase. &lt;br /&gt;&lt;br /&gt;To encrypt/decrypt in windows you need to install the GPG package. It can be found at the site below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.gnupg.org/"&gt;http://www.gnupg.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Please don't use this for highly sensitive data; the encryption is only as safe as the password you choose, and there are more secure ways of encrypting data. Check out all the features of gpg for details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-48279692055295333?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/48279692055295333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=48279692055295333' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/48279692055295333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/48279692055295333'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/07/simple-linux-and-windows-file.html' title='Simple Linux and Windows File Encryption'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-2476297630357580162</id><published>2009-06-29T22:36:00.000-07:00</published><updated>2009-07-06T19:06:13.184-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mounting dd image'/><title type='text'>Manually Mounting A Partition From An Image</title><content type='html'>Using dd, you can create a dump of a harddrive, directly to a disk. This is useful if you want to make a backup of a compact flash. For example&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;dd in=/dev/sdb0 of=myfile.dmp&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Will write the entire contents of the sdb0 device, into a file called myfile.dmp. You can then use dd to write that file back to another flashcard.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Mounting image to file system&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;If you want to see the contents of an image, you need to use mount with -o (loop back) specified. The tricky part is working out the offset, which is the byte that the partition you wish to load starts at. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Disk myfile.dmp: 0 MB, 0 bytes&lt;br /&gt;255 heads, 63 sectors/track, 0 cylinders&lt;br /&gt;Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;Disk identifier: 0x0003ba1c&lt;br /&gt;&lt;br /&gt;Device Boot           Start         End      Blocks    Id  System&lt;br /&gt;myfile.dmp1   *           1         182      1461883+  83  Linux&lt;br /&gt;myfile.dmp2             183         249      538177+   82  Linux swap / Solaris&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To mount the first partition all you need to do is specify an offset of 512 (bytes) * 63 (sectors) = 32256B, which is where the first partition starts. The full command is:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mount -o loop,ro,offset=32256 myfile.dmp&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The formula for calculating partitions after the first one is is (unit - 1) * unit size.&lt;br /&gt;&lt;br /&gt;And to mount the second partition it would be 182 * 8225280 = 1497000960 (In this example you cant mount it, as its swap space). To mount it you would use&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mount -o loop,ro,offset=1497000960 myfile.dmp&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can also use parted to do the calculations for you. Here is a very useful link:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.andremiller.net/content/mounting-hard-disk-image-including-partitions-using-linux"&gt;Mounting Linux Images&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-2476297630357580162?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/2476297630357580162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=2476297630357580162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2476297630357580162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2476297630357580162'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/06/manually-mounting-partition-from-image.html' title='Manually Mounting A Partition From An Image'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-8486579652918479064</id><published>2009-05-10T02:40:00.000-07:00</published><updated>2009-11-08T16:50:55.867-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='knowledge tree install guide'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='knowledge tree'/><title type='text'>KnowledgeTree Manual Install</title><content type='html'>This tutorial describes how to install the open source version of knowledge tree (www.knowledgetree.com/ ) manually on Ubuntu (8.10, but any recent version should be similar). This is required when you have an existing install of apache and/or mysql, and you wish to use the same installs for KT as the installer binary cannot handle using existing versions of these services.&lt;br /&gt;Remember, whenever I have quoted a directory its is relative to wherever you have uncompressed the source.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Installation&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Firstly download the installation files (http://www.knowledgetree.com/community-download)and, place in /var/www. (Not the .bin installer file; you need the source files; it will have a name like: ktdms-src-oss-3.6.0.tgz)&lt;br /&gt;&lt;br /&gt;Chown and chgrp all files to www-data (or whatever user is used to run scripts by apache). For example&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;chown www-data -R /var/www/kt-dms-oss&lt;br /&gt;chgrp www-data -R /var/www/kt-dms-oss&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Update the file with /etc/apache2/sites-enabled/000-sites-enabled, with the site details, as shown below.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;Directory /var/www/kt-dms-oss&gt;&lt;br /&gt;        AddType text/html .php .phps&lt;br /&gt;        AddHandler application/x-httpd-php .php&lt;br /&gt;        AddHandler application/x-httpd-php-source .phps&lt;br /&gt;        Options Indexes FollowSymLinks MultiViews&lt;br /&gt;        AllowOverride None&lt;br /&gt;        Order allow,deny&lt;br /&gt;        allow from all&lt;br /&gt;&lt;/Directory&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Next, install apaches php5 and php-mysql modules, so that KT can execute its php scripts.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install libapache2-mod-php5 php5-mysql&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note, if you do not have the php5 module installed, it will attempt to download the php files when you browse to them. After you install the modules you will need to force-reload apache, AND clear the cache of your browser.&lt;br /&gt;&lt;br /&gt;If you do not have php-mysql installed, you will get this error:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[db_error: message="DB Error: extension not found" code=-25 mode=return &lt;br /&gt;level=notice prefix="" info="Array"]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I needed to manually set the document root, otherwise KT would redirect to the wrong location.&lt;br /&gt;The settings for setting document root in /config/config.ini&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;rootUrl = /kt-dms-oss&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Next, you need to update the database details in the same config.ini file. Set it up with a valid msql user.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;; Database login details&lt;br /&gt;dbHost           = localhost&lt;br /&gt;dbName           = dms&lt;br /&gt;dbUser           = root&lt;br /&gt;dbPass           =&lt;br /&gt;dbPort           = default&lt;br /&gt;&lt;br /&gt;dbAdminUser      = &lt;br /&gt;dbAdminPass      =&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you do not setup the database correctly you will get this error.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[db_error: message="DB Error: connect failed" code=-24 mode=return level=notice prefix="" &lt;br /&gt;info=" [nativecode=Access denied for user 'root'@'localhost' (using password: YES)] ** Array"]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The problem is that KT cannot log in with username and password. You need to set these settings in config.ini with a valid user.&lt;br /&gt;&lt;br /&gt;Next, create the database&lt;br /&gt;&lt;br /&gt;log into mysql, and execute&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;create database dms;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Logout of mysql.&lt;br /&gt;&lt;br /&gt;Next, we need to init the database structure and content. The scripts are located here:&lt;br /&gt;&lt;br /&gt;sql/mysql/install&lt;br /&gt;&lt;br /&gt;Run these commands, (in sql/mysql/install)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mysql -uroot dms &lt; structure.sql&lt;br /&gt;mysql -uroot dms &lt; data.sql&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you do not have the database installed correctly you will receive this error:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[db_error: message="DB Error: no such database" code=-27 mode=return &lt;br /&gt;level=notice prefix="" info=" [nativecode=Unknown database 'dms'] ** Array"]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Or,&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Fatal error: Cannot use object of type DB_Error as array in /var/www/kt-dms-oss/lib/session/Session.inc on line 253&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now you must upgrade the database.&lt;br /&gt;&lt;br /&gt;run setup/upgrade.php. You may get the following error:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;-bash: ./upgrade.sh: /bin/sh^M: bad interpreter: No such file or directory&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you do, run:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;perl -i -pe's/\r$//;' upgrade.php&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If the upgrade has not been performed, you may get the error "Session timed out" when trying to log in.&lt;br /&gt;&lt;br /&gt;Now, to check the status of the install run:&lt;br /&gt;&lt;br /&gt;setup/precheckup.php&lt;br /&gt;&lt;br /&gt;Restart apache.&lt;br /&gt;&lt;br /&gt;You should now be able to login to Knowledge via login.php, using username "admin", password "admin".&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Memory Issues&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;I had to increase the amount of memory php was allowed to use. Errors like these would come up:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Fatal error: Allowed memory size of 16777216 bytes exhausted &lt;br /&gt;(tried to allocate 19456 bytes) in /var/www/kt-dms-oss/plugins/ktstandard/workflow/FolderAssociator.php on line 174&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To fix this, increase the memory limit in /etc/php5/apache2/php.ini &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;memory_limit = 32M      ; Maximum amount of memory a script may consume (16MB)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;restart apache.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/etc/init.d/apache2 restart&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Bulk Importing&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Be careful doing bulk file uploads on the server. Make sure:&lt;br /&gt;&lt;br /&gt;1. The folders don't contain any files bigger than 2M (you can increase this limit in php.ini).&lt;br /&gt;2. KT has access to all the folders and files within the directory you choose to upload.&lt;br /&gt;3. You have some spare time; the process can take a while!&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The scheduler&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;The scheduler takes care of managing and running tasks or batch jobs at regular intervals in the background. If its running correctly, you will see useful server stats when logged in as an administrator. To execute php scripts on the server you need to install php5-cli package.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sudo apt-get install php5-cli&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then, add the following line to your /etc/crontab&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# execute knowledgetree scheduler to execute at 3am every night&lt;br /&gt;0 3 * * * root (php /var/www/kt-dms-oss/bin/scheduler.php &gt; /dev/null)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Document Indexer&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;If the indexer isnt setup correctly, you will get this error when searching:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;The Document Indexer did not respond correctly. Your search results will not include content results. Please notify the system administrator to investigate why the Document Indexer is not running.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Looking under the administration tab, you will likely find errors like this.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    * Message: Cannot connect to Open Office Server on host '127.0.0.1:8100'.&lt;br /&gt;    * This could be due to OpenOffice.org not having been started, OR not installed&lt;br /&gt;    * For more information, please see: http://wiki.knowledgetree.com/Troubleshooting_OpenOffice.org_Service&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To fix this, install open office as explained below&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Installing Open Office&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;In Ubuntu, there's a simple way to solve this.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install java-6-sun-jre&lt;br /&gt;update-alternatives --config java # Select the appropriate option&lt;br /&gt;apt-get install openoffice.org-headless openoffice.org-java-common&lt;br /&gt;sudo soffice -headless -accept="socket,host=localhost,port=8100;urp;" -nofirststartwizard&amp;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note, if you get this error if you dont have openoffice.org-java-common installed:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;javaldx: Could not find a Java Runtime Environment! &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, as per the documention, running this command&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;netstat -an | grep 8100&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;will show the open office server running on that port.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Installation on Ubuntu Feisty&lt;/h2&gt;&lt;br /&gt;&lt;h3&gt;Exporting to PDF&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;An error occurred generating the PDF - please contact the system administrator. PyODConverter: Cannot find the pyuno.so library in sys.path and known paths.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To fix it:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sudo apt-get install python-uno # will install all the required libraries (note that openoffice-server doesnt exist in this version)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now you need to start the server and setup a fake display (if your running this on a headless server anyway), otherwise you'll get this error on the client:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;An error occurred generating the PDF - please contact the system administrator. OpenOffice process not found or not listening (Connector : couldn't connect to socket (Success))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And this error when you try start the open office server:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sudo soffice -headless -accept="socket,host=localhost,port=8100;urp;" -nofirststartwizard&amp;&lt;br /&gt;&lt;br /&gt;/usr/lib/openoffice/program/soffice.bin X11 error: Can't open display: &lt;br /&gt;   Set DISPLAY environment variable, use -display option&lt;br /&gt;   or check permissions of your X-Server&lt;br /&gt;   (See "man X" resp. "man xhost" for details)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To setup a fake display, run this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install xvfb # install required package&lt;br /&gt;&lt;br /&gt;# start display&lt;br /&gt;unset XAUTHORITY&lt;br /&gt;DISPLAY=:1000&lt;br /&gt;export DISPLAY&lt;br /&gt;killall Xvfb&lt;br /&gt;Xvfb $DISPLAY &amp;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now you should be able to start the server using this command:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sudo soffice -headless -accept="socket,host=localhost,port=8100;urp;" -nofirststartwizard&amp;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The next step is to install the required open office packages that will export the required documents. If you dont, you'll get an error message like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;An error occurred generating the PDF - please contact the system administrator. Given parameters don't conform to the specification ( URL seems to be an unsupported one.)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Openoffice needs the required packages to process the request. i.e an odt. doc needs openoffice.org-writer installed.&lt;br /&gt;To get all of them quickly, just install the whole openoffice.org package.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install openoffice.org&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;you will need to restart the soffice daemon for the changes to take effect.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Indexer&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Once the openoffice server is running you need to start KT_LOCATION/bin/luceneserver/ktlucene.jar&lt;br /&gt;Starting this, and the open office daemon is shown below.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;OpenOffice and Indexer Startup Script&lt;/h2&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;KT_LOCATION=/var/www/knowledgetree&lt;br /&gt;&lt;br /&gt;# start indexer&lt;br /&gt;&lt;br /&gt;cd $KT_LOCATION/bin/luceneserver/&lt;br /&gt;java -jar ktlucene.jar&amp;&lt;br /&gt;&lt;br /&gt;# start fake screen&lt;br /&gt;&lt;br /&gt;set DISPLAY=:1000&lt;br /&gt;export DISPLAY&lt;br /&gt;Xvfb $DISPLAY &amp;&lt;br /&gt;&lt;br /&gt;# start open office server&lt;br /&gt;&lt;br /&gt;soffice -accept="socket,host=localhost,port=8100;urp" -nofirststartwizard&amp;&lt;br /&gt;&lt;br /&gt;cd  -&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Be careful when you run this command; the indexer may not be configured correctly. You may get this error:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;2    [main] INFO  com.knowledgetree  - Loading properties file: KnowledgeTreeIndexer.properties&lt;br /&gt;423  [main] INFO  com.knowledgetree  - Server in paranoid mode!&lt;br /&gt;443  [main] INFO  com.knowledgetree  -  Accepting connections from: 127.0.0.1&lt;br /&gt;444  [main] INFO  com.knowledgetree  -  Accepting connections from: 192.168.1.1&lt;br /&gt;555  [main] INFO  com.knowledgetree.lucene  - Indexer starting up...&lt;br /&gt;583  [main] INFO  com.knowledgetree.lucene  - Loading properties file: KnowledgeTreeIndexer.properties&lt;br /&gt;583  [main] INFO  com.knowledgetree.lucene  - Using index directory: ../../../var/indexes&lt;br /&gt;Exception in thread "main" java.lang.Exception: Invalid index directory specified: ../../../var/indexes&lt;br /&gt; at com.knowledgetree.indexer.IndexerManager.&lt;init&gt;(IndexerManager.java:160)&lt;br /&gt; at com.knowledgetree.indexer.IndexerManager.get(IndexerManager.java:92)&lt;br /&gt; at com.knowledgetree.lucene.KTLuceneServer.main(KTLuceneServer.java:71)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you do, edit KnowledgeTreeIndexer.properties (in bin/luceneserver), and change the indexer.directory line to:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;indexer.directory=../../var/indexes&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-8486579652918479064?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/8486579652918479064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=8486579652918479064' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8486579652918479064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8486579652918479064'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/05/knowledgetree-manual-install.html' title='KnowledgeTree Manual Install'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-3550821881514202351</id><published>2009-02-28T03:17:00.000-08:00</published><updated>2009-06-08T16:29:25.147-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='piping'/><category scheme='http://www.blogger.com/atom/ns#' term='dump'/><category scheme='http://www.blogger.com/atom/ns#' term='stream data'/><category scheme='http://www.blogger.com/atom/ns#' term='streaming sql database dump'/><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><category scheme='http://www.blogger.com/atom/ns#' term='remote to local database dump'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='postgresql'/><title type='text'>Streaming database to remote machine</title><content type='html'>If you need to backup a remote database but dont have room on your remote machine to make a database dump file (of which you could use scp to transfer), you can use ssh to stream the dump as its created.&lt;br /&gt;&lt;br /&gt;Executing this command on your local machine will run postgres's dump command on the remote machine (in this case 192.168.1.2) and pipe it back through the ssh pipe, into a file on your local machine called database_dump_file. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ssh databaseuser@192.168.1.2 'pg_dump your_database' &gt; database_dump_file&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If this is over the internet, you may wish to use ssh's -C flag, to compress the stream.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-3550821881514202351?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/3550821881514202351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=3550821881514202351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3550821881514202351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3550821881514202351'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2009/02/streaming-database-to-remote-machine.html' title='Streaming database to remote machine'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-6801658858008300768</id><published>2008-10-11T20:50:00.000-07:00</published><updated>2008-10-11T21:03:39.670-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VPN'/><category scheme='http://www.blogger.com/atom/ns#' term='VPN through firewall'/><category scheme='http://www.blogger.com/atom/ns#' term='linux vpn'/><category scheme='http://www.blogger.com/atom/ns#' term='switch vpn'/><category scheme='http://www.blogger.com/atom/ns#' term='tinc'/><title type='text'>Glorious Tinc - Ubuntu</title><content type='html'>Tinc (http://www.tinc-vpn.org/) is an awesome VPN daemon. Its secure, its fast and its lightweight.&lt;br /&gt;&lt;br /&gt;I am going to explain how to setup a simple network where each machine is on the same subnet, and connects to and routes through a central computer, which behaves like a switch. This is useful when you need to create a network where some of the computers behind a firewall. With this configuration, only the central computer on the network needs to allow incoming connections.&lt;br /&gt;For simplicity I will call the computer that must allow incoming connections and acts like a switch "central", and go through configuring it and one "leaf" pc that connects to it. Setting up additional "leaf" pcs, is just the same, except you will need to give them each a unique name and IP address.&lt;br /&gt;&lt;br /&gt;You will need to do this on the central computer:&lt;br /&gt;&lt;br /&gt;1) install tinc (apt-get install tinc on Ubuntu)&lt;br /&gt;2) install brctl  (apt-get install bridge-utils)&lt;br /&gt;3) install tun (this is a kernel module; compiled in by default with Ubuntu)&lt;br /&gt;4) setup tinc's configuration&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Leaf configuration&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;Tinc's configuration is in /etc/tinc&lt;br /&gt;&lt;br /&gt;Firstly, you need to create a directory for your vpn configuration. Call it what you like, but in this case Im going to call it "vpn".&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mkdir /etc/tinc/vpn&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Next, edit nets.boot, and add vpn at the bottom of it, like so:&lt;br /&gt;&lt;br /&gt;/etc/tinc/net.boot&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;## This file contains all names of the networks to be started on system startup.&lt;br /&gt;vpn&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;From now on, all configuration is done from within the "vpn" folder.&lt;br /&gt;The tinc-up file is executed when the vpn is brought "up". It must be executable by root (as root, chmod u+x tinc-up) See below for the example of a nodes tinc-up file. Note that 192.168.7.22 is the address that our node will be given on the vpn.&lt;br /&gt;&lt;br /&gt;/etc/tinc/vpn/tinc-up&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;modprobe tun&lt;br /&gt;ifconfig vpn 0.0.0.0&lt;br /&gt;ifconfig vpn up&lt;br /&gt;&lt;br /&gt;brctl addbr bridge&lt;br /&gt;brctl addif bridge vpn&lt;br /&gt;ifconfig bridge 192.168.7.22 netmask 255.255.255.0 #this IP address is our leafs VPN address&lt;br /&gt;ifconfig bridge up&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Next, we need to configure the tinc.conf file for the vpn. &lt;br /&gt;Name is the name of the local node. Connects to is the node that our leaf node connects to (in this case the central node). Switch mode means that any packets received by the bridge will be passed through to our vpn and tinc keeps and ARP cache to determine if any packets we wish to send should be sent out our vpn interface.    &lt;br /&gt;&lt;br /&gt;/etc/tinc/vpn/tinc.conf &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Name = leafPC&lt;br /&gt;ConnectTo = central&lt;br /&gt;Device = /dev/net/tun&lt;br /&gt;Mode = switch&lt;br /&gt;PrivateKeyFile = /etc/tinc/vpn/rsa_key.priv&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Dont worry about the private key reference; we'll generate that shortly. Now, we need to setup the hosts we will communicate on the vpn. Seeing as we only connect to the central node, we only need to define this leaf and the central node. Create a directory in vpn called "hosts". Now create a file called "central". This is the details of the central computer we will communicate through. Note that the address field is the ACTUAL IP of the central PC, not its VPN address. Subnet is the subnet that the node is responsible for, in this case its our entire VPN. &lt;br /&gt;&lt;br /&gt;# /etc/tinc/vpn/hosts/central&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Address = 192.168.1.44   # actual IP address of central&lt;br /&gt;Subnet = 192.168.7.0/24   # vlan subnet&lt;br /&gt;TCPOnly = yes&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;br /&gt;We also need to put our leafs detail in as well. The address field is the leafs PUBLIC IP address &lt;br /&gt;&lt;br /&gt;# /etc/tinc/vpn/hosts/leafPC&lt;br /&gt;Address = 192.168.1.22   # public ip address&lt;br /&gt;TCPOnly = yes&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Generating the keys&lt;/h3&gt;&lt;br /&gt;The next thing to do is to generate a private key for the node. This private key needs to be copied into every node that this one will connect to; in our case, the central. Do this by entering this command:&lt;br /&gt;&lt;br /&gt;tincd -n vpn -K&lt;br /&gt;&lt;br /&gt;The command should then output something like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Please enter a file to save private RSA key to [/etc/tinc/vpn/rsa_key.priv]: &lt;br /&gt;Please enter a file to save public RSA key to [/etc/tinc/vpn/hosts/leaf]:&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Your leaf node configuration is nearly complete. The only thing left to do is to copy the leafs public key to the central computer, and visa versa so that the connection can be authenticated.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Central configuration&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;Configuring the central is similar to setting up a leaf node. &lt;br /&gt;&lt;br /&gt;1) add VPN to nets.boot&lt;br /&gt;2) create directory called vpn&lt;br /&gt;3) create executable tinc-up file in this folder, with the following contents:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;modprobe tun&lt;br /&gt;ifconfig $INTERFACE 192.168.7.2 netmask 255.255.255.0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;4) create tinc.conf file with the following contents:&lt;br /&gt;&lt;br /&gt;Name = central&lt;br /&gt;Device = /dev/net/tun&lt;br /&gt;Mode = switch&lt;br /&gt;PrivateKeyFile = /etc/tinc/vpn/rsa_key.priv&lt;br /&gt;&lt;br /&gt;5) create hosts folder&lt;br /&gt;&lt;br /&gt;6) create a file called central which should contain this:&lt;br /&gt;&lt;br /&gt;Address = 192.168.1.44   # PUBLIC IP address of central&lt;br /&gt;Subnet = 192.168.7.0/24  # Subnet of vpn&lt;br /&gt;TCPOnly = yes&lt;br /&gt;&lt;br /&gt;8) rerun tincd -n vpn -K to general your public and private keys.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Setting up public / private keys&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;The final step is to copy the PUBLIC keys and all of the settings of each node to each other. For example, you must copy the host file ./hosts/central to ./hosts/central on your leaf machine, and ./hosts/leaf on your leaf machine to ./hosts/leaf. Each of theses should both contain the RSA PUBLIC key at the bottom of the file.&lt;br /&gt;&lt;br /&gt;You should now be able to start tinc using &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/etc/init.d/tinc start &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If everything is going to plan, you should now have an interface called bridge with the IP address you specified, and should be able to ping the vlan central ip address!&lt;br /&gt;&lt;br /&gt;# troubleshooting&lt;br /&gt;&lt;br /&gt;To run tinc in Debug Mode:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;tincd -n vpn -d5 -D&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;common errors&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;the host entry on the central and leaf need to be EXACTLY the same. If your getting error messages like "bogus" data received or the connection being closed repeatedly, copy and paste the entry from the leaf into the appropriate server file, and restart the tinc on the server.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;tincd 1.0.8 (Nov  2 2007 17:40:21) starting, debug level 5&lt;br /&gt;Invalid name for myself!&lt;br /&gt;Terminating&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Name cannot contain some characters, such as "-".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-6801658858008300768?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/6801658858008300768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=6801658858008300768' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6801658858008300768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6801658858008300768'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/10/glorious-tinc-ubuntu.html' title='Glorious Tinc - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-7900126463448615283</id><published>2008-08-14T20:26:00.000-07:00</published><updated>2008-08-21T23:26:44.244-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SVN repository merge'/><title type='text'>Merging SVN repositories - Linux</title><content type='html'>&lt;h2&gt;Merging SVN repositories&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Initially, in my finite wisdom, I thought that putting each project into a separate SVN repository was a good idea. It turns out get a little annoying, mostly because every time we need to create a new project, I have to create a new repository on the server. It will also get more annoying down the track, when we want to setup mirrors of the repository. Plus, there really no point in having multiple repositories, so I decided to merge them.&lt;br /&gt;&lt;br /&gt;Firstly, because each of the repositories will have different UUID's (SVN's repository identifier), you will need to make sure you check in ALL changes of the repos to be merged before doing the migration because you cannot switch your existing working copies to commit to the new repo. (See below if you accidentally do this)&lt;br /&gt;&lt;br /&gt;Once thats done, create a dump file of your old repo:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;svnadmin dump myRepo &gt; dumpfile.dump&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Next step is to load it into you new repository. Create a new folder in your new repository (if required; I needed to because I had just put my trunk, branches and tags folder into the root folder). and commit it. Now all you need to do is load the old repo into your new repo.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;svnadmin load myNewRepo  --parent-dir projectRoot &lt; dumpfile.dump  &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Ive been making changes on the wrong working copy; what do I do?&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Easy; just use svn diff on your old working copy, then patch your new working copy.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;svn diff &gt; oldrep.diff&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then from the same directory in the new working copy:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;patch -p0 &lt; oldrepo.diff &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you missed adding any files you can add them using this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;svn status | grep "^\?" | awk '{print $2}' | xargs svn add&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note that this handy snip-it this is not mine; I got it from this web site: http://snipplr.com/view/5745/svn-add-recursively/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-7900126463448615283?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/7900126463448615283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=7900126463448615283' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7900126463448615283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7900126463448615283'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/08/merging-svn-repository-linux.html' title='Merging SVN repositories - Linux'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-3534985309945710355</id><published>2008-08-13T23:52:00.000-07:00</published><updated>2008-08-14T00:00:18.503-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='phppgadmin setup'/><title type='text'>PhpPgAdmin - Ubuntu</title><content type='html'>Phppgadmin is an great tool for browsing PostgreSQL databases via a web interface. Installation is easy:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install phppgadmin&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In /etc/phpmyadmin/apache.conf copy paste the contents into apaches configuration..i.e&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/etc/apache2/sites-enabled# nano 000-default &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, you'll need to setup a non-root user to login. If you dont, using a root user will result in this error:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Login disallowed for security reasons.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To do so, edit the phppgadmin config file here:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/etc/phppgadmin/config.inc.php&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Modify the line, to allow access for your root user ( postgres )&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$conf['extra_login_security'] = false;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To create a user, login to phppgadmin using postgres, click on users create a user with desired privileges and logout.&lt;br /&gt;&lt;br /&gt;Finally, edit config.inc.php and reset extra_login_security to true. You can now login with your newly created user.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-3534985309945710355?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/3534985309945710355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=3534985309945710355' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3534985309945710355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3534985309945710355'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/08/phppgadmin-ubuntu.html' title='PhpPgAdmin - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-9059806895416645157</id><published>2008-08-10T23:24:00.000-07:00</published><updated>2008-08-21T23:24:41.462-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='recursive backup'/><category scheme='http://www.blogger.com/atom/ns#' term='Dar backup script'/><category scheme='http://www.blogger.com/atom/ns#' term='selective backup'/><title type='text'>Dar Backup Script</title><content type='html'>The below script allows you to backup selective directories using dar. It works by creating a custom dar command, executing the command and burning each dar file to CD / DVD. It allows you to selectively ignore directories that contain a file (by default it looks for a file called .nobackup), which is helpful if you have some large files in selective directories that you dont wish to backup.&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="c"&gt;#!/usr/bin/python&lt;/span&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;io&lt;/span&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;string&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;#######################Python Backup Script#########################################&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##This script allows you to backup selective directories using dar. &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##It has a couple of handy features:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;##&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##1) It will ignore any directory containing a file called ".nobackup".(configurable) &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##2) Any directories put into the ignore list will be ignored recursively.&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##3) It will write these to DVD / CD, and prompt to enter next disk.&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##4) It dar files once burnt to disk.&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##Source: http://programminglinuxblog.blogspot.com/ &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##License: GPLv3. See http://www.gnu.org/licenses/gpl.html &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;####################################################################################&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# All directories off ROOT_PATH are by included by default unless they are put in the&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;# exclude or ignore lists.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# IGNORE_FILENAME if a file with this file name is found dar will not backup anything &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;# in the directory its contained in. It is NOT recursive, thus subdirectories will be &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;# considered for backup.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;IGNORE_FILENAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;".nobackup"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# Saves the executed dar command in this file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;COMMAND_FILE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"command"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# Saves the output of the dar command in this file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;COMMAND_OUTPUT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"output"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# BACK_SAVE_LOC is where the dar file will be saved. WARNING: this directory should &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;# be an ignored directory or in a sub directory of one of these directories.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;BACK_SAVE_LOC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"/root/backups/"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# the name of the dar file(s) that will be created&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;BACKUP_FILENAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"full"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# The root directory to backup from&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;ROOT_PATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"/"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# exclude is a list of directories to exclude from backup. &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;# WARNING: these directories must be RELATIVE to ROOT_PATH.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;exclude&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# NOTE: all subdirectories of these directories are ignored (i.e a recursive ignore)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# Example Ignore:&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;# ignore = ["bin", "dev","initrd","lib","media","proc","tmp", "vmlinuz","boot","etc", &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;#            "mnt","root","srv","cdrom","lost+found","opt","sbin","sys","var"]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;ignore&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BACK_SAVE_LOC&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c"&gt;# ( WARNING: dont modify )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;stack&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;   &lt;span class="c"&gt;# stack for directories to include   ( WARNING: dont modify )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# recursive method that sets up stack and exclude lists with the appropriate directories.&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_backup_directories&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rootDir&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;listdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rootDir&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;        &lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rootDir&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;  &lt;span class="c"&gt;# if current file is a dir&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span class="n"&gt;ignoreDir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;False&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;ig&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ignore&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="c"&gt;# check if its in ignore list&lt;/span&gt;&lt;br /&gt;                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ROOT_PATH&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ig&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                    &lt;span class="n"&gt;ignoreDir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;True&lt;/span&gt;&lt;br /&gt;                    &lt;span class="k"&gt;break&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;ignoreDir&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;                &lt;span class="n"&gt;get_backup_directories&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;            &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;               &lt;span class="n"&gt;exclude&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;     &lt;span class="n"&gt;shortpath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;basename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;     &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;shortpath&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;IGNORE_FILENAME&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c"&gt;# remove directory if ignore file present&lt;/span&gt;&lt;br /&gt;                &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                &lt;br /&gt;  &lt;span class="n"&gt;exclude&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IGNORE_FILENAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="c"&gt;# remove filename &lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;get_backup_directories&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ROOT_PATH&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# excplicitly included directories also includes sub-directories; this removes any sub-directories&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;# of already included directories&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s"&gt;"normalising include stack"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;    &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;br /&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span class="k"&gt;del&lt;/span&gt; &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;br /&gt;            &lt;span class="k"&gt;break&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;br /&gt;    &lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s"&gt;"normalised: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# now to make all exclude paths realitive&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s"&gt;"relativising exclude paths"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exclude&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;    &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;exclude&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;br /&gt;    &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ROOT_PATH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;"\ "&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;       &lt;span class="c"&gt;# delmit space characters&lt;/span&gt;&lt;br /&gt;    &lt;span class="n"&gt;exclude&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# same for include paths&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s"&gt;"relativising include paths"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;    &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;    &lt;br /&gt;    &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ROOT_PATH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;br /&gt;    &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;"\ "&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c"&gt;# delmit space characters&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# NOTE: -v verbose,-c filename, -s size, -z gzip  compression, set root folder, ignore All files&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;baseCmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"dar -v -c "&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;BACK_SAVE_LOC&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;BACKUP_FILENAME&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" -s 4000M -z -R "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ROOT_PATH&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s"&gt;" -P . "&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# include directories&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;    &lt;span class="n"&gt;baseCmd&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s"&gt;"-g "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# exclude directories&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;exclude&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;   &lt;span class="n"&gt;baseCmd&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s"&gt;"-P "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s"&gt;"executing command: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;baseCmd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"echo "&lt;/span&gt;  &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;baseCmd&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" &amp;gt; "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;COMMAND_FILE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;# save to file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;baseCmd&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" &amp;gt; "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;COMMAND_OUTPUT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c"&gt;# also save to file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# write each file to cd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;listdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# remove all non-dar files&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;br /&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;endswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;".dar"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                &lt;span class="k"&gt;del&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s"&gt;"you will need "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" disks. Starting burning process..."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;raw_input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Please insert a CD/DVD. Press any key to continue.'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"growisofs -Z /dev/dvd -R -J "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;BACK_SAVE_LOC&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;curr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;br /&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"eject"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# cleanup&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"rm *.dar"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-9059806895416645157?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/9059806895416645157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=9059806895416645157' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/9059806895416645157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/9059806895416645157'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/08/dar-backup-script.html' title='Dar Backup Script'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-1087928304607507086</id><published>2008-08-07T22:04:00.000-07:00</published><updated>2008-09-14T18:34:38.328-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='trac'/><category scheme='http://www.blogger.com/atom/ns#' term='svn errors'/><title type='text'>Common Trac issues</title><content type='html'>Below I have listed some common trac errors, and how I have solved them.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Error&lt;/h2&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Warning: Can't synchronize with the repository &lt;br /&gt;(Unsupported version control system "svn": "No module named svn" ).&lt;br /&gt;Look in the Trac log for more information.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;Solution&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;you need to install python subversion bindings. In Ubuntu, thats the &lt;b&gt;python-subversion&lt;/b&gt; package. (you'll need to restart apache after this)&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Error&lt;/h2&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SubversionException: ("Expected format '3' of repository; found format '5'", 165005)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This means that you have different SVN version on your client and server. &lt;br /&gt;You can check it via svn --version. For example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;svn --version&lt;br /&gt;&lt;br /&gt;version 1.4.0 (r21228)&lt;br /&gt;   compiled Sep 18 2006, 15:25:13&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Solution&lt;/h2&gt;&lt;br /&gt;Currently, Subversion 1.5 is not supported in any Ubuntu distribution other than Intrepid, which hasn't been released yet. Thus, you must find a backport, or install it manually. There is a backport for Hardy, available here:&lt;br /&gt;&lt;br /&gt;https://launchpad.net/~clazzes.org/+archive&lt;br /&gt;&lt;br /&gt;If you add this to your sources.list file, it will become available:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;deb http://ppa.launchpad.net/clazzes.org/ubuntu hardy main&lt;br /&gt;deb-src http://ppa.launchpad.net/clazzes.org/ubuntu hardy main&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Make sure you remove your old subversion, and python-subversion bindings. For some reason, I had to manually remove the old svn binaries (i.e svnadmin etc) out of /usr/local/bin and copy the new ones into there. The new ones were located in /usr/bin&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Error&lt;/h2&gt;-&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/api.py", line 344, in send_error&lt;br /&gt;    data, 'text/html')&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/chrome.py", line 697, in render_template&lt;br /&gt;    data = self.populate_data(req, data)&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/chrome.py", line 597, in populate_data&lt;br /&gt;    d['chrome'].update(req.chrome)&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/api.py", line 170, in __getattr__&lt;br /&gt;    value = self.callbacks[name](self)&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/chrome.py", line 466, in prepare_request&lt;br /&gt;    for category, name, text in contributor.get_navigation_items(req):&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/ticket/web_ui.py", line 151, in get_navigation_items&lt;br /&gt;    if 'TICKET_CREATE' in req.perm:&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/api.py", line 170, in __getattr__&lt;br /&gt;    value = self.callbacks[name](self)&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/main.py", line 267, in _get_perm&lt;br /&gt;    return PermissionCache(self.env, self.authenticate(req))&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/main.py", line 135, in authenticate&lt;br /&gt;    authname = authenticator.authenticate(req)&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/auth.py", line 71, in authenticate&lt;br /&gt;    authname = self._get_name_for_cookie(req, req.incookie['trac_auth'])&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/auth.py", line 187, in _get_name_for_cookie&lt;br /&gt;    (cookie.value, req.remote_addr))&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/db/util.py", line 50, in execute&lt;br /&gt;    return self.cursor.execute(sql_escape_percent(sql), args)&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/db/sqlite_backend.py", line 59, in execute&lt;br /&gt;    args or [])&lt;br /&gt;  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/db/sqlite_backend.py", line 51, in _rollback_on_error&lt;br /&gt;    return function(self, *args, **kwargs)&lt;br /&gt;&lt;br /&gt;DatabaseError: file is encrypted or is not a database&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;Solution&lt;/h2&gt;&lt;br /&gt;You need to update your database. Go into $TRAC_PROJECT_DIR/db/&lt;br /&gt;&lt;br /&gt;and type:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mv trac.db trac2.db  &amp;&amp; sqlite trac2.db .dump | sqlite3 trac.db &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-1087928304607507086?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/1087928304607507086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=1087928304607507086' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1087928304607507086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1087928304607507086'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/08/common-svn-issues.html' title='Common Trac issues'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-3160015453987956467</id><published>2008-06-15T20:49:00.001-07:00</published><updated>2008-06-16T19:15:18.284-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mod-proxy'/><category scheme='http://www.blogger.com/atom/ns#' term='Integrating Tomcat with Apache'/><category scheme='http://www.blogger.com/atom/ns#' term='Forwarding Apache to Tomcat'/><category scheme='http://www.blogger.com/atom/ns#' term='mod-jk'/><title type='text'>Running Tomcat With Apache - Ubuntu 7.10</title><content type='html'>This blog will explain how to run Tomcat behind Apache so both can be used to serve content. This is useful for when you need to run servlet/jsp projects and script based content such as PHP. Its pretty simple; all the configuration is done in apache. I will present two ways; one using mod-jk and one using mod-proxy. Mod-Proxy is slightly more flexible, as it allows you to redirect from any context to any other context, On the other hand, I think mod-proxy would probably be slower as it is forwarding the requests not delegating. That is a guess though; so if you are worried about performance you best do some more research.&lt;br /&gt;&lt;br /&gt;Firstly, you need to install apache and tomcat. Not going to explain that, except that you need to use apache2 for this tutorial. Once these are installed, you need to configure apache to run on the port you wish for all the content to be listed on; most likely port 80 (in ubuntu this is default).You can change this in /etc/apache2/ports.conf.&lt;br /&gt;&lt;h2&gt; mod-jk &lt;/h2&gt;&lt;br /&gt;Install mod-jk; the apache 2 connector. This is the package that connects apache with tomcat.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install libapache2-mod-jk&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Once this is installed, you need to configure it. Add these lines to /etc/apache2/apache2.conf&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# Worker properties file&lt;br /&gt;JkWorkersFile /etc/apache2/workers.properties&lt;br /&gt;&lt;br /&gt;# Logging&lt;br /&gt;JkLogFile /var/log/apache2/mod_jk.log&lt;br /&gt;&lt;br /&gt;# Set the jk log level [debug/error/info]&lt;br /&gt;JkLogLevel info&lt;br /&gt;&lt;br /&gt;# Log format&lt;br /&gt;JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Next, you need to modify workers.properties file, so that it knows where to find your tomcat install. You need to point your worker to your tomcat and java directories, and specify the port (8080 in this case) that it is running on.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;workers.tomcat_home=/usr/local/tomcat/tomcat&lt;br /&gt;workers.java_home=/usr/lib/jvm/java-6-sun&lt;br /&gt;ps=/&lt;br /&gt;worker.list=worker1&lt;br /&gt;&lt;br /&gt;worker.default.port=8080&lt;br /&gt;worker.default.host=localhost&lt;br /&gt;worker.default.type=ajp13&lt;br /&gt;worker.default.lbfactor=1&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, go back into /etc/apache2/apache2.conf, and add in the tomcat context's you wish to share. Unfortunately (as far as I know) you cant translate to different contexts (i.e your TestContext in  apache must translate to TestContext in tomcat. If you wish to translate it, you'll need to do use apaches (awesome) module mod_rewrite.)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;# Send servlet for context / TestContext to worker named worker1&lt;br /&gt;&lt;br /&gt;JkMount /TestContext worker1&lt;br /&gt;JkMount /TestContext/* worker1&lt;br /&gt;&lt;br /&gt;JkMount /AnotherContext worker1&lt;br /&gt;JkMount /AnotherContext/* worker1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Restart apache (/etc/init.d/apache2 restart). Now, any requests sent to apache (i.e http://myserver/TestContext), will be forwarded through to tomcat.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;mod-proxy&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;You can use mod-proxy to achieve the same goal. The advantages I can see with using mod-proxy, is that you can transparently redirect a URL to any other URL. This is useful if you want to deploy different versions of the same application, but want the root context to redirect to only one, transparently. &lt;br /&gt;&lt;br /&gt;First you need to load proxy and http proxy. In /etc/apache2/mods-enabled you need to create a link back to mods-available to each module. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ln -s ../mods-available/proxy.load proxy.load&lt;br /&gt;ln -s ../mods-available/proxy.conf proxy.conf&lt;br /&gt;ln -s ../mods-available/proxy_http.load proxy_http.load&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, edit /etc/apache2/httpd.conf.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ProxyTimeout 1&lt;br /&gt;ProxyRequests Off&lt;br /&gt;ProxyPreserveHost On&lt;br /&gt;ProxyPass / http://localhost:8080/TestContext/&lt;br /&gt;ProxyPassReverse / http://localhost:8080/TestContext/&lt;br /&gt;&lt;br /&gt;&lt;Proxy *&gt;&lt;br /&gt;        Order allow,deny&lt;br /&gt;        Allow from all&lt;br /&gt;&lt;/Proxy&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The configuration above will allow any hosts to be redirected from the root context,to MyApp. The proxy element allows you to configure permissions like a normal apache context. Restart apache, and everything should work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-3160015453987956467?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/3160015453987956467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=3160015453987956467' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3160015453987956467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3160015453987956467'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/06/running-tomcat-with-apache-ubuntu-710.html' title='Running Tomcat With Apache - Ubuntu 7.10'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5191375762116431675</id><published>2008-05-02T05:35:00.000-07:00</published><updated>2008-07-10T23:08:32.700-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='msn svn commit notification'/><category scheme='http://www.blogger.com/atom/ns#' term='svn msn messages'/><category scheme='http://www.blogger.com/atom/ns#' term='svn msn message'/><category scheme='http://www.blogger.com/atom/ns#' term='svn msn notifier'/><category scheme='http://www.blogger.com/atom/ns#' term='send msn message on svn commit'/><title type='text'>SVN On Commit MSN Notification</title><content type='html'>&lt;h2&gt;SVN Commit MSN Notification&lt;/h2&gt;&lt;br /&gt;When working on a project with other developers it can be useful to be notified when the repository is committed to. Although its fairly easy to setup an email to be sent on commit, the update emails often get lost in your inbox, and generally your only really interested in what is happening now anyway(or at least I was), so end up ignoring most of them.  &lt;br /&gt;&lt;br /&gt;I have created a script based MSN client which, when combined with a SVN post-commit hook, will send an MSN message when the SVN repository is committed to.&lt;br /&gt;&lt;h2&gt;Download&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;I have now a sourceforge project for this application; you can get it &lt;a href="http://sourceforge.net/projects/robomsn/"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Setting up the client&lt;/h2&gt;&lt;br /&gt;To set up the MSN client you need a notifier email account. This is the MSN email address the MSN client will use to send messages to you and your team. Once you have created it, log into it using pidgin or another MSN messenger, and add each of your team's email address into your contact list. Make sure they accept your invitation.&lt;br /&gt;&lt;br /&gt;Once this is done, you need to create a settings file. If you run the MSN client without a ini file present a template one will be created for you. It needs to be called "ScriptMSN.ini", be located in the same folder as the jar file, and look something like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[broadcastGroup]&lt;br /&gt;contacts=first_email@hotmail.com,second_email@hotmail.com&lt;br /&gt;&lt;br /&gt;[login]&lt;br /&gt;username=notifier_account@hotmail.com&lt;br /&gt;state=away&lt;br /&gt;password=notifier_password&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The broadcast group should contain every contact that needs to be notified of commits. The login section contains the credentials for the notifier account.&lt;br /&gt;&lt;h2&gt;Setting up post-commit hook&lt;/h2&gt;&lt;br /&gt;Firstly; I'm not sure HOW svn decides where it will run things from; "/" seems to reference your home directory. Below is an example of a simple post-commit hook:&lt;br /&gt;&lt;br /&gt;/projects/svn/my_svn_repo/hooks/post-commit&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;&lt;br /&gt;&lt;span class="nv"&gt;REPOS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;$1&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span class="nv"&gt;REV&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;$2&amp;quot;&lt;/span&gt;&lt;br /&gt;java -jar &lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;/ScriptMSN.jar -m revision:&lt;span class="nv"&gt;$REV&lt;/span&gt; repo:&lt;span class="nv"&gt;$REPOS&lt;/span&gt; details:&lt;span class="sb"&gt;`&lt;/span&gt;svnlook info /projects/svn/my_svn_repo &lt;span class="sb"&gt;`&lt;/span&gt; &amp;gt; output&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This is broadcast to each user:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(13:17:50) Notifier: revision:165 repo:/projects/svn/my_svn_repo details:server 2008-05-02 13:20:41 +1000 (Fri, 02 May 2008) 11 IMPL: added a big fancy gold button, just for fun!&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5191375762116431675?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5191375762116431675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5191375762116431675' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5191375762116431675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5191375762116431675'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/05/svn-msn-commit-notification.html' title='SVN On Commit MSN Notification'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-7417246417910095193</id><published>2008-03-31T19:12:00.000-07:00</published><updated>2008-05-01T19:14:35.413-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java connection pooling'/><title type='text'>Connection Pooling with Java - All</title><content type='html'>Establishing a connection from your application to a database can be a time consuming task. In a standalone application, this is probably acceptable; the connection is usually made once when started, maintained throughout the lifetime of the app, which may be a period of hours or longer, then closed once the application is finished. &lt;br /&gt;In web-based applications it is a different story. Due to the way the HTTP protocol works, a connection from a clients browser to our server is not maintained throughout a clients session. As servlet programmers, we have no idea when the next request will be made, if indeed another will be made at all. So, to make sure we dont use up all our allowed database connections we must open and close database at the start and end of each request. This might be fine if your running your app off your local machine and connections can be made and closed quickly, but if your application is hosted elsewhere, it may slow the time it takes to process requests significantly. Another (not so good) option is not to close connections at all, and let them time out. Again, this is workable if the frequency of requests is low or the timeout on the database connections is short, but as more users start making requests open connections will start to build up. We need an option that will scale.&lt;br /&gt;&lt;br /&gt;If the number of connections is limited, and you dont close connections, you will start getting messages like these:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Attempted reconnect 3 times. Giving up.&lt;br /&gt;&lt;br /&gt;Due to underlying exception: 'com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: User user already has more than 'max_user_connections' active connections'.&lt;br /&gt;&lt;br /&gt;** BEGIN NESTED EXCEPTION ** &lt;br /&gt;&lt;br /&gt;com.mysql.jdbc.exceptions.MySQLSyntaxErrorException&lt;br /&gt;MESSAGE: User user already has more than 'max_user_connections' active connections&lt;br /&gt;&lt;br /&gt;STACKTRACE:&lt;br /&gt;&lt;br /&gt;com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: User user already has more than 'max_user_connections' active connections&lt;br /&gt; at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)&lt;br /&gt; at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)&lt;br /&gt; at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:812)&lt;br /&gt; at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3269)&lt;br /&gt; at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1182)&lt;br /&gt; at com.mysql.jdbc.Connection.createNewIO(Connection.java:2818)&lt;br /&gt; at com.mysql.jdbc.Connection.(Connection.java:1531)&lt;br /&gt; at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)&lt;br /&gt; at java.sql.DriverManager.getConnection(DriverManager.java:582)&lt;br /&gt; at java.sql.DriverManager.getConnection(DriverManager.java:185)&lt;br /&gt; at gwtlib.server.db.ConnectionThread.run(ConnectionThread.java:43)&lt;br /&gt; at java.lang.Thread.run(Thread.java:619)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;How can we get around this? One option is to use connection pooling. Connection pooling keeps a set of open connections to the database available in a "pool". When requests are made, a connection can be retrieved from the pool, used, and put back into the pool. The actual connection remains open throughout the entire operation and is not closed until the application is shutdown. This way we only suffer the delay of making a connection to the database when the pool does not already contain a spare open connection.&lt;br /&gt;&lt;br /&gt;Before we get started, there are a few things you MUST be careful of, especially if you are not used to using pools, or you are converting an existing application:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Closing resultset / prepared statements &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You MUST close all result sets or prepared statements. Because we never actually close a connection ( its just returned to the pool ) all resultsets / prepared statements will be retained in memory. You will only notice this if your running an app thats making a lot ( ~ 1 a second or so ) of requests, but definitely a good idea to write code that wont cause memory leaks the first time round as they can be hard to find.&lt;br /&gt;&lt;br /&gt;The JConnection MySSQL API states that closing a prepared statements also closed any associated prepared statements, but as closing a result set resources it might save you some memory closing the result sets as your finished with them, and closing any prepared statements at the end.&lt;br /&gt;&lt;br /&gt;Below is a method for closing result sets that will save you catching SQL exceptions every time you what to close a result set&lt;br /&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nf"&gt;void&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt; &lt;span class="n"&gt;ResultSet&lt;/span&gt; &lt;span class="n"&gt;rs&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="o"&gt;{&lt;/span&gt;&lt;br /&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt; &lt;span class="n"&gt;rs&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt;&lt;br /&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class="k"&gt;try&lt;/span&gt;&lt;br /&gt;  &lt;span class="o"&gt;{&lt;/span&gt;&lt;br /&gt;   &lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;&lt;br /&gt;  &lt;span class="o"&gt;}&lt;/span&gt;&lt;br /&gt;  &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt; &lt;span class="n"&gt;SQLException&lt;/span&gt; &lt;span class="n"&gt;sql&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class="o"&gt;{&lt;/span&gt;&lt;br /&gt;   &lt;span class="c"&gt;// ignored&lt;/span&gt;&lt;br /&gt;  &lt;span class="o"&gt;}&lt;/span&gt;&lt;br /&gt; &lt;span class="o"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Dereferencing result set objects&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="n"&gt;ResultSet&lt;/span&gt; &lt;span class="n"&gt;rs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sqlConn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;execute&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;SELECT 1&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;// rs.close(); &lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;rs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;execute&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;SELECT * FROM users&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;rs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This code will create in a memory leak; the first result set is never closed.&lt;br /&gt;You must explicitly close the first and second result set ( uncomment the rs.close() line ).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Static variables&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Using a static variable for a connection in servlets is a bad idea, as they are maintained between requests. This will cause problems if multiple requests come in at the same time, as the first one to finish will close the connection on the second one. If you do this, you will get all sorts of errors, especially Null Pointer Exceptions that occur within resultsets. &lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Implementation&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;Apache commons (&lt;a href='http://commons.apache.org/dbcp/'&gt;here&lt;/a&gt;) provides a good, standard way to implement connection pooling. It is good because everybody knows it, its tested and it works. There are two options available; direct integration with Tomcat, or Manual Pooling.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Pooling with Tomcat&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;Pooling with tomcat is fairly easy. It requires three things:&lt;br /&gt;&lt;br /&gt;1. A data source to be configured in your META-INF/context.xml&lt;br /&gt;2. Some sort of driver, that tomcat will use to connect to your database.&lt;br /&gt;3. Some code to initialise a data source, from which you can get connections.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Configuring your data source&lt;/b&gt;&lt;br /&gt;Below is an example of what your context.xml could look like:&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;Resource&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;jdbc/myDB&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;   &lt;span class="na"&gt;auth=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Container&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;javax.sql.DataSource&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;   &lt;span class="na"&gt;maxActive=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;20&amp;quot;&lt;/span&gt;&lt;br /&gt;   &lt;span class="na"&gt;maxIdle=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;20&amp;quot;&lt;/span&gt; &lt;br /&gt; &lt;br /&gt;   &lt;span class="na"&gt;username=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;user&amp;quot;&lt;/span&gt;&lt;br /&gt;   &lt;span class="na"&gt;password=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;pass&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;span class="na"&gt;driverClassName=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;com.mysql.jdbc.Driver&amp;quot;&lt;/span&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;span class="na"&gt;removeAbandoned=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;span class="na"&gt;validationQuery=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;select 1&amp;quot;&lt;/span&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;span class="na"&gt;url=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;jdbc:mysql://192.168.0.21/myDatabase&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="nt"&gt;&amp;lt;/Context&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is straightforward. Your resource is accessable via its name; the rest of the details are concerned with connecting to your database and managing your pool.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Setting up your driver&lt;/b&gt;&lt;br /&gt;All you have to do is put your jdbc connection driver in a place tomcat knows about, usually in $TOMCAT_DIR/lib or $TOMCAT_DIR/commons/lib. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Initialising your data source&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Most commonly this is done via an application context listener. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Using it&lt;/b&gt;&lt;br /&gt;If everything is going to plan, you can now get a reference to your datasource, and call getConnection() to get a new connection for your application to use.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Manual pooling&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;Manual pooling has an advantage if you run your application as a daemon and as a web app. If you create it manually both your dameon and web sessions can share the pool. Make sure you create the pool only once, either when your context is started, or your daemon is started.&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt; &lt;span class="n"&gt;Class&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;forName&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;org.postgresql.Driver&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;newInstance&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt; &lt;span class="c"&gt;// register your driver as usual (postgres in this example)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span class="n"&gt;connectionPool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;GenericObjectPool&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="c"&gt;// setup your connection factory so it knows where to get connections from&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span class="n"&gt;ConnectionFactory&lt;/span&gt; &lt;span class="n"&gt;connectionFactory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;DriverManagerConnectionFactory&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;jdbc:postgresql://192.168.1.1:5432/MyDB&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="c"&gt;// hook the pool up to the factory&lt;/span&gt;&lt;br /&gt;        &lt;span class="n"&gt;PoolableConnectionFactory&lt;/span&gt; &lt;span class="n"&gt;poolableConnectionFactory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;br /&gt;                              &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;PoolableConnectionFactory&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connectionFactory&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                              &lt;span class="n"&gt;connectionPool&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="n"&gt;PoolingDataSource&lt;/span&gt; &lt;span class="n"&gt;dataSource&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;PoolingDataSource&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connectionPool&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="c"&gt;// now you can get connections from the pool using this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="c"&gt;// Connection conn = dataSource.getConnection();&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Again, this works the same as any pooling; you MUST close your resultsets and connections so that the memory is freed and your connections return back to the pool to be reused.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Errors&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;If tomcat cannot find your drivers, you will get an error like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;2/04/2008 08:17:46 org.apache.catalina.core.StandardContext start&lt;br /&gt;INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/MyContext] has already been started&lt;br /&gt;org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'&lt;br /&gt;        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:766)&lt;br /&gt;        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)&lt;br /&gt;        at server.core.database.BravoDB.setupDatabases(BravoDB.java:83)&lt;br /&gt;        at server.core.database.BravoDB.getAuthDB(BravoDB.java:214)&lt;br /&gt;        at server.core.service.authentication.Authenticate.doPost(Authenticate.java:45)&lt;br /&gt;        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)&lt;br /&gt;        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)&lt;br /&gt;        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)&lt;br /&gt;        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)&lt;br /&gt;        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)&lt;br /&gt;        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)&lt;br /&gt;        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)&lt;br /&gt;        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)&lt;br /&gt;        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)&lt;br /&gt;        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)&lt;br /&gt;        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)&lt;br /&gt;        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)&lt;br /&gt;        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)&lt;br /&gt;        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)&lt;br /&gt;        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)&lt;br /&gt;        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)&lt;br /&gt;        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)&lt;br /&gt;        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)&lt;br /&gt;        at java.lang.Thread.run(Thread.java:619)&lt;br /&gt;Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver&lt;br /&gt;        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)&lt;br /&gt;        at java.security.AccessController.doPrivileged(Native Method)&lt;br /&gt;        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)&lt;br /&gt;        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)&lt;br /&gt;        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)&lt;br /&gt;        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)&lt;br /&gt;        at java.lang.Class.forName0(Native Method)&lt;br /&gt;        at java.lang.Class.forName(Class.java:169)&lt;br /&gt;        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:760)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You must place your drivers in $TOMCAT_HOME/commons/lib or $TOMCAT_HOME/lib (depending on your version of tomcat).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-7417246417910095193?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/7417246417910095193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=7417246417910095193' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7417246417910095193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7417246417910095193'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/03/connection-pooling-with-java-all.html' title='Connection Pooling with Java - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-959606109752503406</id><published>2008-03-09T19:52:00.001-07:00</published><updated>2010-04-20T23:38:09.402-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unique url http file access'/><category scheme='http://www.blogger.com/atom/ns#' term='unique file access'/><category scheme='http://www.blogger.com/atom/ns#' term='anonymous  file sharing'/><category scheme='http://www.blogger.com/atom/ns#' term='non-login file sharing'/><category scheme='http://www.blogger.com/atom/ns#' term='unique url'/><category scheme='http://www.blogger.com/atom/ns#' term='unique url http access'/><category scheme='http://www.blogger.com/atom/ns#' term='sharing files over unique url'/><category scheme='http://www.blogger.com/atom/ns#' term='anonymous file access'/><title type='text'>Unique URL file sharing - All</title><content type='html'>Works on: Ubuntu 7.10 Server Edition&lt;br /&gt;Requires: mod python enabled on your apache install&lt;br /&gt;&lt;br /&gt;This script generates unique HTTP URL's for every file in a given directory, meaning you can give a user the link in the format http://server/files/index.py?file=12386123978624914, which will then provide a download link for a given file. Providing the directory doesnt have browse access, the scripts allow you to give anonymous access to a particular file. It is NOT very secure; if a user guesses any file in that directory it will allow access. This is NOT designed as a secure way to distribute sensitive data. To run these files you need mod python enabled on your apache server.&lt;br /&gt;&lt;br /&gt;First off, we need add a directory to our apache config, which in ubuntu is located here:&lt;br /&gt;&lt;br /&gt;/etc/apache2/sites-enabled/000-default&lt;br /&gt;&lt;br /&gt;in the virtual host tag add:&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;br /&gt;&lt;span class="nt"&gt;&amp;lt;Directory&lt;/span&gt; &lt;span class="err"&gt;/var/www/files&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Options -Indexes FollowSymLinks MultiViews&lt;br /&gt;AllowOverride AuthConfig&lt;br /&gt;&lt;br /&gt;Order allow,deny&lt;br /&gt;Allow from all&lt;br /&gt;&lt;br /&gt;AddHandler mod_python .py&lt;br /&gt;PythonHandler mod_python.publisher&lt;br /&gt;PythonDebug On&lt;br /&gt;&lt;span class="nt"&gt;&amp;lt;/Directory&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This will allow any python script in /var/www/files to be executed by the python handler. &lt;br /&gt;&lt;br /&gt;This script is designed to take a file parameter on the URL...i.e if this was in a file index.py, you could call it with index.py?file=1923782936025293856 from your browser, where that long number is the MD hash of the file you want. See the script below this one to get the required URL's for each file.&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="c"&gt;#!/usr/bin/python&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;###################### Unique File URL Generator ##################################&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;## This script generates unique HTTP URL&amp;#39;s for every file in a given directory.&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;## It provides a fairly secure way of providing anonymous file access to third party&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;## without having to supply a username and password or any other form of &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;## authentication.&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;## The links are in the format: http://server/files/index.py?file=12386123978624914&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##Source: http://programminglinuxblog.blogspot.com/ &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;##License: GPLv3. See http://www.gnu.org/licenses/gpl.html &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;####################################################################################&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;&lt;br /&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;mod_python&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;apache&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;mod_python&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;util&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;hashlib&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;ROOT_FILE_DIR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/var/www/files&amp;quot;&lt;/span&gt; &lt;span class="c"&gt;# the directory our files are located&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;index&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt; &lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;#   req.content_type = &amp;quot;text/plain&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;File Repository&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;quot;&lt;/span&gt;   &lt;span class="c"&gt;# HTML output&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;form&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;util&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FieldStorage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;keep_blank_values&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;has_key&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;file&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;  &lt;span class="c"&gt;# process file parameter&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;reqHash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;file&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# get dictionary of MD hash values for all files in directory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;allHashs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getMDDirectoryList&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;reqHash&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;allHashs&lt;/span&gt; &lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&amp;lt;h2&amp;gt;File Found: &amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;allHashs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reqHash&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;/h2&amp;gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;a href=&amp;#39;&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;allHashs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reqHash&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;#39;&amp;gt;Download&amp;lt;/a&amp;gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;h2&amp;gt;unknown file requested&amp;lt;/h2&amp;gt;&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;h2&amp;gt;No file requested&amp;lt;/h2&amp;gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# returns dictionary of md5 hashs of files in current directory&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;getMDDirectoryList&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;filelist&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ROOT_FILE_DIR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;md5list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# recurse through all directories&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;# calculate root dir name size so only realtive dirs are shown&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;rootFileNameLen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ROOT_FILE_DIR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dirs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;filelist&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;fullPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;md5val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getMDString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fullPath&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;md5list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;md5val&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fullPath&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;rootFileNameLen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fullPath&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;md5list&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# returns the MD of a particular file&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;getMDString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt; &lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;fileObj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;ripemd160&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fileObj&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;cgiFieldStorageToDict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;fieldStorage&lt;/span&gt; &lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;Get a plain dictionary, rather than the &amp;#39;.value&amp;#39; system used by the cgi module.&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;fieldStorage&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fieldStorage&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The script below prints out a list of URLs that will point to all the files in this directory. (so filename | http://server?file=12355125245). You can give these URLs to whoever you wish to share the files with. This file should not be available to the general public, and should probably be password protected by Apache (see below script).&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="c"&gt;#!/usr/bin/python&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;###################### Unique File URL Generator - list ###########################&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;## This script generates unique HTTP URL&amp;#39;s for every file in a given directory. &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;## It provides a fairly secure way of providing anonymous file access to third party&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;## without having to supply a username and password or any other form of &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;## authentication.    &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;## The links are in the format: http://server/files/index.py?file=12386123978624914 &lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;##Source: http://programminglinuxblog.blogspot.com/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;##License: GPLv3. See http://www.gnu.org/licenses/gpl.html&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;####################################################################################&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;sys&lt;/span&gt;&lt;br /&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;mod_python&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;apache&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;mod_python&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;util&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;hashlib&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;ROOT_FILE_DIR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/var/www/files&amp;quot;&lt;/span&gt; &lt;span class="c"&gt;# the directory our files are located&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# lists all files in directory and its associated hash value&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;index&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;File Repository&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;quot;&lt;/span&gt;   &lt;span class="c"&gt;# HTML&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;h2&amp;gt;File Listing&amp;lt;/h2&amp;gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;FileName&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;URL&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;allHashs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getMDDirectoryList&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;fileName&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;allHashs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;http://your_server_ip/files/index.py?file=&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;fileName&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;allHashs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fileName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;/td&amp;gt;&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;lt;td&amp;gt;&amp;lt;a href=&amp;#39;&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;  &lt;span class="s"&gt;&amp;quot;&amp;#39;&amp;gt;Download Link&amp;lt;/a&amp;gt;&amp;lt;/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;td&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;tr&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&amp;lt;/table&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;webpage&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;getMDDirectoryList&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;filelist&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ROOT_FILE_DIR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;md5list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# recurse through all directories&lt;/span&gt;&lt;br /&gt;&lt;span class="c"&gt;# calculate root dir name size so only realtive dirs are shown&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;rootFileNameLen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ROOT_FILE_DIR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dirs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;filelist&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;fullPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;md5val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getMDString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fullPath&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;md5list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;md5val&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fullPath&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;rootFileNameLen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fullPath&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;md5list&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# returns the MD of a particular file&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;getMDString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;fileObj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;ripemd160&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fileObj&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;To password protect add this into your /etc/apache2/sites-enabled/000-default&lt;br /&gt;&lt;br /&gt;in the virtual host tag add this, substituting list_file_hashs.py for the location that you put the script above, and /files/htpasswd with the file that contains the passwords of valid users.&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;Location&lt;/span&gt; &lt;span class="err"&gt;/files/list_file_hashs.py&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;AuthType Basic&lt;br /&gt;AuthName &amp;quot;AuthName&amp;quot;&lt;br /&gt;&lt;br /&gt;AuthUserFile /files/htpasswd&lt;br /&gt;Require valid-user&lt;br /&gt;&lt;span class="nt"&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-959606109752503406?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/959606109752503406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=959606109752503406' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/959606109752503406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/959606109752503406'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/03/unique-url-http-file-server-all.html' title='Unique URL file sharing - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-6925965627843698789</id><published>2008-02-19T14:21:00.000-08:00</published><updated>2010-11-10T05:48:31.417-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='automatic ssh authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='passwordless authentcation'/><category scheme='http://www.blogger.com/atom/ns#' term='ssh automatic login'/><title type='text'>Automatic SSH Login Script - All</title><content type='html'>Allows you to automatically login to your server via ssh. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;if [ ! $1 ]; then&lt;br /&gt;echo "usage: pushssh.sh user@remoteserver &lt;port (default 22)&gt;"&lt;br /&gt;exit&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;PORT=22&lt;br /&gt;&lt;br /&gt;if [ $2 ]; then&lt;br /&gt;PORT=$2&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# Uploads your id_rsa.pub to the specified host, wrapped for readability&lt;br /&gt;&lt;br /&gt;if [ ! -r ${HOME}/.ssh/id_rsa.pub ]; then&lt;br /&gt;ssh-keygen -b 2048 -t rsa&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# Make sure auth file exists and chmod to 600&lt;br /&gt;&lt;br /&gt;ssh $1 -p $PORT 0&gt; echo "mkdir ~/.ssh; touch ~/.ssh/authorized_keys; &lt;br /&gt;chmod u+rw .ssh/authorized_keys"&lt;br /&gt;&lt;br /&gt;# Append to the copy on the remote server&lt;br /&gt;&lt;br /&gt;cat ~/.ssh/id_rsa.pub | ssh $1 -p $PORT "cat - &gt;&gt; .ssh/authorized_keys"&lt;br /&gt;&lt;br /&gt;if [ $? -eq 0 ]; then&lt;br /&gt;echo "Success"&lt;br /&gt;fi&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-6925965627843698789?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/6925965627843698789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=6925965627843698789' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6925965627843698789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6925965627843698789'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/02/automatic-ssh-login-script-all.html' title='Automatic SSH Login Script - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-3799139404978470457</id><published>2008-02-13T13:50:00.000-08:00</published><updated>2008-02-13T13:55:02.308-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tomcat socket exception'/><title type='text'>Tomcat 5.5 Socket Exception - Ubuntu</title><content type='html'>This error message:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;java.net.SocketException&lt;br /&gt;MESSAGE: java.security.AccessControlException: access denied (java.net.SocketPermission &lt;br /&gt;192.168.1.253:3306 connect,resolve)&lt;br /&gt;&lt;br /&gt;STACKTRACE:&lt;br /&gt;&lt;br /&gt;java.net.SocketException: java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.1.253:3306 &lt;br /&gt;connect,resolve)&lt;br /&gt; at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)&lt;br /&gt; at com.mysql.jdbc.MysqlIO.&lt;init&gt;(MysqlIO.java:276)&lt;br /&gt; at com.mysql.jdbc.Connection.createNewIO(Connection.java:2666)&lt;br /&gt; at com.mysql.jdbc.Connection.&lt;init&gt;(Connection.java:1531)&lt;br /&gt; at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)&lt;br /&gt; at java.sql.DriverManager.getConnection(DriverManager.java:525)&lt;br /&gt; at java.sql.DriverManager.getConnection(DriverManager.java:171)&lt;br /&gt; at server.core.database.ConnectionThread.run(ConnectionThread.java:54)&lt;br /&gt; at java.lang.Thread.run(Thread.java:595)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;is caused by a restrictive java policy file. Note that tomcat doesnt use the standard java.policy file (i.e. /usr/lib/jvm/java-sun-6/jre/lib/security/java.policy), but instead uses /etc/tomcat5/policy.d/04webapps.policy.&lt;br /&gt;&lt;br /&gt;To fix the above example, you need to add something like this inside your grant { block:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;grant {&lt;br /&gt;&lt;br /&gt;   // grant permissions to sql server&lt;br /&gt;    permission java.net.SocketPermission &lt;br /&gt;       "192.168.1.253:3306","connect,resolve,listen,accept";&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-3799139404978470457?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/3799139404978470457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=3799139404978470457' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3799139404978470457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3799139404978470457'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/02/tomcat-55-socket-exception-ubuntu.html' title='Tomcat 5.5 Socket Exception - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-6015620453249987194</id><published>2008-02-09T20:00:00.000-08:00</published><updated>2008-04-11T04:44:53.230-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='apt cache'/><category scheme='http://www.blogger.com/atom/ns#' term='apt-cacher'/><category scheme='http://www.blogger.com/atom/ns#' term='automatic source list updater'/><category scheme='http://www.blogger.com/atom/ns#' term='source list script'/><title type='text'>Apt-Cacher - Cache Updates, Source List Script - Ubuntu</title><content type='html'>Apt-cacher provides a way of caching your repository updates, and is useful to minimise the amount you have to download from the net if you have multiple Ubuntu machines running on your LAN. There are plenty of tutorials for apt-cacher on the web; so I wont explain how to use it, but just provide an example of how I have it setup, which may save you some time.&lt;br /&gt;&lt;br /&gt;modify:&lt;br /&gt;etc/default/apt-cacher&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;AUTOSTART=1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;to setup your path map modify:&lt;br /&gt;/etc/apt-cacher/apt-cacher.conf  &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;path_map = ubuntu-archive au.archive.ubuntu.com/ubuntu ; ubuntu-canonical &lt;br /&gt;archive.canonical.com/ubuntu ; ubuntu-security security.ubuntu.com/ubuntu ; ubuntu-skype &lt;br /&gt;download.skype.com/linux/repos/debian ;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Restart apt-cache (/etc/init.d/apt-cacher restart) Now for each client computer (using the cache) you can reference them like this (where 10.0.0.10 is the IP address of your update server)&lt;br /&gt;/etc/apt/sources.list&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# deb cdrom:[Ubuntu 8.04 _Hardy Heron_ - Alpha i386 (20080109)]/ hardy main restricted&lt;br /&gt;# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to&lt;br /&gt;# newer versions of the distribution.&lt;br /&gt;&lt;br /&gt;deb http://10.0.0.10:3142/ubuntu-archive  hardy main restricted universe&lt;br /&gt;deb-src http://10.0.0.10:3142/ubuntu-archive  hardy main restricted&lt;br /&gt;&lt;br /&gt;## Major bug fix updates produced after the final release of the&lt;br /&gt;## distribution.&lt;br /&gt;deb http://10.0.0.10:3142/ubuntu-archive  hardy-updates main restricted universe&lt;br /&gt;# Line commented out by installer because it failed to verify:&lt;br /&gt;# deb-src http://10.0.0.10:3142/ubuntu-archive  hardy-updates main restricted&lt;br /&gt;&lt;br /&gt;## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu&lt;br /&gt;## team, and may not be under a free licence. Please satisfy yourself as to&lt;br /&gt;## your rights to use the software. Also, please note that software in&lt;br /&gt;## universe WILL NOT receive any review or updates from the Ubuntu security&lt;br /&gt;## team.&lt;br /&gt;# Line commented out by installer because it failed to verify:&lt;br /&gt;# deb http://10.0.0.10:3142/ubuntu-archive  hardy universe&lt;br /&gt;# Line commented out by installer because it failed to verify:&lt;br /&gt;# deb-src http://10.0.0.10:3142/ubuntu-archive  hardy universe&lt;br /&gt;# Line commented out by installer because it failed to verify:&lt;br /&gt;# deb http://10.0.0.10:3142/ubuntu-archive  hardy-updates universe&lt;br /&gt;deb-src http://10.0.0.10:3142/ubuntu-archive  hardy-updates universe&lt;br /&gt;&lt;br /&gt;## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu &lt;br /&gt;## team, and may not be under a free licence. Please satisfy yourself as to &lt;br /&gt;## your rights to use the software. Also, please note that software in &lt;br /&gt;## multiverse WILL NOT receive any review or updates from the Ubuntu&lt;br /&gt;## security team.&lt;br /&gt;deb http://10.0.0.10:3142/ubuntu-archive  hardy multiverse&lt;br /&gt;deb-src http://10.0.0.10:3142/ubuntu-archive  hardy multiverse&lt;br /&gt;deb http://10.0.0.10:3142/ubuntu-archive  hardy-updates multiverse&lt;br /&gt;deb-src http://10.0.0.10:3142/ubuntu-archive  hardy-updates multiverse&lt;br /&gt;&lt;br /&gt;## Uncomment the following two lines to add software from the 'backports'&lt;br /&gt;## repository.&lt;br /&gt;## N.B. software from this repository may not have been tested as&lt;br /&gt;## extensively as that contained in the main release, although it includes&lt;br /&gt;## newer versions of some applications which may provide useful features.&lt;br /&gt;## Also, please note that software in backports WILL NOT receive any review&lt;br /&gt;## or updates from the Ubuntu security team.&lt;br /&gt;deb http://10.0.0.10:3142/ubuntu-archive  hardy-backports main restricted universe multiverse&lt;br /&gt;# deb-src http://10.0.0.10:3142/ubuntu-archive  hardy-backports main restricted universe multiverse&lt;br /&gt;&lt;br /&gt;## Uncomment the following two lines to add software from Canonical's&lt;br /&gt;## 'partner' repository. This software is not part of Ubuntu, but is&lt;br /&gt;## offered by Canonical and the respective vendors as a service to Ubuntu&lt;br /&gt;## users.&lt;br /&gt;# deb http://archive.canonical.com/ubuntu hardy partner&lt;br /&gt;# deb-src http://archive.canonical.com/ubuntu hardy partner&lt;br /&gt;&lt;br /&gt;deb http://10.0.0.10:3142/ubuntu-security hardy-security main restricted&lt;br /&gt;deb-src http://10.0.0.10:3142/ubuntu-security hardy-security main restricted&lt;br /&gt;deb http://10.0.0.10:3142/ubuntu-security hardy-security universe&lt;br /&gt;deb-src http://10.0.0.10:3142/ubuntu-security hardy-security universe&lt;br /&gt;deb http://10.0.0.10:3142/ubuntu-security hardy-security multiverse&lt;br /&gt;deb http://10.0.0.10:3142/ubuntu-archive  hardy-proposed restricted main multiverse universe&lt;br /&gt;deb-src http://10.0.0.10:3142/ubuntu-security hardy-security multiverse&lt;br /&gt;# deb http://download.skype.com/linux/repos/debian/ stable non-free&lt;br /&gt;deb http://10.0.0.10:3142/ubuntu-skype stable non-free&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt; Source List Script &lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;I have written a Python script to automatically update a sources list file with your apt-cacher details and specified mappings. My Python skills arnt the greatest, so if you have any improvements to offer, let me know.&lt;br /&gt;&lt;br /&gt;&lt;div class="hlcode"&gt;&lt;br /&gt;&lt;div class="syntax"&gt;&lt;pre&gt;&lt;span class="c"&gt;#!/usr/bin/python&lt;/span&gt;&lt;br /&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# ------------- Parameters --------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# input / output source list files&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;INPUT_SRC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;/etc/apt/sources.list&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;OUTPUT_DEST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;source.list.new&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# apt cacher details&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;APT_CACHER_SERVER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;192.168.1.250&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;APT_CACHER_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;3142&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;APT_CACHER_TYPE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;http&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# archive urls&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;OLD_ARCHIVE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;http://archive.ubuntu.com/ubuntu/&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;OLD_CANONICAL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;http://au.archive.ubuntu.com/ubuntu/&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;OLD_SECURITY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;http://security.ubuntu.com/ubuntu/&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# new mappings (configured in apt-cacher)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;ARC_MAP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;ubuntu-update&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;CAN_MAP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;ubuntu-canonical&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;SEC_MAP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;ubuntu-security&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# ---------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;source updater started&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;TMP_DEST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;/tmp/source.tmp&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# sed delimited archives&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;SED_ARCHIVE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;OLD_ARCHIVE&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;\/&amp;quot;&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;SED_CANONICAL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;OLD_CANONICAL&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;\/&amp;quot;&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;SED_SECURITY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;OLD_SECURITY&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;\/&amp;quot;&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# complete sed delimited apt server url&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;APT_SERVER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;APT_CACHER_TYPE&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;:\/\/&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;APT_CACHER_SERVER&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;:&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;APT_CACHER_PORT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;\/&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# print &amp;quot;apt server url: (sed): &amp;quot; + APT_SERVER ;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;ARCH_SED_CMD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;sed -e &amp;#39;&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;s/&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;SED_ARCHIVE&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;APT_SERVER&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ARC_MAP&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/&amp;#39;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;CAN_SED_CMD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;sed -e &amp;#39;&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;s/&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;SED_CANONICAL&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;APT_SERVER&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;CAN_MAP&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/&amp;#39;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;SEC_SED_CMD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;sed -e &amp;#39;&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;s/&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;SED_SECURITY&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;APT_SERVER&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;SEC_MAP&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;/&amp;#39;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# copy file to new tmp location&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;COPY_CMD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;cp &amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;INPUT_SRC&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot; &amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;TMP_DEST&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;COPY_CMD&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;IN_CMD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;cat &amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;TMP_DEST&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot; | &amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;OUT_CMD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot; &amp;gt; &amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;OUTPUT_DEST&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# cat from tmp to new&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;COPY_BACK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;cp &amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;OUTPUT_DEST&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;quot; &amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;TMP_DEST&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="c"&gt;# copy from new back to tmp&lt;/span&gt;&lt;br /&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;IN_CMD&lt;/span&gt;  &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ARCH_SED_CMD&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;OUT_CMD&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;COPY_BACK&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;br /&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;IN_CMD&lt;/span&gt;  &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;CAN_SED_CMD&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;OUT_CMD&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;COPY_BACK&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;br /&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;IN_CMD&lt;/span&gt;  &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;SEC_SED_CMD&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;OUT_CMD&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;source updater finished&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-6015620453249987194?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/6015620453249987194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=6015620453249987194' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6015620453249987194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6015620453249987194'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/02/apt-cacher-ubuntu.html' title='Apt-Cacher - Cache Updates, Source List Script - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-480792850839743512</id><published>2008-01-21T18:08:00.000-08:00</published><updated>2008-06-18T17:46:14.027-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='startup template'/><category scheme='http://www.blogger.com/atom/ns#' term='startup script'/><category scheme='http://www.blogger.com/atom/ns#' term='init-d template'/><title type='text'>init-d template - All</title><content type='html'>&lt;pre&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;case "${1:-''}" in&lt;br /&gt;  'start')&lt;br /&gt;           # start commands here&lt;br /&gt;        ;;&lt;br /&gt;  'stop')&lt;br /&gt;           # stop commands here&lt;br /&gt;        ;;&lt;br /&gt;  'restart')&lt;br /&gt;           # restart commands here&lt;br /&gt;        ;;&lt;br /&gt;  *)      # no parameter specified&lt;br /&gt;        echo "Usage: $SELF start|stop|restart|reload|force-reload|status"&lt;br /&gt;        exit 1&lt;br /&gt;        ;;&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-480792850839743512?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/480792850839743512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=480792850839743512' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/480792850839743512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/480792850839743512'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/01/init-d-template-all.html' title='init-d template - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-213726868966344553</id><published>2008-01-20T16:14:00.000-08:00</published><updated>2008-01-20T16:39:13.706-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql java AccessControlException'/><title type='text'>MySQL - Java connection Exception - All</title><content type='html'>I came across this exception when trying to setup an tomcat app that connected to a mySQL server (on the same server).&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Problem&lt;/h2&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;** BEGIN NESTED EXCEPTION **&lt;br /&gt;&lt;br /&gt;java.net.SocketException&lt;br /&gt;MESSAGE: java.security.AccessControlException: access denied (java.net.SocketPermission &lt;br /&gt;127.0.0.1:3306 connect,resolve)&lt;br /&gt;&lt;br /&gt;STACKTRACE:&lt;br /&gt;&lt;br /&gt;java.net.SocketException: java.security.AccessControlException: access denied &lt;br /&gt;(java.net.SocketPermission 127.0.0.1:3306 connect,resolve)&lt;br /&gt;        at com.mysql.jdbc.StandardSocketFactory.unwrapExceptionToProperClassAndThrowIt(StandardSocketFactory.&lt;br /&gt;java:407)&lt;br /&gt;        at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:268)&lt;br /&gt;&lt;br /&gt;......&lt;br /&gt;&lt;br /&gt;** END NESTED EXCEPTION **&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Attempted reconnect 3 times. Giving up.&lt;br /&gt;        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)&lt;br /&gt;        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)&lt;br /&gt;        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessor&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;Solution&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;This is a Java exception, caused by your java.policy file. Its in your JAVA_HOME/jre/lib/security folder. Heres where it is in Ubuntu (using java 6).&lt;br /&gt;&lt;br /&gt;/usr/lib/jvm/java-6-sun/jre/lib/security/java.policy &lt;br /&gt;&lt;br /&gt;You need to add the following lines:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;grant{&lt;br /&gt;permission java.net.SocketPermission "127.0.0.1:3306", "connect, resolve";&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-213726868966344553?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/213726868966344553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=213726868966344553' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/213726868966344553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/213726868966344553'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2008/01/mysql-java-connection-exception-all.html' title='MySQL - Java connection Exception - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-4604443784491571445</id><published>2007-11-27T13:02:00.000-08:00</published><updated>2008-06-27T14:22:31.857-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat 5.5'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Tomcat 5.5 on Ubuntu (Gutsy)</title><content type='html'>Setting up Tomcat 5.5 on Ubuntu is not as straight forward as it should be, but is very easy when you know how. Firstly,&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install tomcat5.5 tomcat5.5-admin&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This will install and start Tomcat. This is misleading; you MUST restart your machine in order for tomcat to start reading your users.xml file, to allow you to login to the manager page.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Configuration&lt;/h2&gt;&lt;br /&gt;&lt;h3&gt;Security&lt;/h3&gt;&lt;br /&gt;Tomcats configuration is in /etc/tomcat5.5. (which is linked to /var/lib/tomcat5.5/) Once you have restarted, add a user tomcat-users.xml in this directory making sure they have the role admin/manager. For example,&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#user username="admin" password="admin" roles="standard,manager"/#&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You must restart Tomcat for this to take effect:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/etc/init.d/tomcat5.5 restart&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can configure tomcat's port for connections in server.xml. By default it runs on 8180.&lt;br /&gt;&lt;h3&gt;Deployment&lt;/h3&gt;&lt;br /&gt;Tomcat is deployed here&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/usr/share/tomcat5.5/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;Configuration pages&lt;/h3&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;http://localhost:8180/manager/html/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;http://localhost:8180/host-manager/html/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;Logs&lt;/h3&gt;&lt;br /&gt;By default, all logs (i.e all output from your servlets) will end up in,&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/var/logs/syslog&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note that you may also need to set JAVA_HOME (i.e put export JAVA_HOME=/usr/lib/java-6-sun in ~/.bashrc, and start a fresh session)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-4604443784491571445?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/4604443784491571445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=4604443784491571445' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4604443784491571445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4604443784491571445'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/11/tomcat-55-on-ubuntu-gutsy.html' title='Tomcat 5.5 on Ubuntu (Gutsy)'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-1299826530232780207</id><published>2007-11-01T17:22:00.000-07:00</published><updated>2011-08-25T03:46:45.417-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mac address of a machine'/><category scheme='http://www.blogger.com/atom/ns#' term='mac address'/><category scheme='http://www.blogger.com/atom/ns#' term='python glade application'/><category scheme='http://www.blogger.com/atom/ns#' term='how to get ip address'/><category scheme='http://www.blogger.com/atom/ns#' term='glade tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='broadcast address'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='glade'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='mac to ip'/><category scheme='http://www.blogger.com/atom/ns#' term='mac address to ip address'/><category scheme='http://www.blogger.com/atom/ns#' term='ip address'/><title type='text'>Detecting IP address from Mac Address - Linux</title><content type='html'>Operating System: Linux&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Im&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;sure&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;there's&lt;/span&gt; a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;more&lt;/span&gt; elegant &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;way&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;of&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;doing&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;it&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;but&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;the&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;finding&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;out&lt;/span&gt; a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;computers&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;IP&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;address&lt;/span&gt; from &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;MAC&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;address&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;can&lt;/span&gt; be &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;done&lt;/span&gt; like &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;this&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;ip&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;neigh&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;flush&lt;/span&gt; all &amp;amp;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;gt&lt;/span&gt;; /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;dev&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;null&lt;/span&gt;; # &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;Clears&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;out&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;your&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;arp&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;cache&lt;/span&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;fping&lt;/span&gt; -c 1 -g -q 192.168.1.0/24 2&amp;amp;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;gt&lt;/span&gt;; /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;dev&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;null&lt;/span&gt;;  # &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;pings&lt;/span&gt; all &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;of&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;subnet&lt;/span&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;arp&lt;/span&gt; -n | grep "00:1B:4C:22:28:B1"   # &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;Search&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;cache&lt;/span&gt; for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;MAC&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;address&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;By &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;pinging&lt;/span&gt; all &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;computers&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;on&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;the&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;subnet&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;your&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;arp&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;cache&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;will&lt;/span&gt; be &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;refreshed&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_53"&gt;with&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;MAC&lt;/span&gt; -&amp;amp;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_55"&gt;gt&lt;/span&gt;; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_56"&gt;Translations.&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_57"&gt;The&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_58"&gt;arp&lt;/span&gt; -n &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_59"&gt;command&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_60"&gt;lists&lt;/span&gt; all &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_61"&gt;entries&lt;/span&gt; in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_62"&gt;your&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_63"&gt;arp&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_64"&gt;cache&lt;/span&gt;, and by &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_65"&gt;piping&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_66"&gt;to&lt;/span&gt; grep &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_67"&gt;you&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_68"&gt;only&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_69"&gt;see&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_70"&gt;what&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_71"&gt;your&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_72"&gt;looking&lt;/span&gt; for. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_73"&gt;NOTE&lt;/span&gt;: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_74"&gt;You&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_75"&gt;can&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_76"&gt;remove&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_77"&gt;the&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_78"&gt;pipes&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_79"&gt;to&lt;/span&gt; /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_80"&gt;dev&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_81"&gt;null&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_82"&gt;Ive&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_83"&gt;only&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_84"&gt;done&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_85"&gt;this&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_86"&gt;to&lt;/span&gt; stop &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_87"&gt;unnecessary&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_88"&gt;output.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_89"&gt;Python&lt;/span&gt; Glade &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_90"&gt;MAC&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_91"&gt;Address&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_92"&gt;To&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_93"&gt;IP&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_94"&gt;Address&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_95"&gt;Application&lt;/span&gt;&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;I &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_96"&gt;have&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_97"&gt;written&lt;/span&gt; a small (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_98"&gt;free&lt;/span&gt;, under &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_99"&gt;GPL&lt;/span&gt;) &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_100"&gt;application&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_101"&gt;to&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_102"&gt;demonstrate&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_103"&gt;the&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_104"&gt;uses&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_105"&gt;of&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_106"&gt;fping&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_107"&gt;or&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_108"&gt;raw&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_109"&gt;sockets.&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_110"&gt;Raw&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_111"&gt;sockets&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_112"&gt;will&lt;/span&gt; be &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_113"&gt;used&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_114"&gt;if&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_115"&gt;the&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_116"&gt;fping&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_117"&gt;command&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_118"&gt;isn't&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_119"&gt;avaiable&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_120"&gt;but&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_121"&gt;require&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_122"&gt;root&lt;/span&gt; access and is &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_123"&gt;much&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_124"&gt;slower.&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_125"&gt;The&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_126"&gt;application&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_127"&gt;has&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_128"&gt;good&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_129"&gt;examples&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_130"&gt;of&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_131"&gt;simple&lt;/span&gt; Linux &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_132"&gt;GUI&lt;/span&gt; (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_133"&gt;gtk.glade&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_134"&gt;library&lt;/span&gt;)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_135"&gt;Execute&lt;/span&gt; system &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_136"&gt;commands&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_137"&gt;Using&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_138"&gt;raw&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_139"&gt;sockets&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_140"&gt;Using&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_141"&gt;threads&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_142"&gt;It&lt;/span&gt; is &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_143"&gt;available&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_144"&gt;&lt;a href="http://applications.benleov.x10.mx/ip_locator_v1.0.tar.gz"&gt;here&lt;/a&gt;&lt;/span&gt;. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_145"&gt;If&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_146"&gt;you&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_147"&gt;would&lt;/span&gt; like &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_148"&gt;to&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_149"&gt;extend&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_150"&gt;the&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_151"&gt;application&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_152"&gt;send&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_153"&gt;me&lt;/span&gt; a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_154"&gt;message&lt;/span&gt; and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_155"&gt;I'll&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_156"&gt;upload&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_157"&gt;your&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_158"&gt;updates.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-1299826530232780207?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/1299826530232780207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=1299826530232780207' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1299826530232780207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1299826530232780207'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/11/detecting-ip-address-from-mac-address.html' title='Detecting IP address from Mac Address - Linux'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5233753597890356817</id><published>2007-10-24T05:12:00.000-07:00</published><updated>2007-11-02T21:55:14.501-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wireless router'/><category scheme='http://www.blogger.com/atom/ns#' term='linksys WRT56G'/><title type='text'>Wireless via Linksys WRT56G using WPA-PSK - Ubuntu</title><content type='html'>Operating System: Xubuntu&lt;br /&gt;Below I will explain how I got my Linksys WRT56G wireless router going with ubuntu (Xubuntu) linux running WPA-PSK. Replace eth1 with your network adapter.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Finding your network&lt;/h2&gt;&lt;br /&gt;If you have set your ssid visible on the router, you should be able to view your networking using&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;iwconfig eth1 scan&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Open&lt;/h2&gt;&lt;br /&gt;Connecting to an open network is easy. Run the following&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;iwconfig eth1 essid "Your Network" &amp;&amp; dhclient eth1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If your using a static IP address, you will need to configure /etc/network/interfaces appropriately. &lt;br /&gt;&lt;h2&gt;WPA&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;I never had much luck with wifi-radar, so found manually configuring wpa_supplicant easier.&lt;br /&gt;Edit /etc/wpa_supplicant/wpa_supplicant.conf and fill in your network details:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ctrl_interface=/var/run/wpa_supplicant&lt;br /&gt;ctrl_interface_group=0&lt;br /&gt;eapol_version=1&lt;br /&gt;ap_scan=2&lt;br /&gt;fast_reauth=1&lt;br /&gt;&lt;br /&gt;network={&lt;br /&gt;        ssid="linksys_SES_26841"&lt;br /&gt;        proto=WPA&lt;br /&gt;        key_mgmt=WPA-PSK&lt;br /&gt;        pairwise=TKIP&lt;br /&gt;        group=TKIP&lt;br /&gt;        psk="yourprivatekeyhere"&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To activate your connection run (remember to replace eth1 with your wireless card):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -D wext -dd -i eth1 -B &amp;&amp; dhclient eth1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Running this should connect to your router using DHCP. &lt;br /&gt;&lt;h2&gt;Startup Script&lt;/h2&gt;&lt;br /&gt;Running this every time you start up is annoying, so copy the wpa_supplicant line into a file in /etc/init.d/ (you will need to be root to do this) and run the command:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;update-rc.d defaults wireless&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;where "wireless" is the name of the file you created in init.d. Now when you reboot, your wireless should connect automatically.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5233753597890356817?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5233753597890356817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5233753597890356817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5233753597890356817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5233753597890356817'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/10/wireless-via-linksys-wrt56g-using-wpa.html' title='Wireless via Linksys WRT56G using WPA-PSK - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-2201797296139854386</id><published>2007-10-02T20:29:00.000-07:00</published><updated>2007-10-27T23:53:43.261-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='kismet'/><category scheme='http://www.blogger.com/atom/ns#' term='netear wg111v2'/><title type='text'>Wireless a netgear WG111v2 and kistmet - Ubuntu</title><content type='html'>This blog will cover how to setup a usb WG111v2 adapter to be used with kismet on Ubuntu.&lt;br /&gt;&lt;h2&gt;Introduction&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;The usb netgear WG111v2 adapter has a Realtek rt8180 chipset. The current kernel has support for this adapter via the r8187 module, but does not support monitoring mode (meaning kismet and aircrack will not work).&lt;br /&gt;&lt;br /&gt;To get it to work, you need to manually install the rtl-wifi driver.&lt;br /&gt;Note: this is NOT the same as the rtl8180-sa2400 project. See the wiki&lt;br /&gt;for details:&lt;br /&gt;&lt;br /&gt;http://rtl-wifi.sourceforge.net/wiki/&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Installing&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Firstly, to check to see if your adapter has been detected by Ubuntu running lsusb,&lt;br /&gt;should give you a line looking like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Bus 005 Device 002: ID 0846:6a00 NetGear, Inc. WG111 WiFi (v2)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Typing lsmod will probably reveal that Ubuntu has loaded the standard&lt;br /&gt;driver, as you should be able to find the module "r8187" somewhere.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Remember&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;Make sure you reboot your machine WITHOUT your adapter pluged in. If you do not, you may run into this error:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;insmod: error inserting ieee80211/iee80211-rtl.ko: -1 Invalid symbol in module&lt;br /&gt;insmod: error inserting rtl18187-newstack/r8187.ko: -1 Unknown symbol in module&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Also, make sure you make clean all directories before rebulding. (i.e the stack, in directory ieee80211 and the module rtl8187-newstack)&lt;br /&gt;&lt;br /&gt;Finally, make sure you backup your /lib/module/2.6.XX-XX-generic/kernel/net/ieee80211/ directory, so you can revert back to your old settings. &lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Building&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;Before following the instructions here to install:&lt;br /&gt;&lt;br /&gt;http://rtl-wifi.sourceforge.net/wiki/Installing#Installing_the_rtl-wifi_driver&lt;br /&gt;&lt;br /&gt; NOTE that the current version does NOT work the the latest version of the Ubuntu kernel (2.6.22-12-generic); you must checkout revision 62 (use svn -r 62, or if you've already check it out, use svn switch).&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;svn sw -r 62 https://rtl-wifi.svn.sourceforge.net/svnroot/rtl-wifi rtl-wifi&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If it doesnt compile, try checking out a previous version. If it does, set your source in kismet.conf.to&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;source=rt8180,wlan0,RTL&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Remember, make sure you remove your USB wifi adapter and "make clean" in ALL directories of rtl-wifi; otherwise you may not be able to build correctly.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Reverting&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;To revert your system back, just copy the ieee80211 you backed up into into /lib/module/2.6.XX-XX-generic/kernel/net/ieee80211/. If you didnt back it up, use synaptic to competely remove, then reinstall linux-image, and restart your system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-2201797296139854386?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/2201797296139854386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=2201797296139854386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2201797296139854386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2201797296139854386'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/10/wireless-netgear-wg111v2-and-kistmet.html' title='Wireless a netgear WG111v2 and kistmet - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-287115401235261362</id><published>2007-10-01T20:00:00.000-07:00</published><updated>2009-10-23T15:29:10.866-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux on a ipaq rx3715'/><title type='text'>Linux on iPAQ rx3715</title><content type='html'>&lt;h2&gt; Introduction &lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;I will explain how to install linux (Familar, running Opie) on an iPAQ rx3715. I would think this would be applicable to any rx3000 series IPAQ, but who knows. Here are some references to sites that will help you. I have subsequently sold my iPAQ, but have published what I know in the hopes it helps somebody else.&lt;br /&gt;&lt;br /&gt;There are two options:&lt;br /&gt;&lt;br /&gt;1) Format your memory card to have one fat (vfat) partition (as partition 1) and one ext3 partition (as partition 2). The first partition holds the image, the second holds the file system including Opie. Once the image and filesystem are in place, you can run Haret to boot into Linux. &lt;br /&gt;&lt;br /&gt;2) Format your memory card to have one partition, all ext3 and place the image onto your Ipaq File Storage. This is probably the easiest way of doing it.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt; References &lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=" http://www.handhelds.org/projects/rx3715.html"&gt;http://www.handhelds.org/projects/rx3715.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://opie.handhelds.org/"&gt;http://opie.handhelds.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt; Requirements &lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Firstly, you need the ability to do these things before you can start:&lt;br /&gt;&lt;br /&gt;&lt;h3&gt; Format a SD / MMC card with Linux filesystem (ext2 / ext3) &lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;This can be difficult. Alot of card readers are not compatible with linux. In addition to this, SD is a proprietary format, so you will probably need to use an MMC (MultiMediaCard) card.&lt;br /&gt;&lt;br /&gt;I managed to use my MP3 player to do it, but its still a little flakey, and wont format properly all of the time. I'd invest in a SD/MMC card reader that's properly supported in Linux. Your other option is to use windows to format it, but using a driver.&lt;br /&gt;&lt;br /&gt;linux&lt;br /&gt;&lt;br /&gt;to format it in linux, you must be root and execute the following:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;fdisk -l&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;umount /dev/sdb1   # make sure your partitions arent mounted&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;# this will show you which which device your card is registered as. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;fdisk /dev/sdb    # note: do NOT put the parition number in&lt;br /&gt;mkfs.vfat&lt;br /&gt;mkfs.ext3&lt;br /&gt;fsk /dev/sdb1     # can use this to check partition&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Transfer information between your Ipaq and a computer&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;Linux:&lt;br /&gt;&lt;br /&gt;Use synce.&lt;br /&gt;&lt;br /&gt;Windows:&lt;br /&gt;&lt;br /&gt;ActiveSync&lt;br /&gt;&lt;br /&gt;Resouces.&lt;br /&gt;&lt;br /&gt;--Installing--&lt;br /&gt;&lt;br /&gt;The first parition (vfat) is what will hold:&lt;br /&gt;&lt;br /&gt;1. Kernel Image (zImage)&lt;br /&gt;2. Haret ( Unloads Windows CE out of memory, and boots the kernel )&lt;br /&gt;3. default.txt ( Tells Haret what image to use and where to mount root )&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-287115401235261362?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/287115401235261362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=287115401235261362' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/287115401235261362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/287115401235261362'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/10/linux-on-ipaq-rx3715.html' title='Linux on iPAQ rx3715'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-7217524986733184561</id><published>2007-09-27T22:18:00.000-07:00</published><updated>2007-09-27T22:24:09.912-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='network bridging'/><category scheme='http://www.blogger.com/atom/ns#' term='virtual box'/><title type='text'>VirtualBox network bridge script - All</title><content type='html'>&lt;pre&gt;&lt;br /&gt;# requires apt-get install uml-utilities bridge-utils (Ubuntu)&lt;br /&gt;# and to be run as root&lt;br /&gt;&lt;br /&gt;# Set your machine in VirtualBox to use  “Host Interface”, and set&lt;br /&gt;# Interface name to "tap1". Run this script every time you require the bridge set up,&lt;br /&gt;# before you start your virtual machine.&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;USERNAME=user           # login name of HOST system&lt;br /&gt;DHCP=1      # set to 1 to use dynamic ip for bridge&lt;br /&gt;IP_ADDRESS=192.168.1.1    # static ip address of bridge (only used if DHCP set to 0)&lt;br /&gt;&lt;br /&gt;tunctl -t tap1 -u $USERNAME&lt;br /&gt;brctl addbr br0&lt;br /&gt;ifconfig eth0 0.0.0.0 promisc&lt;br /&gt;brctl addif br0 eth0&lt;br /&gt;&lt;br /&gt;if [ DHCP = 1 ]; then&lt;br /&gt; dhclient br0&lt;br /&gt;else&lt;br /&gt; ifconfig br0 $IP_ADDRESS&lt;br /&gt;fi &lt;br /&gt;&lt;br /&gt;brctl addif br0 tap1&lt;br /&gt;ifconfig tap1 up&lt;br /&gt;chmod 0666 /dev/net/tun&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-7217524986733184561?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/7217524986733184561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=7217524986733184561' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7217524986733184561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7217524986733184561'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/09/virtualbox-network-bridge-script-all.html' title='VirtualBox network bridge script - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5885277497933371240</id><published>2007-09-27T14:47:00.000-07:00</published><updated>2007-11-01T18:03:21.011-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VPN'/><category scheme='http://www.blogger.com/atom/ns#' term='gutsy gibon'/><category scheme='http://www.blogger.com/atom/ns#' term='VPN through firewall'/><category scheme='http://www.blogger.com/atom/ns#' term='hamchi'/><category scheme='http://www.blogger.com/atom/ns#' term='free vpn'/><title type='text'>Hamachi - Gutsy Gibon</title><content type='html'>Hamachi doesn't work correctly with Gutsy Gibon. It will complete with no response. To make it work, you need to install:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;upx-ucl-beta&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;then run (as root)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;upx -d /usr/bin/hamachi&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It should now work correctly.&lt;br /&gt;See &lt;a href="http://ubuntuforums.org/showthread.php?t=553774"&gt;this&lt;/a&gt; thread on the ubuntu forms for details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5885277497933371240?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5885277497933371240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5885277497933371240' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5885277497933371240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5885277497933371240'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/09/hamachi-gutsy-gibon.html' title='Hamachi - Gutsy Gibon'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-3300635879278870394</id><published>2007-09-26T17:30:00.000-07:00</published><updated>2007-11-01T18:07:48.526-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FTP linux'/><category scheme='http://www.blogger.com/atom/ns#' term='authenticated get request'/><category scheme='http://www.blogger.com/atom/ns#' term='Automated FTP'/><title type='text'>Automatic FTP Transfer Script - Linux</title><content type='html'>Operating System: Linux&lt;br /&gt;Tools Required yafc (Yet Another FTP Client)&lt;br /&gt;&lt;br /&gt;To do automated FTP transfers any command line FTP tool can be used. Ive chosen yafc because its commands are similar to standard Linux commands. The code below will connect to FTP server 192.168.1.3, on port 21, using a username of "username" and password of "password". It then lists the directory (ls), removes two files (somefile.txt and anotherfile.txt), then sends all the files in /home/user to the current directory on the FTP server. Finally it closes the connect to the server. Simple.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;yafc  &lt;&lt;**&lt;br /&gt;open ftp://username:password@192.168.1.3:21/ &lt;br /&gt;ls &lt;br /&gt;rm -f dir/somefile.txt&lt;br /&gt;rm -f dir/anotherfile.txt&lt;br /&gt;put -f -r /home/user/*&lt;br /&gt;close&lt;br /&gt;**&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can do an authenticated GET request also, using wget.  This is useful if you require to restart your server after uploading, and you're able to do it from a web interface. Using the spider flag means wget doesn't actually download the page.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;wget --spider http://192.168.1.3/page --http-user=youruser --http-password=yourpassword&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-3300635879278870394?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/3300635879278870394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=3300635879278870394' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3300635879278870394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3300635879278870394'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/09/automatic-transfer-script-linux.html' title='Automatic FTP Transfer Script - Linux'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5094257135972064172</id><published>2007-09-25T04:06:00.000-07:00</published><updated>2007-12-06T19:05:13.734-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='dom'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='org.w3c.dom'/><category scheme='http://www.blogger.com/atom/ns#' term='creating xml document'/><title type='text'>Java - Writing XML document - All</title><content type='html'>Creating an XML document with java is very easy. If you know how to use System.out.println(), then you can create an XML document. This may be enough for trivial programs, but for any application that requires the xml to be well formatted, parsed or understood by others, then a framework of sorts is needed. Below I have explained how to create a simple XML document using org.w3c.dom.&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import org.w3c.dom.Document;&lt;br /&gt;import org.w3c.dom.Element;&lt;br /&gt;&lt;br /&gt;public void createXML() &lt;br /&gt;{&lt;br /&gt;        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();&lt;br /&gt;        DocumentBuilder builder;&lt;br /&gt;        Document doc;&lt;br /&gt;&lt;br /&gt;        try &lt;br /&gt;        {&lt;br /&gt;            &lt;br /&gt;            builder = factory.newDocumentBuilder();    // create document&lt;br /&gt;            doc = builder.newDocument();&lt;br /&gt;            &lt;br /&gt;            Element e = doc.createElement("root");      // create root element&lt;br /&gt;            &lt;br /&gt;            doc.appendChild(e);     // append to document&lt;br /&gt;&lt;br /&gt;            e.setAttribute("attributeOne","valueOne");       // set a couple of attributes&lt;br /&gt;            e.setAttribute("attributeTwo","valueTwo");&lt;br /&gt;            &lt;br /&gt;            Element e2 = doc.createElement("SubElement");    // add another element to the first&lt;br /&gt;            e.setAttribute("attributeThree","valueThree");&lt;br /&gt;            e.appendChild(e2);&lt;br /&gt;&lt;br /&gt;        } &lt;br /&gt;        catch (ParserConfigurationException ex) &lt;br /&gt;        {&lt;br /&gt;            ex.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;Parsing XML:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public void parseXML(String xml)&lt;br /&gt;{&lt;br /&gt;            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();&lt;br /&gt;            DocumentBuilder builder = factory.newDocumentBuilder();&lt;br /&gt;            InputStream is = new ByteArrayInputStream(xml.getBytes());&lt;br /&gt;            Document doc = builder.parse(is);&lt;br /&gt;            &lt;br /&gt;            NodeList list = doc.getChildNodes();&lt;br /&gt;            Node n = list.item(0);         // root element&lt;br /&gt;            NamedNodeMap attributes  = n.getAttributes();&lt;br /&gt;            &lt;br /&gt;            Node itemA = attributes.getNamedItem("myAttribute");&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;Printing the XML document:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        StringWriter sw = new StringWriter();       // write to a string&lt;br /&gt;        XMLSerializer ser = new XMLSerializer(sw, new OutputFormat(doc));&lt;br /&gt;        ser.serialize(doc.getDocumentElement());&lt;br /&gt;        String XMLStr = sw.toString();&lt;br /&gt;        System.out.println(XMLStr);&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5094257135972064172?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5094257135972064172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5094257135972064172' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5094257135972064172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5094257135972064172'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/09/java-creating-xml-document-all.html' title='Java - Writing XML document - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-1296397634030517700</id><published>2007-09-24T20:08:00.000-07:00</published><updated>2007-09-24T20:27:19.016-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu boot floppy'/><category scheme='http://www.blogger.com/atom/ns#' term='smartbootmanager'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu boot from floppy disk'/><title type='text'>Booting from floppy disk - Ubuntu</title><content type='html'>If you can not boot from your CD-ROM drive but can read from it, then you need to use the SmartBootManager. To install it under windows look here:&lt;br /&gt;&lt;br /&gt;https://help.ubuntu.com/community/SmartBootManagerHowto&lt;br /&gt;&lt;br /&gt;to install it under linux, go to the installs directory of the ubuntu install cd, put in a empty floppy, and type (as root):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;dd if=/dev/fd0 of=~/sbm.bin &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;it should print something like this when finished:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;2880+0 records in&lt;br /&gt;2880+0 records out&lt;br /&gt;1474560 bytes (1.5 MB) copied, 47.6615 seconds, 30.9 kB/s&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Assuming your floppy disk dirve is fd0.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-1296397634030517700?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/1296397634030517700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=1296397634030517700' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1296397634030517700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1296397634030517700'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/09/booting-from-floppy-disk-ubuntu.html' title='Booting from floppy disk - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5782971132850712658</id><published>2007-09-23T15:16:00.001-07:00</published><updated>2007-11-18T21:15:15.520-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='installing java'/><category scheme='http://www.blogger.com/atom/ns#' term='display problems'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu startup services'/><title type='text'>Common Problems - Xbuntu</title><content type='html'>Problem: When starting an application it says the display cannot be found, or, for example&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cutecom: cannot connect to X server&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;export DISPLAY=:0.0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;then as your normal user&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;xhost local:root&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;Problem: Adding a startup service:&lt;br /&gt;&lt;br /&gt;As root, add a file in /etc/init.d/ with the commands you want executed, then make it executable with the following command.&lt;br /&gt;&lt;pre&gt;chmod +x file&lt;br /&gt;&lt;/pre&gt;Now, add it to a runlevel.&lt;br /&gt;&lt;pre&gt;update-rc.d file defaults&lt;br /&gt;&lt;/pre&gt;This will create links from /etc/rcX.d to your new script.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;Problem: Select newly installed java runtime&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;update-alternatives --config java&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And select which option you require.&lt;br /&gt;Now, add the directory into /etc/jvm...i.e&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/usr/lib/java-x-xx&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5782971132850712658?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5782971132850712658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5782971132850712658' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5782971132850712658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5782971132850712658'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/09/common-problems-xbuntu.html' title='Common Problems - Xbuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-556115564777999197</id><published>2007-09-02T20:20:00.001-07:00</published><updated>2007-09-16T05:30:52.797-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='parallels'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><category scheme='http://www.blogger.com/atom/ns#' term='virtual machine'/><title type='text'>Virtual Box - Xubuntu</title><content type='html'>Operating System: Xubuntu (Gutsy Gibon)&lt;br /&gt;Host : Ubuntu 6.10&lt;br /&gt;&lt;br /&gt;VirtualBox is an awesome VM for Linux, akin to VMWare and Parallels. Awesome because its free, and awesome because it works.&lt;br /&gt;&lt;br /&gt;Installation is easy; add in your repo and go. Im not going to explain that; its already explained at &lt;a href="http://www.virtualbox.org/"&gt;www.virtualbox.org&lt;/a&gt;. Setting up Guest Additions is a little more difficult, and this is what I will explain below.&lt;br /&gt;&lt;br /&gt;Guest Additions is required to share directly between the host and guest systems.  On your guest, you need the linux kernel, headers and build utils. You also need to create a kernel config file, and to build it.&lt;br /&gt;&lt;br /&gt;Firstly though, start your VM, and select on the Virtual Machine Window menu -&gt; Devices -&gt; Install Guest Additions. This should mount a cd in /media/ on the guest, which you should copy to a write enabled directory. Now, build your kernel.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;apt-get install linux-source             # the kernel source code with patches&lt;br /&gt;apt-get install linux-kernel-devel       # You probably only need build-essentials&lt;br /&gt;apt-get install libncurses5-dev          # Only required for  make menuconfig&lt;br /&gt;apt-get install autoconf                 # guest additions needs this&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, unzip your source, create your linux sym link, and make your kernel&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;tar xvf linux-source-2.6.xx.tar.bz2&lt;br /&gt;ln -s /usr/src/linux /usr/src/linux-source-2.6.xx&lt;br /&gt;cd /usr/src/linux&lt;br /&gt;make menuconfig   # close, and save changes (creates a .config file)&lt;br /&gt;make &amp;amp;&amp;amp; make modules_install&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now you have a compiled copy of the kernel source for guest utils to link against. Go back to the place you copied the guest additions folder to. Run&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;./VBoxLinuxAddtions.run # You may need to chmod +x this file&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If something errors, look in /var/log/vboxadd-install.log.&lt;br /&gt;&lt;br /&gt;Restart your host. All going well, you can now add transient or machine folders. Transient shared folders only last for the length of the guest session, where as Machine folders last until removed. To create a transient directory (Virtual Machine Window menu -&gt; Device-&gt; Shared folders). And add a transient folder.&lt;br /&gt;Within your guest environment, you should now be able to mount this directory:&lt;br /&gt;&lt;pre&gt;sudo mount -t vboxsf transientFolderName folder&lt;br /&gt;&lt;/pre&gt;Files copied to this folder should be readable by your host and guest environment.&lt;br /&gt;&lt;br /&gt;Machine Folders are added via your machines settings, under the "Shared folder" option. They work in exactly the same way as transient folders.&lt;br /&gt;&lt;br /&gt;NOTE: Every time you update on your kernel on your guest operating system, you will need to reinstall guest additions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-556115564777999197?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/556115564777999197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=556115564777999197' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/556115564777999197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/556115564777999197'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/09/virtual-box-xubuntu.html' title='Virtual Box - Xubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-4567806251991046006</id><published>2007-08-19T15:35:00.000-07:00</published><updated>2007-08-19T15:39:52.815-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='netbeans 5.5'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Netbeans Errors - All</title><content type='html'>&lt;h2&gt;SVN (via SSH)&lt;/h2&gt;&lt;h3&gt;Problem&lt;/h3&gt;In a popup you'll get this message:&lt;br /&gt;org.tigris.subversion.svnclientadapter.commandline.CmdLineException: ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory&lt;br /&gt;&lt;pre&gt;Permission denied, please try again.&lt;br /&gt;ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory&lt;br /&gt;Permission denied, please try again.&lt;br /&gt;ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory&lt;br /&gt;Permission denied (publickey,password).&lt;br /&gt;svn: Connection closed unexpectedly&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;up -r HEAD /repo... --non-interactive --config-dir /pathtobeans/.netbeans/5.5.1/config/svn/config&lt;br /&gt;&lt;h3&gt;Fix&lt;/h3&gt;Install ssh-askpass. In ubuntu its as simpe as:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install ssh-askpass&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-4567806251991046006?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/4567806251991046006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=4567806251991046006' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4567806251991046006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4567806251991046006'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/08/netbeans-errors-all.html' title='Netbeans Errors - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5256260713874558555</id><published>2007-08-15T05:11:00.000-07:00</published><updated>2007-08-18T02:34:45.270-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='beast-0.7.1'/><category scheme='http://www.blogger.com/atom/ns#' term='fedora 7'/><title type='text'>Installing Beast 0.7.1 - Fedora 7</title><content type='html'>&lt;h2&gt;Fedora 7: Installing beast-0.7.1 (http://beast.gtk.org/) &lt;/h2&gt;&lt;h3&gt;Summary&lt;/h3&gt;&lt;br /&gt;Building beast requires a few libraires to be installed, and you will need the livna repo enabled. Heres a summarized list of what you will need to install:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;yum install gcc-c++ glibc2-devel glibc2-devel intltool perl-XML-Parser&lt;br /&gt;libmad-devel libvorbis-devel libogg-devel (might not be required)&lt;br /&gt;guile-devel  pango-devel gtk2-devel ruby-libart2-devel&lt;br /&gt;libxml2-python libgnomecanvas-devel&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Python 2.4 is required. If you dont have it, or have 2.5 you can make a python2.4 link to python2.5 and it seems to work ok. Also, there seems to be some files that you need to get from the SVN repository, so svn will need to be "yummed", and you'll need to check out the Beast repository.&lt;br /&gt;&lt;h2&gt; Configuring Beast&lt;/h2&gt;Ive listed all the errors i've had below, and how I got around them. To get anything to compile, you need the gcc c++ compiler.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;yum install gcc-c++&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;configure: error: Failed to detect or find glib-2.0 &gt;= 2.6.4 gthread-2.0&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;yum install glibc2-devel&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;checking for XML::Parser... configure: error: XML::Parser perl module is&lt;br /&gt;required for intltool&lt;br /&gt;&lt;br /&gt;yum install perl-XML-Parser&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;configure: WARNING: failed to detect Ogg/Vorbis library (&gt;=1.0) or&lt;br /&gt;headers&lt;br /&gt;checking for mad_stream_errorstr in -lmad... no&lt;br /&gt;configure: WARNING: failed to detect libmad (MPEG I-III audio decoder)&lt;br /&gt;or headers checking the required GSL-Loader library set...&lt;br /&gt;configure: error: Ogg/Vorbis is missing, but required&lt;br /&gt;&lt;br /&gt;yum install libmad-devel   # installs libmad&lt;br /&gt;&lt;br /&gt;yum install libvorbis-devel # install vorbis&lt;br /&gt;&lt;br /&gt;# NOTE: I also installed libogg-devel, but i dont think this is&lt;br /&gt;requried&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;configure: error: failed to detect guile headers and library v1.6&lt;br /&gt;(available from http://www.gnu.org/software/guile/guile.html) - detected&lt;br /&gt;library version: none&lt;br /&gt;&lt;br /&gt;yum install guile-devel&lt;br /&gt;&lt;br /&gt;Installing:&lt;br /&gt;guile-devel        &lt;br /&gt;&lt;br /&gt;Installing for dependencies:&lt;br /&gt;gmp                     i386       4.1.4-12.3       fedora   &lt;br /&gt;gmp                     x86_64     4.1.4-12.3       fedora          &lt;br /&gt;gmp-devel               x86_64     4.1.4-12.3       fedora         &lt;br /&gt;guile                   i386       5:1.8.1-3.fc7    fedora          &lt;br /&gt;guile                   x86_64     5:1.8.1-3.fc7    fedora          &lt;br /&gt;libtool-ltdl            i386       1.5.22-11.fc7    fedora           &lt;br /&gt;libtool-ltdl            x86_64     1.5.22-11.fc7    fedora&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;configure: WARNING: failed to detect proper sound device files&lt;br /&gt;checking for LIBPANGO_CFLAGS...&lt;br /&gt;checking for LIBPANGO_LIBS...&lt;br /&gt;configure: error: Package requirements (pangoft2 &gt;= 1.4.0) were not met.&lt;br /&gt;Consider adjusting the PKG_CONFIG_PATH environment variable if you&lt;br /&gt;installed software in a non-standard prefix.&lt;br /&gt;&lt;br /&gt;Alternatively you may set the LIBPANGO_CFLAGS and LIBPANGO_LIBS environment variables&lt;br /&gt;to avoid the need to call pkg-config.  See the pkg-config man page for&lt;br /&gt;more details.&lt;br /&gt;&lt;br /&gt;yum install pango-devel&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;configure: error: Package requirements (gtk+-2.0 &gt;= 2.6.4) were not met.&lt;br /&gt;Consider adjusting the PKG_CONFIG_PATH environment variable if you&lt;br /&gt;installed software in a non-standard prefix.&lt;br /&gt;&lt;br /&gt;Alternatively you may set the LIBGTK_CFLAGS and LIBGTK_LIBS environment variables&lt;br /&gt;to avoid the need to call pkg-config.  See the pkg-config man page for&lt;br /&gt;more details.&lt;br /&gt;&lt;br /&gt;yum install gtk2-devel&lt;br /&gt;&lt;br /&gt;Installing:&lt;br /&gt;gtk2-devel              i386       2.10.13-1.fc7    updates           3.0 M&lt;br /&gt;gtk2-devel              x86_64     2.10.13-1.fc7    updates           3.0 M&lt;br /&gt;Installing for dependencies:&lt;br /&gt;atk-devel               x86_64     1.18.0-1.fc7     fedora            129 k&lt;br /&gt;libXcursor-devel        x86_64     1.1.8-1          fedora             14 k&lt;br /&gt;libXfixes-devel         x86_64     4.0.3-1          fedora            9.5 k&lt;br /&gt;libXi-devel             x86_64     1.0.4-1          fedora             52 k&lt;br /&gt;libXinerama-devel       x86_64     1.0.2-1.fc7      fedora            8.2 k&lt;br /&gt;libXrandr-devel   &lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;configure: error: Package requirements (libart-2.0 &gt;= 2.3.8) were not met.&lt;br /&gt;Consider adjusting the PKG_CONFIG_PATH environment variable if you&lt;br /&gt;installed software in a non-standard prefix.&lt;br /&gt;&lt;br /&gt;yum install ruby-libart2-devel&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;configure: error: Package requirements (libgnomecanvas-2.0 &gt;= 2.4.0) were not met.&lt;br /&gt;&lt;br /&gt;yum install libgnomecanvas-devel&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;h2&gt; Making Beast &lt;/h2&gt;&lt;h3&gt;Compiling with guile-1.8.1&lt;/h3&gt;&lt;br /&gt;Trying to compile with guile-1.8.1 will give this error:&lt;br /&gt;&lt;br /&gt;bsescminterp.c:651: error: ‘scm_catch_body_t’ undeclared (first use in this function)&lt;br /&gt;bsescminterp.c:651: error: (Each undeclared identifier is reported only once&lt;br /&gt;bsescminterp.c:651: error: for each function it appears in.)&lt;br /&gt;bsescminterp.c:651: error: expected ‘)’ before ‘signal_marshal_sproc’&lt;br /&gt;&lt;br /&gt;...followed by some warnings, then...&lt;br /&gt;&lt;br /&gt;make[2]: *** [bsescminterp.o] Error 1&lt;br /&gt;make[2]: Leaving directory `/home/fedora/Desktop/music/beast-0.7.1/shell'&lt;br /&gt;make[1]: *** [all-recursive] Error 1&lt;br /&gt;make[1]: Leaving directory `/home/fedora/Desktop/music/beast-0.7.1'&lt;br /&gt;make: *** [all] Error 2&lt;br /&gt;&lt;br /&gt;It seems it is not possible to get beast-0.7.1 working with guile-1.8.1&lt;br /&gt;without applying this patch.&lt;br /&gt;http://bugzilla.gnome.org/attachment.cgi?id=80947&amp;amp;action=view&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.nabble.com/compiling-beast-for-guile-1.8-t3447427.html"&gt;http://www.nabble.com/compiling-beast-for-guile-1.8-t3447427.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;shell/bsescminterp.h, shell/bsescm.c, and shell/bsescminterp.c need to be modified.&lt;br /&gt;&lt;br /&gt;I manually incorporated these differences. If you require these files let me know.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;make[3]: Entering directory&lt;br /&gt;`/home/fedora/Desktop/music/beast-0.7.1/docs'&lt;br /&gt;../doxer/doxer.py doxi2man  -d mans/ -D TOP_WEBDIR "." -D BST_VERSION&lt;br /&gt;0.7.1 -I . -D DOXI_INCLUDE_FILE \"docframe.doxi\"&lt;br /&gt;/bin/sh: ../doxer/doxer.py: No such file or directory&lt;br /&gt;&lt;br /&gt;You need to copy all of ./doxer and ./docs the directory from the SVN&lt;br /&gt;version, and make sure python2.4 is installed&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;, ManGenerator, qdoxygen, qxmlparser&lt;br /&gt; File "/home/fedora/Desktop/music/beast-0.7.1/doxer/qxmlparser.py",&lt;br /&gt;line 21, in ?&lt;br /&gt;   import os, sys, re, libxml2&lt;br /&gt;ImportError: No module named libxml2&lt;br /&gt;&lt;br /&gt;yum install libxml2-python -y (Python bindings for the libxml2 library)&lt;br /&gt;&lt;br /&gt;* NOTE: To save installing 2.4, i copied the 2.5 exe to python2.4. i.e:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cp /usr/bin/python2.5 /usr/local/bin/python2.4&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;make[3]: *** No rule to make target `html/style/beast-style.css', needed&lt;br /&gt;by `all-am'.  Stop.&lt;br /&gt;make[3]: Leaving directory `/home/fedora/Desktop/music/beast-0.7.1/docs'&lt;br /&gt;&lt;br /&gt;cp ./web/styles from svn&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;0.7.1/docs/html/architecture.html'&lt;br /&gt;/usr/bin/install: cannot stat `./html/architecture.html': No such file&lt;br /&gt;or directory&lt;br /&gt;/usr/bin/install -c -m 644 './html/beast-index.html'&lt;br /&gt;'/usr/local/share/beast/v0.7.1/docs/html/beast-index.html'&lt;br /&gt;/usr/bin/install: cannot stat `./html/beast-index.html': No such file or&lt;br /&gt;directory&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;You should now be able to run "make install" even with the above errors, and it should install.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5256260713874558555?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5256260713874558555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5256260713874558555' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5256260713874558555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5256260713874558555'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/08/installing-beast-071-fedora-7.html' title='Installing Beast 0.7.1 - Fedora 7'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-4280082277770927947</id><published>2007-07-30T17:34:00.000-07:00</published><updated>2007-07-30T17:40:33.172-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='64bit linux installs'/><title type='text'>64bit Linux Installs - All</title><content type='html'>&lt;h3&gt;Adobe Flash&lt;/h3&gt;&lt;br /&gt;Yes you can install flash on a 64bit distribution. Ofcourse it doesn't run in 64bit mode, but who really cares? Heres how you install it in Fedora (from the Livna repo)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;yum install swfdec-mozilla&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Java Applets&lt;/h3&gt;&lt;br /&gt;Again, embedded java applets can be run fairly easily, just install a jre and link your gcj directory to your mozilla plugins directory.  The below example is for jre-4.1.2...&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mkdir ~/.mozilla/plugins/&lt;br /&gt;ln -s /usr/lib64/gcj-4.1.2/libgcjwebplugin.so .mozilla/plugins&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Restart firefox, then load &lt;a href="http://java.com/en/download/help/testvm.xml"&gt;this&lt;/a&gt; page to test&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-4280082277770927947?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/4280082277770927947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=4280082277770927947' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4280082277770927947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4280082277770927947'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/07/64bit-linux-installs-all.html' title='64bit Linux Installs - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-7278664061293514367</id><published>2007-07-15T21:12:00.000-07:00</published><updated>2008-01-28T13:50:28.640-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webdav'/><category scheme='http://www.blogger.com/atom/ns#' term='sunbird'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla calendar'/><title type='text'>WebDav - Apache Tomcat</title><content type='html'>An example WebDav deploy comes installed by deafult when you first install Tomcat. The default setup is readonly, and doesn't allow users to login, and write data (for things such as sharing calendar in Sunbird, Mozilla calendar etc). To enable write access you need to have a user within tomcat that has a role thats allowed to access WebDav. Users and roles can be added easily by using the tomcat admin page. Once you have done this, its a simple matter of editing the webapps/webdav/web.xml.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Server Configuration&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Firstly uncomment these lines (NOTE: I have removed all the "&lt;" and "&gt;" characters)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   init-param&lt;br /&gt;      param-name&lt;br /&gt;                readonly&lt;br /&gt;    /param-name&lt;br /&gt;      param-value&lt;br /&gt;                    false&lt;br /&gt;     /param-value&lt;br /&gt;   /init-param&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You then need to uncomment this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  login-config&lt;br /&gt;    auth-method&lt;br /&gt;                    BASIC&lt;br /&gt;   /auth-method&lt;br /&gt;    realm-name&lt;br /&gt;                Tomcat Supported Realm&lt;br /&gt;    /realm-name&lt;br /&gt; /login-config&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, add in any roles you wish to have the ability to use WebDav. In this example, the role "webdav" will have access.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  security-role&lt;br /&gt;         description&lt;br /&gt;                 An example role defined in "conf/tomcat-users.xml"&lt;br /&gt;        /description&lt;br /&gt;        role-name&lt;br /&gt;                webdav&lt;br /&gt;        /role-name&lt;br /&gt; /security-role&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now add a role in ./conf/tomcat-users.xml, such as:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;?xml version='1.0' encoding='utf-8'?&gt;&lt;br /&gt;&lt;tomcat-users&gt;&lt;br /&gt;  &lt;role rolename="webdav"/&gt;&lt;br /&gt;  &lt;user username="auser" password="apassword" roles="webdav"/&gt;&lt;br /&gt;&lt;/tomcat-users&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;to give the user "auser" access to the webdav folder. Redeploy WebDav via the tomcat manager, and WebDav folder should be now be accessible.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Testing &lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;If you wish to check access, you can use davfs2 to mount webdav folders.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sudo apt-get install davfs2  # Using Ubuntu&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Put this entry in your /etc/fstab&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;http://myserver/webdav/  /mnt/mydocs davfs rw,noauto,user 0 0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then mount it as&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mount /mnt/mydocs&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You will be prompted for a username and password. If sucessful, you shoul be able to read and write to that directory.&lt;br /&gt;&lt;br /&gt;Go&lt;a href="http://www.linuxquestions.org/linux/answers/Applications_GUI_Multimedia/Setting_up_davfs2_with_the_Ubuntu_package"&gt; here&lt;/a&gt; for more info.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Clients&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Both sunbird and Mozilla calendar support sharing calendar information via WebDav. &lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;h2&gt;Sunbird&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:-1;"&gt;&lt;span class="a"&gt;&lt;a href="www.mozilla.org/projects/calendar/sunbird"&gt;www.mozilla.org/projects/calendar/&lt;/a&gt;&lt;b&gt;&lt;a href="www.mozilla.org/projects/calendar/sunbird"&gt;sunbird&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;h3&gt;Mozilla calendar&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.twilight-systems.com/flacco/mozcal/mozcal-webdav.html"&gt;http://www.mozilla.org/projects/calendar/faq.html#remote_server&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.twilight-systems.com/flacco/mozcal/mozcal-webdav.html"&gt;http://www.twilight-systems.com/flacco/mozcal/mozcal-webdav.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-7278664061293514367?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/7278664061293514367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=7278664061293514367' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7278664061293514367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7278664061293514367'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/07/webdav-apache-tomcat.html' title='WebDav - Apache Tomcat'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5459283288123939461</id><published>2007-07-03T21:13:00.000-07:00</published><updated>2007-07-03T22:09:34.259-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Locales ubuntu apt error'/><title type='text'>Locales problem - Ubuntu 6.06</title><content type='html'>Operating System Ubuntu 6.06.&lt;br /&gt;&lt;br /&gt;Doing an apt-get update &amp;&amp;amp; apt-get upgrade gave this error:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;/var/cache/apt/archives/locales_2.3.18.3_all.deb (--unpack): trying to overwrite `/usr/share/zoneinfo/Africa/Algiers', which is also in package tzdata&lt;br /&gt;dpkg-deb: subprocess paste killed by signal (Broken pipe)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There may be other ways of fixing this, but the easiest way is to force the package to be installed:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;dpkg -i --force-overwrite /var/cache/apt/archives/locales_2.3.18.3_all.deb&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Which will then complain about belocs-locates-bin not being installed. (I uninstalled this previously, so you may not get this error)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Preparing to replace locales 2.3.18.3 (using .../locales_2.3.18.3_all.deb) ...&lt;br /&gt;Unpacking replacement locales ...&lt;br /&gt;dpkg: dependency problems prevent configuration of locales:&lt;br /&gt;locales depends on belocs-locales-bin (&gt;= 2.3.5-5ubuntu1); however:&lt;br /&gt; Package belocs-locales-bin is not configured yet.&lt;br /&gt;dpkg: error processing locales (--install):&lt;br /&gt;dependency problems - leaving unconfigured&lt;br /&gt;Errors were encountered while processing:&lt;br /&gt;locales&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;So install the dependancy.&lt;br /&gt;&lt;pre&gt;    apt-get install belocs-locales-bin&lt;br /&gt;&lt;/pre&gt;And try forcing the install again.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;SVN&lt;br /&gt;&lt;br /&gt;When I uninstalled locales, I got this SVN error (on the client):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;svn: warning: cannot set LC_CTYPE locale&lt;br /&gt;svn: warning: environment variable LANG is en_AU.UTF-8&lt;br /&gt;svn: warning: please check that your locale name is correct&lt;br /&gt;At revision 32.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To fix, install locales:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install locales&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: courier new;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-family: times new roman;"&gt;&lt;span style="font-size:100%;"&gt;You may also get this problem, when using puttty in windows to connect to the server:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;svn: Can't create tunnel: The system cannot find the file specified.&lt;br /&gt;&lt;br /&gt;&lt;/tt&gt;&lt;span style="font-family: times new roman;"&gt;&lt;/span&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-family: courier new;"&gt;&lt;span style="font-size:85%;"&gt;To fix this edit your svn config file&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-family: times new roman;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt; located here:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;%USERPROFILE%/Application Data/Subversion/config&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;/tt&gt;&lt;tt&gt;Uncomment [tunnel]&lt;br /&gt;&lt;/tt&gt;&lt;tt&gt;[tunnel]: ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe&lt;/tt&gt; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: courier new;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-family: times new roman;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-5459283288123939461?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/5459283288123939461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=5459283288123939461' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5459283288123939461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/5459283288123939461'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/07/locales-problem-ubuntu-606.html' title='Locales problem - Ubuntu 6.06'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-7945277658428094038</id><published>2007-06-23T21:39:00.000-07:00</published><updated>2007-06-23T21:43:44.752-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='samba'/><title type='text'>Windows File Sharing (Samba) - Xubuntu</title><content type='html'>By default, xubuntu doesn't come with a samba network browser, and&lt;br /&gt;samba sharing isnt enabled. This is easy to fix. To add a share&lt;br /&gt;go into&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;System-&gt; Shared Folders&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and share a folder. This will install samba (smb) for you. You can also do it&lt;br /&gt;via the synaptic package manager.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;h2&gt;Clients - pyNeighborhood&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;As far as clients go, there are a few options, but pyNeighborhood&lt;br /&gt;is small and easy to install.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;apt-get install pyNeighborhood&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You should be able to browse the network by navigating through the tree&lt;br /&gt;on the left.&lt;br /&gt;&lt;br /&gt;By default pyNeighbourhood needs root privilages in order to mount shares&lt;br /&gt;automatically under the default directory (which is /mnt/).&lt;br /&gt;If you try and mount a partition without root privilages you will get&lt;br /&gt;a  "failed to mount" error message.&lt;br /&gt;&lt;br /&gt;NOTE: If you wish to see exactly why pyNeighbourhood didn't work, run it in debug mode via&lt;br /&gt;the command line:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; pyNeighbourhood --debug&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The first thing to do to fix this is to create a directory writable by your user and&lt;br /&gt;set pyNeighbourhood to use that as its root mount point.&lt;br /&gt;&lt;br /&gt;Edit -&gt; Preferences - Mount Point&lt;br /&gt;&lt;br /&gt;Once this is done, you need to allow your user access to smbmnt and smbumount. If you dont do this&lt;br /&gt;you will get this error (in --debug mode).&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; smbmnt must be installed suid root for direct user mounts (1000,1000)&lt;br /&gt; smbmnt failed: 1&lt;br /&gt; Failed to mount&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So to allow access run this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; sudo chmod +s /usr/bin/smbmnt&lt;br /&gt; sudo chmod +s /usr/bin/smbumount&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;When you share your files, pyNeighbourhood will complain that mc isn't avaiable. This is not compulsary,&lt;br /&gt;but if you have it install you can use it to browse your files.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; apt-get install mc  # File browser&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt; Command Line&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;pre&gt;    smbtree - lists avaiable samba servers&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Mounting a samba share in your filesystem is very easy; Ive provided an example below.&lt;br /&gt;NOTE: UBUNTU is the name of the server, upload is the folder on that server,&lt;br /&gt;and /shares/ubuntu is the directory in which it will be mounted.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; mount -t smbfs //UBUNTU/upload /shares/ubuntu&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you have your shares setup with passwords you will need to append this line with&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; -o username=mywindowsusername,password=mywindowspassword&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you need this directory to be permanenty mounted, add it into&lt;br /&gt;your /etc/fstab&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; //servername/sharename /mountdirectory smbfs username=windowsuserename,password=windowspassword 0 0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Finally, creating a symbolic link on your desktop to your root share directory can be very handy.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; ln -s /shares/ /home/ubuntu/Desktop/shares&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For more complete information on pyNeighbourhood check out this site:&lt;br /&gt;&lt;a href="http://grumpymole.blogspot.com/2006/11/xubuntu-browsing-samba-shares-with.html"&gt;&lt;br /&gt;Samba Shares&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And for more info about putting samba shares into fstab:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.justlinux.com/nhf/Filesystems/Mounting_smbfs_Shares_Permanently.html"&gt;Samba &amp;amp; Fstab&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-7945277658428094038?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/7945277658428094038/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=7945277658428094038' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7945277658428094038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7945277658428094038'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/06/windows-file-sharing-samba-xubuntu.html' title='Windows File Sharing (Samba) - Xubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-2251169734827938979</id><published>2007-06-21T15:05:00.000-07:00</published><updated>2007-08-12T15:36:19.438-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='trac adminstration'/><title type='text'>Trac Adminstration - All</title><content type='html'>Create Project :&lt;br /&gt;trac-admin initenv /my/new/project&lt;br /&gt;&lt;br /&gt;Essential Plugins:&lt;br /&gt;&lt;br /&gt;Pygments ( java, C, xml highlighting)&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;project/conf/trac.ini - Trac Configuration&lt;br /&gt;&lt;br /&gt;To setup trac to send email alerts smtp must be enabled, and the from address must be vaild (actually ALL the email fields must be valid, so be careful):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[notification]&lt;br /&gt;smtp_enabled = true&lt;br /&gt;smtp_from = trac@no-reply.com&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Attachment Size:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[attachment]&lt;br /&gt;max_size = 262144&lt;br /&gt;&lt;span style="font-family: webdings;"&gt;&lt;span style="font-family: trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;Running Standalone (Runs all projects is /usr/trac/trac_projects using password file users.htdigest)&lt;br /&gt;&lt;br /&gt;tracd -p 8080 --auth *,/usr/trac/trac_projects/users.htdigest,mydomain.com -e /usr/tr&lt;br /&gt;ac/trac_projects&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: webdings;"&gt;&lt;span style="font-family: trebuchet ms;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;&lt;hr /&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: webdings;"&gt;&lt;span style="font-family: trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;SVN Upgrade script: (This script updates your svn to the latest version, then updates all your projects)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;svn update /trac_install/trac&lt;br /&gt;python /trac_install/trac/setup.py install&lt;br /&gt;trac-admin /trac_projects/MyProject upgrade # NOTE: Needs to be run on every project&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-2251169734827938979?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/2251169734827938979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=2251169734827938979' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2251169734827938979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2251169734827938979'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/06/trac-adminstration-all.html' title='Trac Adminstration - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-2166246015084459748</id><published>2007-06-21T04:47:00.000-07:00</published><updated>2007-06-23T06:25:18.897-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora 6 64bit'/><category scheme='http://www.blogger.com/atom/ns#' term='fedora 6 upgrade'/><title type='text'>Fedora 7 Upgrade - Fedora 6</title><content type='html'>Upgrading from Fedora Core 6 (64bit) to Fedora 7 (64bit) was fairly straightfoward, apart from removing alot of packages.&lt;br /&gt;&lt;br /&gt;Following the advice given here:&lt;br /&gt;&lt;a href="http://fedoraproject.org/wiki/YumUpgradeFaq#head-bdd1ed4a339aa22c95c238af0e3323c0bccf6167"&gt;Fedora Core 7 Update&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Running this command, to switch your repo's:&lt;br /&gt;&lt;pre&gt;&lt;pre&gt;rpm -Uhv ftp://download.fedora.redhat.com/pub/fedora/linux/releases/7/&lt;br /&gt;Fedora/i386/os/Fedora/fedora-release-*.noarch.rpm&lt;/pre&gt;&lt;/pre&gt;Gave me this error:&lt;br /&gt;&lt;pre&gt;fedora-release = 6 is needed by (installed)&lt;br /&gt;yum-fedorafaq-6-2007.02.03.noarch&lt;br /&gt;&lt;/pre&gt;Which can be resoved by uninstalling yum-fedorafaq (&lt;br /&gt;&lt;br /&gt;yum remove yum-fedorafaq&lt;br /&gt;&lt;br /&gt;After issuing a:&lt;br /&gt;&lt;br /&gt;yum upgrade&lt;br /&gt;&lt;br /&gt;I then had various dependency problems. To resolve them I had to remove these packages:&lt;br /&gt;&lt;br /&gt;* gaim&lt;br /&gt;* livna-config-display&lt;br /&gt;* kmod-nvidia&lt;br /&gt;* xorg-x11-drv-nvidia&lt;br /&gt;* eclipse-jdt&lt;br /&gt;* mkinitrd&lt;br /&gt;&lt;br /&gt;Uninstalling mkinird meant these packages also had to be removed:&lt;br /&gt;&lt;br /&gt;* compiz&lt;br /&gt;* fuse&lt;br /&gt;* gnome-session&lt;br /&gt;* gnome-volume-manager&lt;br /&gt;* kernel&lt;br /&gt;* mkbootdisk&lt;br /&gt;* ntfs-3g&lt;br /&gt;* pcmicautils&lt;br /&gt;&lt;br /&gt;After removing these packages I was then able to run yum upgrade.&lt;br /&gt;&lt;br /&gt;WARNING: Do NOT reboot until you have reinstalled these packages after the upgrade!!&lt;br /&gt;&lt;br /&gt;At the end of the upgrade, i was presented with this error:&lt;br /&gt;&lt;br /&gt;Transaction Check Error:&lt;br /&gt;  file /usr/bin/gcore from install of gdb-6.6-15.fc7 conflicts with file from package gdb-6.5-15.fc6&lt;br /&gt;  file /usr/share/info/gdb.info.gz from install of gdb-6.6-15.fc7 conflicts with file from package gdb-6.5-15.fc6&lt;br /&gt;  file /usr/share/info/gdbint.info.gz from install of gdb-6.6-15.fc7 conflicts with file from package gdb-6.5-15.fc6&lt;br /&gt;  file /usr/share/info/stabs.info.gz from install of gdb-6.6-15.fc7 conflicts with file from package gdb-6.5-15.fc6&lt;br /&gt;  file /etc/esd.conf from install of esound-libs-0.2.38-1.fc7 conflicts with file from package esound-0.2.36-3&lt;br /&gt;  file /usr/share/man/man1/esd.1.gz from install of esound-0.2.38-1.fc7 conflicts with file from package esound-0.2.36-3&lt;br /&gt;&lt;br /&gt;Error Summary&lt;br /&gt;-------------&lt;br /&gt;&lt;br /&gt;yum remove gdb esound&lt;br /&gt;&lt;br /&gt;# WARNING: This will cause a lot of packages to be removed. Make sure you keep a note of them so you can reinstall them later.&lt;br /&gt;&lt;br /&gt;yum upgrade # should complete now.&lt;br /&gt;&lt;br /&gt;yum install groupinstall Base # reinstall compulsary components&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;Nvidia drivers&lt;br /&gt;&lt;br /&gt;# update to the correct livna repo:&lt;br /&gt;&lt;br /&gt;rpm -ivh http://rpm.livna.org/livna-release-7.rpm&lt;br /&gt;&lt;br /&gt;# if your already using the livna repo, updating will probably give you this error:&lt;br /&gt;&lt;br /&gt;[root@localhost fedora]# rpm -ivh http://rpm.livna.org/livna-release-7.rpm&lt;br /&gt;Retrieving http://rpm.livna.org/livna-release-7.rpm&lt;br /&gt;Preparing...                ########################################### [100%]&lt;br /&gt;        file /etc/yum.repos.d/livna.repo from install of livna-release-7-2 conflicts with file from package livna-release-6-1&lt;br /&gt;&lt;br /&gt;# In which case you should run this first:&lt;br /&gt;&lt;br /&gt;yum remove livna-release&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;yum install kmod-nvidia&lt;br /&gt;&lt;br /&gt;=============================================================================&lt;br /&gt; Package                 Arch       Version          Repository        Size&lt;br /&gt;=============================================================================&lt;br /&gt;Installing:&lt;br /&gt; kmod-nvidia             x86_64     100.14.09-1.2.6.21_1.3228.fc7  livna             2.5 M&lt;br /&gt;Installing for dependencies:&lt;br /&gt; livna-config-display    noarch     0.0.12-1.lvn7    livna              55 k&lt;br /&gt; xorg-x11-drv-nvidia     x86_64     100.14.09-2.lvn7  livna             5.6 M&lt;br /&gt;&lt;br /&gt;Transaction Summary&lt;br /&gt;=============================================================================&lt;br /&gt;Install      3 Package(s)        &lt;br /&gt;Update       0 Package(s)        &lt;br /&gt;Remove       0 Package(s) &lt;br /&gt;&lt;br /&gt;livna-config-display&lt;br /&gt;&lt;br /&gt;# All going well you should have this somewhere in /etc/X11/xorg.conf:&lt;br /&gt;&lt;br /&gt;Section "Device"&lt;br /&gt;        Identifier  "Videocard0"&lt;br /&gt;        Driver      "nvidia"&lt;br /&gt;&lt;br /&gt;# If you restart x (ctrl-alt-backspace) and it wont load properly, change that driver line to:&lt;br /&gt;&lt;br /&gt;Driver "nv"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-2166246015084459748?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/2166246015084459748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=2166246015084459748' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2166246015084459748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2166246015084459748'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/06/fedora-7-upgrade-fedora-6.html' title='Fedora 7 Upgrade - Fedora 6'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-2878877788212162686</id><published>2007-06-17T19:06:00.000-07:00</published><updated>2009-07-14T20:34:24.646-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='remote desktop'/><category scheme='http://www.blogger.com/atom/ns#' term='x windows'/><category scheme='http://www.blogger.com/atom/ns#' term='remote x windows'/><title type='text'>Linux to Linux Remote X Session - All</title><content type='html'>This should work with any two computers running X-Windows.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The easy way&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;On your client machine, run xhost +&lt;b&gt;server_address&lt;/b&gt;. i.e&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;xhost +192.168.1.34&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt; &lt;br /&gt;Within the same shell, connect to the remote pc, via ssh -X user@&lt;b&gt;server_address&lt;/b&gt;. i.e&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ssh -X admin@192.168.1.34 &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now run your application.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The hard way (manually)&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;xhost +&lt;b&gt;server_address&lt;/b&gt;. ie.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;xhost +192.168.1.34&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;ssh -X user@&lt;b&gt;server_address&lt;/b&gt;. i.e&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ssh -X admin@192.168.1.34&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then, export your display, using  export DISPLAY=&lt;b&gt;client_address&lt;/b&gt;:0.0  &lt;br /&gt;i.e&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;export DISPLAY=192.168.1.5:0.0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then run your application.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-2878877788212162686?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/2878877788212162686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=2878877788212162686' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2878877788212162686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2878877788212162686'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/06/linux-to-linux-remote-x-session-all.html' title='Linux to Linux Remote X Session - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-4488511527578406293</id><published>2007-06-17T16:24:00.000-07:00</published><updated>2007-06-17T17:47:33.438-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nxclient'/><category scheme='http://www.blogger.com/atom/ns#' term='freenx'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>FreeNX: Ubuntu 6.06</title><content type='html'>Description: Setting up FreeNX client on Ubuntu 6.06.&lt;br /&gt;&lt;a href="http://freenx.berlios.de/"&gt;&lt;br /&gt;Homepage&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This article here lists how to do it:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ubuntuforums.org/showthread.php?t=1968&amp;page=25"&gt;Forums&lt;/a&gt;&lt;br /&gt;Here is a summary...&lt;br /&gt;&lt;span class="down" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;/span&gt;&lt;br /&gt;Add this to sources.list:&lt;br /&gt;&lt;br /&gt;&lt;pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 50px; text-align: left;"&gt;deb http://seveas.imbrandon.com dapper-seveas freenx&lt;br /&gt;deb-src http://seveas.imbrandon.com dapper-seveas freenx&lt;/pre&gt;&lt;br /&gt;Then add your key and update&lt;br /&gt;&lt;br /&gt;&lt;pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 50px; text-align: left;"&gt;wget http://seveas.imbrandon.com/1135D466.gpg -O- | sudo apt-key add -&lt;br /&gt;sudo apt-get update&lt;/pre&gt;&lt;br /&gt;now you should be able to install "freenx" and "nxclient"&lt;br /&gt;&lt;br /&gt;Note: The install isnt really complete: theres no symblink in bin or any other folder on path, and no icon is put in gnome.&lt;br /&gt;&lt;br /&gt;The client program is here...(dont run as root):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;/usr/NX/bin/nxclient&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now you should be able to login. My system is currently comming up with no icons though....&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;Description: Free NX - 64bit Ubuntu Fiesty&lt;br /&gt;&lt;br /&gt;Aparently this cannot be done, and you will get this error:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-4488511527578406293?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/4488511527578406293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=4488511527578406293' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4488511527578406293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/4488511527578406293'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/06/freenx-ubuntu-606.html' title='FreeNX: Ubuntu 6.06'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-1368149988448896619</id><published>2007-06-15T00:50:00.000-07:00</published><updated>2007-06-15T05:09:42.180-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='postgresql'/><title type='text'>PHP &amp; PostgreSQL - All</title><content type='html'>Heres a quick guide to getting PHP going with PostgreSQL.&lt;br /&gt;&lt;br /&gt;Ive listed a few useful functions below.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;Database Connection:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre&gt; $DB_HOST = "192.168.1.10";&lt;br /&gt;$DB_USER = "database_user";  // login username&lt;br /&gt;$DB_PASS = "donthackme";     // login password&lt;br /&gt;&lt;br /&gt;/** Create DB connection and returns connection ID. */&lt;br /&gt;function getDBConnection() {&lt;br /&gt;&lt;br /&gt;global $DB_HOST,$DB_NAME, $DB_USER,$DB_PASS;&lt;br /&gt;&lt;br /&gt;$id = pg_connect("host=" . $DB_HOST . " dbname=" . $DB_NAME .&lt;br /&gt;   " user=" . $DB_USER . " password=" . $DB_PASS ) or die('Could&lt;br /&gt;   not connect: ' . pg_last_error());&lt;br /&gt;&lt;br /&gt; if (!$id) {&lt;br /&gt;         die("getDBConnection : Could not connect -&gt; "&lt;br /&gt;         . pg_errormessage($id));&lt;br /&gt;         exit;&lt;br /&gt; }&lt;br /&gt; return $id;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-size:130%;"&gt;Queries:&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;/** Executes query on @param conn */&lt;br /&gt;function executeQuery($conn, $query) {&lt;br /&gt;&lt;br /&gt; $resultRS = pg_query($conn, $query) or die('ExecuteQuery :&lt;br /&gt;            Query failed: '. $query . ':' . pg_last_error());&lt;br /&gt;&lt;br /&gt; if (!$resultRS) {&lt;br /&gt;         echo "ExecuteQuery :: An error occured : " . $query . "\n";&lt;br /&gt;         exit;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; return $resultRS;&lt;br /&gt;}&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-size:130%;"&gt;Example Query:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;executeQuery($conn, 'INSERT INTO "database"."tableName"&lt;br /&gt;          ("tableID","name") VALUES (' . $id . ',\'a name\');'&lt;/pre&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;Auto Increment:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;Auto Increment works differently to MySQL. To set a&lt;br /&gt;column to auto increment, you should&lt;br /&gt;set the columns default value to the value of a sequence. i.e.&lt;br /&gt;&lt;br /&gt;nextval('dbname.tablename_tableID_seq'::text) ,where&lt;br /&gt;'dbname.tablename_tableID_seq' is a sequence.&lt;br /&gt;&lt;br /&gt;/** Returns the next id number of an auto incremented field.&lt;br /&gt;  $sequenceNumber should be in the format "tableName_tableID_seq"&lt;br /&gt;  (i.e. dont include the database name. */&lt;br /&gt;&lt;pre&gt;$DB_SCHEMA = "dbschema";&lt;br /&gt;&lt;br /&gt;function getNextID($conn, $sequenceNumber) {&lt;br /&gt;&lt;br /&gt; global $DB_SCHEMA;&lt;br /&gt;&lt;br /&gt; $query = 'SELECT nextval(\'' . $DB_SCHEMA . '.' .&lt;br /&gt; $sequenceNumber . '\') AS id';&lt;br /&gt; $rs = executeQuery($conn, $query);&lt;br /&gt; $id = getFirstResult($rs);&lt;br /&gt; return $id;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/** Returns first result in the first row in&lt;br /&gt;  resultset $rs. Returns -1 on fail. */&lt;br /&gt;&lt;br /&gt;function getFirstResult($rs) {&lt;br /&gt;      $ID = -1;&lt;br /&gt;&lt;br /&gt;      if ($row = pg_fetch_row($rs)) {&lt;br /&gt;&lt;br /&gt;              if ( $row[0] != NULL ) {&lt;br /&gt;                      $ID = $row[0];&lt;br /&gt;              }&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      pg_free_result($rs);&lt;br /&gt;      return $ID;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Georgia,serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-1368149988448896619?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/1368149988448896619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=1368149988448896619' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1368149988448896619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1368149988448896619'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/06/php-postgresql-all.html' title='PHP &amp; PostgreSQL - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-6510633555494930678</id><published>2007-06-07T15:30:00.000-07:00</published><updated>2007-06-14T06:15:15.797-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LFS'/><category scheme='http://www.blogger.com/atom/ns#' term='epkg'/><category scheme='http://www.blogger.com/atom/ns#' term='encap'/><category scheme='http://www.blogger.com/atom/ns#' term='runit'/><category scheme='http://www.blogger.com/atom/ns#' term='linux from scratch'/><title type='text'>Linux From Scratch 6.06 - Live CD</title><content type='html'>Installing LFS 6.06&lt;br /&gt;&lt;br /&gt;After trying to install LFS  using Ubuntu 7.04, and running in to several problems, I decided to use the LFS live CD as my host system. If this is your first LFS install or are a Linux noob, I'd suggest you do the same. I have listed errors that I have had with both, and how I got around them.&lt;br /&gt;&lt;br /&gt;Most of the problems I've had have been from following the instructions incorrectly.&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;There are a few things to keep in mind:&lt;br /&gt;&lt;br /&gt;-  Do NOT ignore any errors until you are satisfied they will not affect anything.&lt;br /&gt;- Always check config.log for any errors during a build&lt;br /&gt;- Unless otherwise specified make sure you unpack the source, cd to a DIFFERENT directory and run ../package-name/configure from that directory,&lt;br /&gt;then make &amp;&amp;amp; make install.&lt;br /&gt;- If you've had errors when trying to build, or are coming back to rebuild a package, make sure you run "make distclean", or "make clean" so that the package is completely rebuilt.&lt;br /&gt;&lt;br /&gt;- If you restart your PC make sure you setup your chroot environment correctly again:&lt;br /&gt;&lt;br /&gt;export LFS=/lfs/dir&lt;br /&gt;&lt;br /&gt;mount -vt devpts devpts $LFS/dev/pts&lt;br /&gt;mount -vt tmpfs shm $LFS/dev/shm&lt;br /&gt;mount -vt proc proc $LFS/proc&lt;br /&gt;mount -vt sysfs sysfs $LFS/sys&lt;br /&gt;&lt;br /&gt;chroot "$LFS" /usr/bin/env -i \&lt;br /&gt;HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \&lt;br /&gt;PATH=/bin:/usr/bin:/sbin:/usr/sbin \&lt;br /&gt;/bin/bash --login&lt;br /&gt;&lt;br /&gt;- the "which" command will tell you where the command is that your running&lt;br /&gt;- find /boot/lfskernel-2.6.16.27 will tell you which partition your linux image is on&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;2. Preparing a new partition&lt;br /&gt;&lt;br /&gt;This is fairly straight forward if you know how to use fdisk, mount, swap and mk2fs. If your struggling, turn to your friend google.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;3. Packages&lt;br /&gt;&lt;br /&gt;Ive listed problems and solutions below:&lt;br /&gt;&lt;br /&gt;---------- Live CD problems ----------&lt;br /&gt;&lt;br /&gt;Package: GCC&lt;br /&gt;&lt;br /&gt;Error:&lt;br /&gt;&lt;br /&gt;configure: error: Building in the source directory is not supported in this release. See http://gcc.gnu.org/install/configure.html for more details.&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;create a new directory, and run configure and make from there&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;Package: BASH&lt;br /&gt;Error:&lt;br /&gt;&lt;br /&gt;/tools/bin/sh: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;copy the ncurses libraries in manually. I think this may have been caused by installing a later version by accident.&lt;br /&gt;&lt;br /&gt;cp &lt;ncursessourcedir&gt;/lib/libncursesw.so.5* /tools/lib/&lt;br /&gt;&lt;br /&gt;&lt;/ncursessourcedir&gt;&lt;hr /&gt;&lt;ncursessourcedir&gt;&lt;br /&gt;&lt;br /&gt;Package: GCC&lt;br /&gt;(http://www.linuxfromscratch.org/lfs/view/stable/chapter06/gcc.html)&lt;br /&gt;&lt;br /&gt;Error:&lt;br /&gt;&lt;br /&gt;In file included from ../../gcc-4.0.3/gcc/crtstuff.c:64:&lt;br /&gt;../../gcc-4.0.3/gcc/tsystem.h:90:19: error: stdio.h: No such file or directory&lt;br /&gt;../../gcc-4.0.3/gcc/tsystem.h:93:23: error: sys/types.h: No such file or directory&lt;br /&gt;../../gcc-4.0.3/gcc/tsystem.h:96:19: error: errno.h: No such file or directory&lt;br /&gt;../../gcc-4.0.3/gcc/tsystem.h:103:20: error: string.h: No such file or directory&lt;br /&gt;../../gcc-4.0.3/gcc/tsystem.h:104:20: error: stdlib.h: No such file or directory&lt;br /&gt;../../gcc-4.0.3/gcc/tsystem.h:105:20: error: unistd.h: No such file or directory&lt;br /&gt;In file included from /build/gcc-build/build/gcc/include/syslimits.h:7,&lt;br /&gt;          from /build/gcc-build/build/gcc/include/limits.h:11,&lt;br /&gt;          from ../../gcc-4.0.3/gcc/tsystem.h:108,&lt;br /&gt;          from ../../gcc-4.0.3/gcc/crtstuff.c:64:&lt;br /&gt;/build/gcc-build/build/gcc/include/limits.h:122:61: error: limits.h: No such file or directory&lt;br /&gt;In file included from ../../gcc-4.0.3/gcc/crtstuff.c:64:&lt;br /&gt;../../gcc-4.0.3/gcc/tsystem.h:111:18: error: time.h: No such file or directory&lt;br /&gt;make[1]: *** [crtbegin.o] Error 1&lt;br /&gt;make[1]: Leaving directory `/build/gcc-build/build/gcc'&lt;br /&gt;make: *** [all-gcc] Error 2&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;Patch gcc-4.0.3-specs-1.patch was applied to remove /usr/include from GCC's search. Remove patched version of GCC build, replace with original version and rebuild.&lt;br /&gt;&lt;/ncursessourcedir&gt;&lt;hr /&gt;&lt;ncursessourcedir&gt;&lt;br /&gt;&lt;br /&gt;Package: GCC&lt;br /&gt;Error: (make)&lt;br /&gt;&lt;br /&gt;Make[3]: Leaving directory `/build/gcc-build/build/i686-pc-linux-gnu/libmudflap'&lt;br /&gt;make[2]: Leaving directory `/build/gcc-build/build/i686-pc-linux-gnu/libmudflap'&lt;br /&gt;make[1]: *** [check-recursive] Error 1&lt;br /&gt;make[1]: Target `check' not remade because of errors.&lt;br /&gt;make[1]: Leaving directory `/build/gcc-build/build/i686-pc-linux-gnu/libmudflap'&lt;br /&gt;make: *** [check-target-libmudflap] Error 2&lt;br /&gt;make[1]: Entering directory `/build/gcc-build/build/i686-pc-linux-gnu/libiberty'&lt;br /&gt;make[2]: Entering directory `/build/gcc-build/build/i686-pc-linux-gnu/libiberty/testsuite'&lt;br /&gt;make[2]: Nothing to be done for `check'.&lt;br /&gt;make[2]: Leaving directory `/build/gcc-build/build/i686-pc-linux-gnu/libiberty/testsuite'&lt;br /&gt;make[1]: Leaving directory `/build/gcc-build/build/i686-pc-linux-gnu/libiberty'&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;make distclean and try again&lt;br /&gt;&lt;br /&gt;&lt;/ncursessourcedir&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;Package: Kernel&lt;br /&gt;Error: (clean / make)&lt;br /&gt;&lt;br /&gt;root:/build/linux/linux-2.6.16.27# make mrproper&lt;br /&gt;/bin/sh: sed: command not found&lt;br /&gt;Makefile:524: /build/linux/linux-2.6.16.27/arch//Makefile: No such file or directory&lt;br /&gt;make: *** No rule to make target `/build/linux/linux-2.6.16.27/arch//Makefile'.  Stop.&lt;br /&gt;root:/build/linux/linux-2.6.16.27# make menuconfig&lt;br /&gt;/bin/sh: sed: command not found&lt;br /&gt;Makefile:438: /build/linux/linux-2.6.16.27/arch//Makefile: No such file or directory&lt;br /&gt;make: *** No rule to make target `/build/linux/linux-2.6.16.27/arch//Makefile'.  Stop.&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;- sed hasnt been installed correctly&lt;br /&gt;&lt;br /&gt;reinstall sed.&lt;br /&gt;&lt;br /&gt;I did this outside of the chrooted session, using this:&lt;br /&gt;./configure --prefix=/mnt/lfs/usr --bindir=/mnt/lfs/bin &amp;&amp;amp;amp;amp;amp;amp;amp;amp; make &amp;&amp;amp; make install&lt;br /&gt;&lt;ncursessourcedir&gt;check to see if sed is now in /bin/&lt;br /&gt;&lt;br /&gt;&lt;/ncursessourcedir&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;Package: Grub&lt;br /&gt;Error: (configuring)&lt;br /&gt;&lt;br /&gt;&lt;ncursessourcedir&gt;grub&gt; root (hd0,3)&lt;br /&gt;Error 21: Selected disk does not exist&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;/dev/ devices did not exist.&lt;br /&gt;&lt;br /&gt;reinstalling lfs_bootscripts (while NOT chrooted) will populate /dev/&lt;br /&gt;and /proc&lt;br /&gt;&lt;br /&gt;Tip:&lt;br /&gt;&lt;br /&gt;&lt;/ncursessourcedir&gt;- find /boot/lfskernel-2.6.16.27 will show you if grub can find your linux image.&lt;br /&gt;&lt;br /&gt;Notes:&lt;br /&gt;&lt;br /&gt;"Filesystem type is ext2fs, partition type 0x83" will be displayed even if your partition is ext3&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;Package: Grub&lt;br /&gt;Error: (running)&lt;br /&gt;&lt;br /&gt;&lt;ncursessourcedir&gt;error 15 file not found&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;Make sure you have spelt your linux image version correctly in /boot/grub/menu.lst&lt;br /&gt;&lt;br /&gt;&lt;/ncursessourcedir&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;--------------------&lt;ncursessourcedir&gt; Ubuntu 6.06 errors &lt;/ncursessourcedir&gt;--------------------&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ncursessourcedir&gt;Note: I didnt complete this install, so what I have suggested is quite probably wrong&lt;br /&gt;&lt;br /&gt;Package: BinUtils&lt;br /&gt;Error: (configure)&lt;br /&gt;&lt;br /&gt;configure: error: installation or configuration problem: C compiler cannot create executables.&lt;br /&gt;&lt;br /&gt;Check config.log in bin-utils directory... Most likely its says this:&lt;br /&gt;&lt;br /&gt;configure:1938: gcc -o conftest    conftest.c  1&gt;&amp;5&lt;br /&gt;/usr/bin/ld: crt1.o: No such file: No such file or directory&lt;br /&gt;collect2: ld returned 1 exit status&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;apt-get install libc6-dev&lt;br /&gt;&lt;br /&gt;Package: GCC&lt;br /&gt;Error: (configure)&lt;br /&gt;&lt;br /&gt;configure: error: installation or configuration problem: C compiler cannot create executables.&lt;br /&gt;&lt;br /&gt;config.log:&lt;br /&gt;&lt;br /&gt;/tools/bin/ld: unrecognized option '--hash-style=both'&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;append CC compile flag to configure&lt;br /&gt;&lt;br /&gt;CC="gcc -B/usr/bin" gcc-4.0.3/configure --prefix=/tools ...&lt;br /&gt;&lt;br /&gt;&lt;/ncursessourcedir&gt;&lt;hr /&gt;&lt;br /&gt;&lt;ncursessourcedir&gt;&lt;br /&gt;Package: GCC&lt;br /&gt;Error: (make)&lt;br /&gt;&lt;br /&gt;make[1]: Entering directory `/mnt/lfs/build/gcc-build/gcc-4.0.3/build-i686-pc-linux-gnu/libiberty'&lt;br /&gt;make[1]: *** No rule to make target `../include/ansidecl.h', needed by `regex.o'.  Stop.&lt;br /&gt;make[1]: Leaving directory `/mnt/lfs/build/gcc-build/gcc-4.0.3/build-i686-pc-linux-gnu/libiberty'&lt;br /&gt;make: *** [all-build-libiberty] Error 2&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;This is caused by building inside the source directory...just do it outside it and it will work fine&lt;br /&gt;&lt;br /&gt;&lt;/ncursessourcedir&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ncursessourcedir&gt;Package: GLIBC&lt;br /&gt;Error: (make)&lt;br /&gt;&lt;br /&gt;/build/glibc/csu/version.o.dt -MT /mnt/lfs/build/glibc/csu/version.o&lt;br /&gt;In file included from version.c:33:&lt;br /&gt;/mnt/lfs/build/glibc/csu/version-info.h:2: error: missing terminating " character&lt;br /&gt;/mnt/lfs/build/glibc/csu/version-info.h:3: error: missing terminating " character&lt;br /&gt;version.c:40: error: syntax error before string constant&lt;br /&gt;make[2]: *** [/mnt/lfs/build/glibc/csu/version.o] Error 1&lt;br /&gt;make[2]: Leaving directory `/mnt/lfs/build/glibc/glibc-2.3.6/csu'&lt;br /&gt;make[1]: *** [csu/subdir_lib] Error 2&lt;br /&gt;make[1]: Leaving directory `/mnt/lfs/build/glibc/glibc-2.3.6'&lt;br /&gt;make: *** [all] Error 2&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;modify /mnt/lfs/build/glibc/csu/version-info.h: and add a " character on line 2 &amp;amp; 3&lt;br /&gt;&lt;br /&gt;&lt;/ncursessourcedir&gt;&lt;hr /&gt;&lt;ncursessourcedir&gt;LFS extensions&lt;br /&gt;&lt;/ncursessourcedir&gt;&lt;hr /&gt;Package management (epkg):&lt;br /&gt;&lt;br /&gt;http://www.encap.org/&lt;br /&gt;&lt;br /&gt;My computer cannot seem to access the package repo, making it hard to test the install...will update soon.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;Runlevel manager: runit (http://smarden.org/runit/)&lt;br /&gt;&lt;br /&gt;By default LFS uses init. If you wish to experiment with something different, especially to see how run levels work (i.e what happens after the kernel is loaded) installing runinit is an excellent way of doing it.&lt;br /&gt;&lt;br /&gt;Installation:&lt;br /&gt;&lt;br /&gt;Follow the steps outlined here:&lt;br /&gt;&lt;br /&gt;http://smarden.org/runit/replaceinit.html#sysv&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;Setting up the terminal script&lt;br /&gt;&lt;br /&gt;Your getty terminal run script is contained here.&lt;br /&gt;/etc/sv/getty-5/*&lt;br /&gt;&lt;br /&gt;If you look at the run script within this directory, you'll see that it is set to execute /sbin/getty...this needs to be changed to /sbin/agetty.&lt;br /&gt;It is also set to run on tty5. This means that when it starts you have to switch to virtual terminal 5 (ALT-5) in order to see the prompt.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;Migrating the runlevels&lt;br /&gt;&lt;br /&gt;LFS puts it inital run level scripts in /etc/rc.d/init.d/*. This needs to be translated into /etc/runit/1 . This is what I have so far:&lt;br /&gt;&lt;br /&gt;/etc/rc.d/init.d/mountkernelfs start # start virtual file systems (proc)&lt;br /&gt;/etc/rc.d/init.d/udev start  # mount devices&lt;br /&gt;/etc/rc.d/init.d/swap start   # activate swap files&lt;br /&gt;/etc/rc.d/init.d/checkfs start # check the disk&lt;br /&gt;/etc/rc.d/init.d/mountfs start # mount the disk&lt;br /&gt;/etc/rc.d/init.d/cleanfs start  # clean tmp dirs&lt;br /&gt;/etc/rc.d/init.d/setclock start # setup clock&lt;br /&gt;/etc/rc.d/init.d/rc 3  # general runlevel script&lt;br /&gt;/etc/rc.d/init.d/console start # configure console&lt;br /&gt;&lt;br /&gt;to test, modify your grub and set init=/sbin/runit-init.&lt;br /&gt;It should load the kernel as per normal, then kick into runit.&lt;br /&gt;Remember you will need to switch to tty5 (ALT-5) in order to get to the terminal&lt;br /&gt;after runit reaches run level 2.&lt;br /&gt;&lt;br /&gt;TODO: Shutdown script (/dev/initctl not found)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ncursessourcedir&gt;&lt;br /&gt;&lt;/ncursessourcedir&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-6510633555494930678?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/6510633555494930678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=6510633555494930678' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6510633555494930678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6510633555494930678'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/06/linux-from-scratch-live-cd.html' title='Linux From Scratch 6.06 - Live CD'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-1842629033945146625</id><published>2007-06-05T20:28:00.000-07:00</published><updated>2007-09-23T15:28:40.849-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='general linux applications'/><title type='text'>Linux Applications - All</title><content type='html'># Applications&lt;br /&gt;&lt;br /&gt;# Development Environments&lt;br /&gt;&lt;br /&gt;netbeans                                         # General IDE&lt;br /&gt;eclipse                                               # General IDE&lt;br /&gt;ktechlab                                            # PIC micro-controller IDE&lt;br /&gt;&lt;br /&gt;# Development tools&lt;br /&gt;&lt;br /&gt;trac                                # Bug tracking and project mangment (compatiable with svn)&lt;br /&gt;trac - pygments                   # Syntax highlighting&lt;br /&gt;svn                                                                                    # Code repository&lt;br /&gt;&lt;a href="http://prdownload.berlios.de/mpy-svn-stats/"&gt;svn-stats &lt;/a&gt;                                                     # SVN statistics generator&lt;br /&gt;meld                                                                              # diff viewer&lt;br /&gt;vncviewer                                                # vnc client&lt;br /&gt;virtualbox             # virtual machine application (like VMware and parallels)&lt;br /&gt;quanta plus              # web development tool &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.kpdus.com/jad.html"&gt;jad&lt;/a&gt;                                               # Java decompiler (NOTE: get statically linked version for less hassles)&lt;br /&gt;&lt;a href="http://proguard.sourceforge.net/"&gt;proguard&lt;/a&gt;                   # Java obfuscator and optimizer&lt;br /&gt;firefox                                           # Webbrowser&lt;br /&gt;agave                 # Colour Scheme designer&lt;br /&gt;&lt;br /&gt;# Backup&lt;br /&gt;&lt;br /&gt;dar                      # Differential backup&lt;br /&gt;&lt;br /&gt;# General&lt;br /&gt;&lt;br /&gt;gaim                                               # Chat client ( mutiprotocol)&lt;br /&gt;amsn                                              # Chat client (webcam)&lt;br /&gt;mpc                                                 # music client&lt;br /&gt;mantis                                       # php bug tracking application&lt;br /&gt;&lt;br /&gt;# Accounting&lt;br /&gt;&lt;br /&gt;compiere&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-1842629033945146625?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/1842629033945146625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=1842629033945146625' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1842629033945146625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/1842629033945146625'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/06/linux-applications-all.html' title='Linux Applications - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-7514857483538574213</id><published>2007-06-04T18:25:00.000-07:00</published><updated>2007-06-28T22:41:08.580-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='incremental backup'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='dar'/><title type='text'>Incremental Backup - dar - All</title><content type='html'>--- backup ---&lt;br /&gt;dar&lt;br /&gt;&lt;br /&gt;FLAGS:&lt;br /&gt;&lt;br /&gt;-c /root/filename              # backup filename (NOTE: extention and slice number are added by dar)&lt;br /&gt;-R /                                       # Backup directory. (root in this case)&lt;br /&gt;&lt;br /&gt;-s 100M    # Slice size is 100Megs&lt;br /&gt;-S 100M    # First slice 100 megs&lt;br /&gt;-p -b      # Pause flag; -b terminal bell&lt;br /&gt;-z         # gzip compression. -z1 bzip2 compression&lt;br /&gt;-X "*~" -X ".*~" # Excluded files (re-flag each option)&lt;br /&gt;-P dev/pts      # Excude directory (re-flag each option; NOTE: must ALWAYS be relative to -R dir)&lt;br /&gt;-D          # Add excluded directories as empty directories&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-A /file/backup   # Creates differential backup from base backup specified&lt;br /&gt;&lt;br /&gt;EXAMPLE:&lt;br /&gt;&lt;br /&gt;dar -c /mnt/zip/linux_full -s 100M -S 95M -p -b -z -R / -X "*~" -X ".*~" -P dev/pts -P proc -P mnt/zip -D&lt;br /&gt;&lt;br /&gt;TASKS:&lt;br /&gt;&lt;br /&gt;dar -l backupfile       # Lists backup file&lt;br /&gt;dar -t backupfile       # Check backup file&lt;br /&gt;dar -d /path/backupfile -R /backup/path        # Check dar "backupfile" against backup'ed filesystem&lt;br /&gt;&lt;br /&gt;--- restoring ---&lt;br /&gt;&lt;br /&gt;# Run dar binary file (self extracting), extracts&lt;br /&gt;# to zip/linux_full, then restores to /disk&lt;br /&gt;&lt;br /&gt;/disk/dar_static -x /zip/linux_full -R /disk -b&lt;br /&gt;&lt;br /&gt;FLAGS:&lt;br /&gt;&lt;br /&gt;-w              # dont warn&lt;br /&gt;-r              # dont overwrite more recent files&lt;br /&gt;-b              # beep on prompt&lt;br /&gt;&lt;br /&gt;# Additional files are done the same way&lt;br /&gt;&lt;br /&gt;/disk/dar_static -x /zip/linux_diff2 -R /disk -b -w&lt;br /&gt;&lt;br /&gt;--- Restore single files ---&lt;br /&gt;&lt;br /&gt;# Restore fromdar -R / -x /zip/linux_diff29 -v -g home/denis/my_precious_file&lt;br /&gt;&lt;br /&gt;# If file doesn't exist in this diff&lt;br /&gt;&lt;br /&gt;dar -x /zip/linux_diff29 -R / -r -v -g home/denis/my_precious_file -g etc/fstab&lt;br /&gt;sepcified diff file&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-7514857483538574213?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/7514857483538574213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=7514857483538574213' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7514857483538574213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/7514857483538574213'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/06/incremental-backup-dar-all.html' title='Incremental Backup - dar - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-8603326892612549268</id><published>2007-05-08T18:46:00.000-07:00</published><updated>2008-08-19T01:12:38.708-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='apache tomcat ssl'/><category scheme='http://www.blogger.com/atom/ns#' term='ssl'/><category scheme='http://www.blogger.com/atom/ns#' term='apache ssl'/><category scheme='http://www.blogger.com/atom/ns#' term='tomcat ssl'/><title type='text'>Apache Tomcat &amp; SSL - ALL</title><content type='html'>To setup SSL in tomcat you have to create a certificate keystore by executing the following command:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and specify a password value of "changeit".&lt;br /&gt;&lt;br /&gt;This will generate a key file in your home directory. WARNING: If you load tomcat as a different user, it will display an error, and you will need to regenerate or move this key file into their home directory.&lt;br /&gt;&lt;br /&gt;Uncomment the "SSL HTTP/1.1 Connector" entry in $CATALINA_HOME/conf/server.xml and tweak as necessary.&lt;br /&gt;&lt;br /&gt;If your using Java version 1.3 or lower:&lt;br /&gt;&lt;br /&gt;   * Download the Java Secure Socket Extensions (JSSE) package, version 1.0.2 or later, from http://java.sun.com/products/jsse/&lt;br /&gt;&lt;br /&gt;   * Install JSSE extension by copying all three JAR files (jcert.jar, jnet.jar, and jsse.jar) into your %JAVA_HOME%/jre/lib/ext directory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-8603326892612549268?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/8603326892612549268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=8603326892612549268' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8603326892612549268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8603326892612549268'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/05/apache-tomcat-ssl-all.html' title='Apache Tomcat &amp; SSL - ALL'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-993420376537976278</id><published>2007-05-07T18:50:00.000-07:00</published><updated>2007-05-07T19:10:05.099-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='public directory'/><category scheme='http://www.blogger.com/atom/ns#' term='tomcat'/><category scheme='http://www.blogger.com/atom/ns#' term='browsable directory'/><title type='text'>Tomcat - Publicly Listed Directory - All</title><content type='html'># To setup a directory that is browesable,  create a new directory in your tomcat webapps folder. In this example I called it "public". You then need to create a directory within this, called WEB-INF. In this folder create a new file called web.xml as listed below. &lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE web-app&lt;br /&gt;    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"&lt;br /&gt;    "http://java.sun.com/dtd/web-app_2_3.dtd"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;web-app&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;display-name&amp;gt;public&amp;lt;/display-name&amp;gt;&lt;br /&gt;    &amp;lt;description&amp;gt;File Browsing Application for the Document Share&amp;lt;/description&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;!-- Enable directory listings by overriding the server default web.xml --&amp;gt;&lt;br /&gt;    &amp;lt;!-- definition for the default servlet --&amp;gt;&lt;br /&gt;    &amp;lt;servlet&amp;gt;&lt;br /&gt;        &amp;lt;servlet-name&amp;gt;DefaultServletOverride&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;        &amp;lt;servlet-class&amp;gt;org.apache.catalina.servlets.DefaultServlet&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;        &amp;lt;init-param&amp;gt;&lt;br /&gt;            &amp;lt;param-name&amp;gt;listings&amp;lt;/param-name&amp;gt;&lt;br /&gt;            &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;        &amp;lt;/init-param&amp;gt;&lt;br /&gt;        &amp;lt;load-on-startup&amp;gt;1&amp;lt;/load-on-startup&amp;gt;&lt;br /&gt;    &amp;lt;/servlet&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;!-- Add a mapping for our new default servlet --&amp;gt;&lt;br /&gt;    &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;        &amp;lt;servlet-name&amp;gt;DefaultServletOverride&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;        &amp;lt;url-pattern&amp;gt;/&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;    &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/web-app&amp;gt;&lt;br /&gt;&lt;br /&gt;(NOTE: Heres the link to display XML in a blog &lt;a href="http://www.stanford.edu/~bsuter/js/convert.html"&gt;http://www.stanford.edu/~bsuter/js/convert.html&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;# Restart tomcat. Tomcat Manager should now list a new application called "public".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-993420376537976278?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/993420376537976278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=993420376537976278' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/993420376537976278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/993420376537976278'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/05/tomcat-public-listed-directory-all.html' title='Tomcat - Publicly Listed Directory - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-973598600030129053</id><published>2007-04-26T03:21:00.000-07:00</published><updated>2007-06-17T19:06:11.398-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='remote connection'/><category scheme='http://www.blogger.com/atom/ns#' term='remote desktop'/><category scheme='http://www.blogger.com/atom/ns#' term='cygwin'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Cygwin Remote Desktop - Ubuntu</title><content type='html'>Server Operating System: Ubuntu 7.04&lt;br /&gt;Client Operating System: Windows XP&lt;br /&gt;&lt;br /&gt;#Two ways you can connect to a linux operating system remotely are VNC and using Cywin, which is a Windows ports of many GNU packages. As VNC is fairly easy to configure, I will explain how to get Cygwin to remotely connect to a remote X Windows (Gnome, KDE etc) server.&lt;br /&gt;&lt;br /&gt;#Install Cygwin on the Client. It can be downloaded from &lt;a href="http://www.cygwin.com/mirrors.html"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;#Install SSH package during the Cygwin install. It can be found in the category "net", and is called "openssh"&lt;br /&gt;&lt;br /&gt;# Once installed, you can start a local xsession (in windows) via the command:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;startx.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;# You should now have a "X" icon on your taskbar. If you hover over the icon, it will tell what your display is running on; most properly "0.0". If this is the case, run this command (and substitue 0.0 with whatever you get):&lt;br /&gt;&lt;br /&gt;export DISPLAY=localhost:0.0&lt;br /&gt;&lt;br /&gt;# Tell xserver to allow connections from your remote server; substitue "remote_host" with your remote server's IP address.&lt;br /&gt;&lt;br /&gt;xhost  +remote_host&lt;br /&gt;&lt;br /&gt;# Now you are ready to connect to your remote server using ssh. Install the ssh daemon on your remote server. In ubunu this is done via:&lt;br /&gt;&lt;br /&gt;apt-get install openssh-server&lt;br /&gt;&lt;br /&gt;# It should start automatically; but if it doesn't, run:&lt;br /&gt;&lt;br /&gt;/etc/init.d/ssh start&lt;br /&gt;&lt;br /&gt;# From your client (the Windows machine), connect to your remote server using SSH. This example assumes "user" is the username on the server, and 10.0.0.6 is the servers IP:&lt;br /&gt;&lt;br /&gt;ssh user@10.0.0.6&lt;br /&gt;&lt;br /&gt;# When connected, run this command, replacing 10.0.0.9 with the IP address of your client(the windows machine)&lt;br /&gt;&lt;br /&gt;export DISPLAY=10.0.0.9:0.0&lt;br /&gt;&lt;br /&gt;# Now if you run a xwindows application, it should appear on your clients machine.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;Linux to Linux - Connecting to X Windows Remotely:&lt;br /&gt;&lt;br /&gt;ssh -X # This is the easiest way&lt;server&gt;&lt;/server&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-973598600030129053?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/973598600030129053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=973598600030129053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/973598600030129053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/973598600030129053'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/04/cygwin-remote-desktop-ubuntu.html' title='Cygwin Remote Desktop - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-9193057008917810034</id><published>2007-04-25T16:00:00.000-07:00</published><updated>2007-04-25T16:33:42.500-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='login'/><category scheme='http://www.blogger.com/atom/ns#' term='plain'/><category scheme='http://www.blogger.com/atom/ns#' term='sendmail'/><category scheme='http://www.blogger.com/atom/ns#' term='authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Sendmail - PLAIN / LOGIN authentction - Ubuntu</title><content type='html'>Operating System Ubuntu 6.06&lt;br /&gt;&lt;br /&gt;apt-get install sendmail&lt;br /&gt;&lt;br /&gt;# By default, sendmail only allows access from localhost. Configuration files are in /etc/mail&lt;br /&gt;&lt;br /&gt;# In access, you need to allow access to your network. In this case 192.168.X.X&lt;br /&gt;&lt;br /&gt;Connect:192.168                 RELAY&lt;br /&gt;GreetPause:192.168              0&lt;br /&gt;ClientRate:192.168              0&lt;br /&gt;ClientConn:192.168              0&lt;br /&gt;&lt;br /&gt;# In sendmail.mc you need to update these lines, and removed the Addr="" clause, so that it will receive from any addresses:&lt;br /&gt;&lt;br /&gt;FEATURE(`no_default_msa')dnl&lt;br /&gt;dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp')dnl&lt;br /&gt;DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp')dnl&lt;br /&gt;dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission')dnl&lt;br /&gt;DAEMON_OPTIONS(`Family=inet,  Name=MSP-v4, Port=submission')dnl&lt;br /&gt;&lt;br /&gt;# Now if you run one of these...&lt;br /&gt;&lt;br /&gt;#       * `sendmailconfig`&lt;br /&gt;#       * `make`&lt;br /&gt;#       * `m4 /etc/mail/sendmail.mc &gt; /etc/mail/sendmail.cf`&lt;br /&gt;&lt;br /&gt;# And restart the service (/etc/init.d/sendmail restart) you should now be able to use your server.&lt;br /&gt;&lt;br /&gt;# Settings up Authentication - Add these lines to sendmail.cf, if they dont exist:&lt;br /&gt;&lt;br /&gt;define(`confAUTH_OPTIONS', `A')dnl&lt;br /&gt;dnl #&lt;br /&gt;TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl&lt;br /&gt;define(`confAUTH_MECHANISMS', `DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl&lt;br /&gt;dnl #&lt;br /&gt;&lt;br /&gt;# Setting up users:&lt;br /&gt;&lt;br /&gt;http://www.elwoods.org/home/2006/12/13/sendmail-ubuntu-yahoo-and-you/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-9193057008917810034?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/9193057008917810034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=9193057008917810034' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/9193057008917810034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/9193057008917810034'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/04/sendmail-plain-login-authentction.html' title='Sendmail - PLAIN / LOGIN authentction - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-2584710428558477208</id><published>2007-04-12T15:06:00.000-07:00</published><updated>2007-11-13T14:19:45.329-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cdrecord'/><category scheme='http://www.blogger.com/atom/ns#' term='command line'/><category scheme='http://www.blogger.com/atom/ns#' term='cd rom'/><category scheme='http://www.blogger.com/atom/ns#' term='burning'/><category scheme='http://www.blogger.com/atom/ns#' term='burn iso command line linux'/><title type='text'>CD burning Script - All</title><content type='html'># This is a simple script that will burn a cd via command line. You need mkisofs and cdrecord.&lt;br /&gt;&lt;br /&gt;# The device your cdrom is assigned to can be found in /etc/fstab (hopefully)&lt;br /&gt;&lt;br /&gt;# make iso. This makes a iso with label Backup of all files in ./backup_iso/&lt;br /&gt;# Remember you can put symbolic links in this directory.&lt;br /&gt;&lt;br /&gt;mkisofs -f -R -r -l -J -V1  -ABackup  -o backup.iso  ./backup_iso/&lt;br /&gt;&lt;br /&gt;# Find out what your device is called, and look for devname: '&lt;device&gt;'&lt;br /&gt;&lt;br /&gt;cdrecord -checkdrive&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# record cd at 15 speed. My cdrom device is /dev/cdrw&lt;br /&gt;&lt;br /&gt;cdrecord -v -pad speed=15 dev=/dev/cdrw backup.iso&lt;br /&gt;&lt;br /&gt;# clean up&lt;br /&gt;&lt;br /&gt;rm backup.iso&lt;br /&gt;&lt;br /&gt;# NOTE: You can also burn an iso via:&lt;br /&gt;&lt;br /&gt;growisofs -Z /dev/cdrw=filename.iso&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-2584710428558477208?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/2584710428558477208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=2584710428558477208' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2584710428558477208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2584710428558477208'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/04/cd-burning-script-all.html' title='CD burning Script - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-8811355956442543012</id><published>2007-04-11T23:19:00.000-07:00</published><updated>2007-07-30T23:26:42.893-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='command line applications'/><title type='text'>Linux Command Line Apps - All</title><content type='html'>&lt;h2&gt;Command Line Applications&lt;br /&gt;&lt;/h2&gt;If your Linux system is low on resources, or if you just feel like you've been away from the command line too long, here are a few command line applications you can use.&lt;br /&gt;&lt;h3&gt;Music Player (mp3 etc)&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;mpd&lt;/span&gt; (server) &lt;span style="font-weight: bold;"&gt;ncmpc&lt;/span&gt; (client)  http://www.musicpd.org/.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;mplayer&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt; Msn Client&lt;br /&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a style="font-weight: bold;" href="http://tmsnc.sourceforge.net/download.htm"&gt;tmsn&lt;/a&gt;  Ncurses based Msn client.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Bittorrent Client&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;btdownload&lt;/span&gt; (or &lt;span style="font-weight: bold;"&gt;btdownloadcurses).&lt;/span&gt; Note: if btdownload runs slowly, it may be because your running in passive mode (i.e you haven't allowed incoming connections. You can do this by opening up incomming port(s) on your router (and firewall), and specfying the --minport flag. btdownload will now test each port going up from --minport. NOTE: Each new instance of btdownload will need its own port.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;FTP Client&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;yafc&lt;/span&gt; Easy to use FTP client. Connection is in the format ftp://user:password@myftpserver.com. Other commands are very similar to standard linux commands (i.e ls, cd). Download and upload files via get and put respectively.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-8811355956442543012?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/8811355956442543012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=8811355956442543012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8811355956442543012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8811355956442543012'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/04/linux-command-line-apps-all.html' title='Linux Command Line Apps - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-6775488974225998901</id><published>2007-04-11T18:06:00.000-07:00</published><updated>2012-01-27T05:03:01.722-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='table modification'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='auto increment'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>MySQL Adding Auto Increment Column to existing table</title><content type='html'>This alters table "tableName" , and adds a new column "autoIncrementColumn".&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;b&gt;ALTER TABLE tableName ADD autoIncrementColumn MEDIUMINT NOT NULL AUTO_INCREMENT KEY&lt;br /&gt;&lt;/b&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This modifies an existing column to be auto increment.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;b&gt;ALTER TABLE tableName MODIFY tableNameID MEDIUMINT NOT NULL AUTO_INCREMENT;&lt;br /&gt;&lt;/b&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;This sets the next auto increment value to 10. Useful if you already have data in the table that you are modifying.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;b&gt;ALTER TABLE tableName AUTO_INCREMENT = 10;&lt;br /&gt;&lt;/b&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/code&gt;&lt;br /&gt;This modifies "myColumn" to have a default value of 0.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;b&gt;ALTER TABLE myTable ALTER COLUMN myColumn SET DEFAULT 0;&lt;/b&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-6775488974225998901?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/6775488974225998901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=6775488974225998901' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6775488974225998901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6775488974225998901'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/04/mysql-adding-auto-increment-column-to.html' title='MySQL Adding Auto Increment Column to existing table'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-75549535790658886</id><published>2007-04-07T17:48:00.000-07:00</published><updated>2007-04-10T18:59:12.503-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='intel'/><category scheme='http://www.blogger.com/atom/ns#' term='dual core'/><category scheme='http://www.blogger.com/atom/ns#' term='core2 duo'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Enabling Core 2 Duo Support - Ubuntu</title><content type='html'>Operating System: Ubuntu 7.04 Beta&lt;br /&gt;&lt;br /&gt;# After installing Fiesty on a Core 2 Duo machine, I noticed that Ubuntu's performance was poor.  After installing the kernel I see that by default the kernel is compiled for the x68 instruction set (for compatibility reasons I assume), and does not have SMP (i.e. hyper threading) enabled .  This isn't good! We have to get our hands dirty for this one; recompiling the kernel is required.&lt;br /&gt;&lt;br /&gt;#  You need the kernel source. Get it via apt-get linux-source, or via manually at http://packages.ubuntu.com/, Once this has run, you should have a .tar.bz2 file in /usr/src. Extract this here:&lt;br /&gt;&lt;br /&gt;bunzip2 &lt;sourcefile.tar.bz2&gt;&lt;br /&gt;tar -xvf&lt;br /&gt;&lt;br /&gt;# Create linux symbolic link to the newly created directory (while in the /usr/src directory)&lt;br /&gt;&lt;br /&gt;ln -s /usr/linux/ linux&lt;br /&gt;&lt;br /&gt;# all the tools required for installing the kernel:&lt;br /&gt;&lt;br /&gt;apt-get install build-essential&lt;br /&gt;apt-get install kernel-package&lt;br /&gt;apt-get install gcc-3.4&lt;span style="color:Red;"&gt;&lt;/span&gt;&lt;br /&gt;apt-get install libncurses5&lt;br /&gt;&lt;kernel-source.deb&gt;&lt;br /&gt;&lt;sourcedirectory&gt;&lt;br /&gt;&lt;br /&gt;# Configure&lt;br /&gt;&lt;br /&gt;make menuconfig&lt;br /&gt;&lt;br /&gt;# You need to enable these options in menuconfig:&lt;br /&gt;&lt;br /&gt;Processor Type and Features -&gt; SubArchitecture Type -&gt; Support for ScalarMP vSMP&lt;br /&gt;&lt;/sourcedirectory&gt;&lt;/kernel-source.deb&gt;Processor Type and Features -&gt; Intel Core2&lt;br /&gt;Processor Type and Features -&gt; Symmetric multi-processor support&lt;br /&gt;Processor Type and Features -&gt; SMP (Hyperthreading) Scheduler support&lt;br /&gt;Processor Type and Features -&gt; Multi-Core Scheduler support&lt;br /&gt;&lt;kernel-source.deb&gt;&lt;sourcedirectory&gt;&lt;br /&gt;# Now use ubuntu to create a .deb install. Note smp12 is the revision name; you can call it what you wish, but it must contain a number.&lt;br /&gt;&lt;br /&gt;/usr/src/linux# make-kpkg -initrd --revision=smp12 kernel_image kernel_headers modules_image&lt;br /&gt;&lt;br /&gt;# When this has finished, install the package that has been created (i.e)&lt;br /&gt;&lt;br /&gt;dpgk -i &lt;linux-image-2.6.20.3-ubuntu1_smp12_amd64.deb&gt;&lt;filename.deb&gt;&lt;br /&gt;&lt;br /&gt;# After reinstalling any kernel you will need to reinstall any video driver patches (i.e. Nvdia) or X windows will complain.&lt;/filename.deb&gt;&lt;/linux-image-2.6.20.3-ubuntu1_smp12_amd64.deb&gt;&lt;/sourcedirectory&gt;&lt;/kernel-source.deb&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-75549535790658886?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/75549535790658886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=75549535790658886' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/75549535790658886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/75549535790658886'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/04/enabling-dual-core-support-ubuntu.html' title='Enabling Core 2 Duo Support - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-3586633621372935323</id><published>2007-04-07T17:15:00.000-07:00</published><updated>2007-04-07T17:46:07.562-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='write support'/><category scheme='http://www.blogger.com/atom/ns#' term='ntfs'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>NTFS Read / Write Support - Fedora</title><content type='html'>Operating System: Fedora 6&lt;br /&gt;&lt;br /&gt;Linux now supports NTFS read/write support using Third Generation NTFS Driver. To install:&lt;br /&gt;&lt;br /&gt;yum install ntfs-3g&lt;br /&gt;&lt;br /&gt;# Find your ntfs partition&lt;br /&gt;&lt;br /&gt;/sbin/fdisk -l&lt;br /&gt;....&lt;br /&gt;/dev/sda5            7649       30400   182755408+   7  HPFS/NTFS&lt;br /&gt;....&lt;br /&gt;&lt;br /&gt;# Mount partiton to the /mnt/ntfs directory:&lt;br /&gt;&lt;br /&gt;ntfs-3g     /dev/sda5     /mnt/ntfs&lt;br /&gt;&lt;br /&gt;# You should now have read/write support to your NTFS partition.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-3586633621372935323?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/3586633621372935323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=3586633621372935323' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3586633621372935323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3586633621372935323'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/04/ntfs-read-write-support-fedora-6.html' title='NTFS Read / Write Support - Fedora'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-2735348370612424285</id><published>2007-04-04T16:47:00.000-07:00</published><updated>2007-10-12T19:25:13.388-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mp3'/><category scheme='http://www.blogger.com/atom/ns#' term='divx'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Enabling divx, mp3 and other restricted codecs - Ubuntu</title><content type='html'>&lt;ul&gt;&lt;li&gt;&lt;p&gt; Ensure the relevant repositories are enabled. Click &lt;strong&gt;System → Administration → Synaptic Package Manager → Settings → Repositories&lt;/strong&gt; and then click &lt;strong&gt;Add&lt;/strong&gt;. Check the &lt;strong&gt;Community maintained (Universe)&lt;/strong&gt; and &lt;strong&gt;Non-free (Multiverse) boxes.&lt;/strong&gt; When you close the window, click &lt;strong&gt;Reload&lt;/strong&gt;. &lt;/p&gt; &lt;/li&gt;&lt;li&gt;&lt;p&gt; Install the packages. While you could install packages individually using Synaptic, here is one case where any Ubuntu user can save a lot of time by using the command line. Quit out of Synaptic, then click &lt;strong&gt;Application → Accessories → Terminal &lt;/strong&gt; and install all these packages:&lt;br /&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sudo apt-get install&lt;br /&gt;&lt;br /&gt;Edgy:&lt;br /&gt;&lt;br /&gt;gstreamer0.10-pitfdll gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse gxine libxine-main1 libxine-extracodecs ogle ogle-gui&lt;br /&gt;&lt;br /&gt;Feisty:&lt;br /&gt;&lt;br /&gt;apt-get install gstreamer0.10-plugins-ugly gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad&lt;br /&gt;&lt;br /&gt;Gusty:&lt;br /&gt;&lt;br /&gt;sudo apt-get install gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly-multiverse gxine libxine1-ffmpeg ogle ogle-gui&lt;br /&gt;&lt;br /&gt;NOTE: If you still dont hear sound your volume is probabaly not set correctly; use &lt;pre&gt;alsamixer&lt;/pre&gt; to set it up correctly (Press "M" to unmute a channel). For some reason sound will not work at all if I have Duplicate Front muted.&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-2735348370612424285?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/2735348370612424285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=2735348370612424285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2735348370612424285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/2735348370612424285'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/04/ubuntu-enabling-divx-mp3-codecs.html' title='Enabling divx, mp3 and other restricted codecs - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-3734381646055445254</id><published>2007-04-04T16:14:00.001-07:00</published><updated>2008-12-03T13:22:33.303-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gaim'/><category scheme='http://www.blogger.com/atom/ns#' term='google talk'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='settings'/><title type='text'>Gaim Google Talk Settings - All</title><content type='html'>Operating System : All&lt;br /&gt;&lt;br /&gt;Protocol: &lt;strong&gt;Jabber&lt;br /&gt;&lt;/strong&gt;Screen Name: Full Gmail &lt;strong&gt;username (no @gmail.com)&lt;br /&gt;&lt;/strong&gt;Server: &lt;strong&gt;gmail.com&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;--Advanced &lt;span style="font-weight: bold;"&gt;--&lt;/span&gt;&lt;strong&gt;&lt;br /&gt;&lt;br /&gt;“Use TLS if available”&lt;/strong&gt;&lt;br /&gt;Port: &lt;strong&gt;5223&lt;br /&gt;&lt;/strong&gt;Connect server: &lt;strong&gt;talk.google.com&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-3734381646055445254?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/3734381646055445254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=3734381646055445254' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3734381646055445254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/3734381646055445254'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/04/gaim-google-talk-settings.html' title='Gaim Google Talk Settings - All'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-869303096572768544</id><published>2007-03-31T18:57:00.000-07:00</published><updated>2007-04-07T17:31:48.899-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bittorrent'/><category scheme='http://www.blogger.com/atom/ns#' term='command line'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Command Line Bittorrent - Ubuntu</title><content type='html'>Operating System Ubuntu 6.10&lt;br /&gt;&lt;br /&gt;# To install Bittornado, run&lt;br /&gt;&lt;br /&gt;apt-get bittornado&lt;br /&gt;&lt;br /&gt;# All bittornado commands are prefixed with "bt"&lt;br /&gt;&lt;br /&gt;# To start downloading a torrent:&lt;br /&gt;&lt;br /&gt;btdownloadcurses.bittornado &lt;.torrent url&gt; &lt;url&gt;&lt;/url&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-869303096572768544?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/869303096572768544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=869303096572768544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/869303096572768544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/869303096572768544'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/03/ubuntu-bittornado-command-line.html' title='Command Line Bittorrent - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-8574313183408559286</id><published>2007-03-31T17:03:00.000-07:00</published><updated>2007-09-21T23:06:49.208-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='screen resolution'/><category scheme='http://www.blogger.com/atom/ns#' term='nvidia'/><category scheme='http://www.blogger.com/atom/ns#' term='drivers'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Installing Nvidia Drivers - Ubuntu</title><content type='html'>&lt;pre&gt;&lt;span style="font-family:lucida grande;"&gt;Operating System: Ubuntu 6.10 &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;# Install these modules:&lt;br /&gt;&lt;br /&gt;sudo apt-get install nvidia-glx nvidia-kernel-common&lt;br /&gt;&lt;br /&gt;# This script automatically updates your X11 (display) configuration.&lt;br /&gt;&lt;br /&gt;sudo nvidia-xconfig&lt;br /&gt;&lt;/pre&gt; &lt;ul&gt;&lt;li&gt;Should the above not enable the new driver, you can enable it manually by opening the X config file:  &lt;/li&gt;&lt;/ul&gt; &lt;pre&gt;sudo gedit /etc/X11/xorg.conf&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt; &lt;ul&gt;&lt;li&gt;and replacing "nv" with "nvidia" in the driver section :&lt;/li&gt;&lt;/ul&gt;Section "Device"&lt;br /&gt;      Identifier  "Videocard0"&lt;br /&gt;      Driver      "nvidia"&lt;br /&gt;      Option      "AddARGBGLXVisuals" "True"&lt;br /&gt;EndSection&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Restart gnome ( Ctrl - Alt - Backspace)&lt;/li&gt;&lt;/ul&gt;# If Gnome doesn't load correctly, you can check your logs in /var/log/Xorg.*.log  (* will be a number) or any errors. Check for any lines with (EE) , as this is an error. (i.e. more /var/log/Xorg.0.log | grep "(EE)"). If you change your driver line back to "nv", gnome will use the default driver, so you can load Gnome again while you fix the problem.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Screen resolution&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;If you wan to change your screen resolution and it is not listed under Settings -&gt; Display Settings, you can configure your Screen device via&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sudo displayconfig-gtk&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This will bring up a Screen and Graphics preferences configuration window. It doesn't seem to be listed on any menu. NOTE: you may need to restart X after you've finshed modifying things.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;64Bit Linux (FATAL: Error running install command for nvidia) error:&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Details&lt;/h3&gt;After a kernel update when running 64bit Ubuntu, the kernel wasn't patched properly. When logging into gdm I got the usual nvidia module errors. Doing a modprobe gave me this error:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ sudo modprobe nvidia&lt;br /&gt;FATAL: Error running install command for nvidia&lt;br /&gt;&lt;/pre&gt;&lt;h3&gt;Fix&lt;/h3&gt;Firstly, to find out if the drivers are installed, check to see if nvidia.ko exists:&lt;br /&gt;&lt;pre&gt;$ find /lib/modules/`uname -r` -name "nvidia.ko" -exec ls -la {} \;&lt;br /&gt;-rw-r--r-- 1 root root 8644254 2007-06-13 07:49 /lib/modules/2.6.20-16-generic/kernel/drivers/video/nvidia.ko&lt;br /&gt;&lt;/pre&gt;If the second line comes up, your nvidia driver exists. If not, manually install your drivers, replacing --kerenel-source-path with whatever kernel you wish to use (NOTE: Always try using the package manager first, that way updates will be installed automatically)&lt;br /&gt;&lt;pre&gt;sh NVIDIA-Linux-x86_64-1.0-9755-pkg2.run --kernel-source-path=/usr/src/linux-headers-2.6.20-16-lowlatency&lt;br /&gt;&lt;/pre&gt;By now you should have your nvidia drivers installed; issue the previous find command to verify. Now, try modprobe nvidia again. If this still fails, remove the file below.&lt;br /&gt;&lt;pre&gt;rm -f /lib/linux-restricted-modules/.nvidia_new_installed&lt;br /&gt;&lt;/pre&gt;If this still doesn't work try  removing the line referencing nvidia in /etc/modprobe.d/lrm-video&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-8574313183408559286?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/8574313183408559286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=8574313183408559286' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8574313183408559286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/8574313183408559286'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/03/ubuntu-610-installing-nvidia-drivers.html' title='Installing Nvidia Drivers - Ubuntu'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-6863331724374838610</id><published>2007-03-28T20:07:00.000-07:00</published><updated>2007-04-07T17:14:59.376-07:00</updated><title type='text'>ASUS Z8100 Laptop Wireless - Fedora</title><content type='html'># Operating system: Fedora Core 6&lt;br /&gt;# After battling with ndiswrapper, i found a driver that supports the ASUS USB2.0 wireless adapter (zd1211).&lt;br /&gt;&lt;br /&gt;# Development wiki is here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://zd1211.ath.cx/wiki/" target="_blank"&gt;http://zd1211.ath.cx/wiki/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;# The driver is installed as a module using the standard install kernel, so to get it working all thats required is&lt;br /&gt;&lt;br /&gt;modprobe z1211     # Load module&lt;br /&gt;ifconfig eth1 up       # Bring up adapter&lt;br /&gt;&lt;br /&gt;# Once your adapter has come to life, you can see it using&lt;br /&gt;iwconfig eth1&lt;br /&gt;&lt;br /&gt;# You can then scan for networks using&lt;br /&gt;&lt;br /&gt;iwlist eth1 scan&lt;br /&gt;&lt;br /&gt;# From here you can see your access points ESSID. You need to set your adapter's essid to the same as your access points:&lt;br /&gt;&lt;br /&gt;iwconfig eth1 ESSID &lt;youressidhere&gt;&lt;br /&gt;&lt;br /&gt;# Start DHCP&lt;br /&gt;&lt;br /&gt;dhclient eth1&lt;br /&gt;&lt;br /&gt;# To configure your adapter to use WEP or WPA, use wpa_supplicant&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6426783599253857495-6863331724374838610?l=programminglinuxblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminglinuxblog.blogspot.com/feeds/6863331724374838610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6426783599253857495&amp;postID=6863331724374838610' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6863331724374838610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6426783599253857495/posts/default/6863331724374838610'/><link rel='alternate' type='text/html' href='http://programminglinuxblog.blogspot.com/2007/03/asus-z8100-wireless.html' title='ASUS Z8100 Laptop Wireless - Fedora'/><author><name>Ben Leov</name><uri>http://www.blogger.com/profile/15031638621690508091</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_khpY5iE-peM/ShoWONWK4II/AAAAAAAAABU/zw8auWxTuRw/S220/2891_1136286968867_1278129351_403300_675671_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6426783599253857495.post-5001919335869226661</id><published>2007-03-28T17:03:00.000-07:00</published><updated>2007-05-22T16:29:39.273-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gwt'/><category scheme='http://www.blogger.com/atom/ns#' term='development'/><category scheme='http://www.blogger.com/atom/ns#' term='Google Web Toolkit'/><title type='text'>Google Web Toolkit - All</title><content type='html'>&lt;span style="font-weight: bold;"&gt;GWT Forms Problem&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;- Any "inner" panel that is added to a "main" panel, do not set the size of the "inner" to 100% as we will get an extensive gap even though we have cellpadding and cellspacing set to zero.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Common Errors&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;- Any class that extend IsSerializable must have an empty constructor.&lt;br /&gt;- All Async class methods must return null.&lt;br /&gt;- Javascript errors often occur when attempting to use an uninitilized or null variable.&lt;br /&gt;- Any class that extends Composite should call initWidget(widget) method before adding anything onto it "widget" - FlexTable.add - will cause errors ("add() cannot be empty")&lt;br /&gt;- Make sure ALL IsSerilizable objects that a
