<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HowToBSD &#187; Development</title>
	<atom:link href="http://howtobsd.com/tag/development/feed" rel="self" type="application/rss+xml" />
	<link>http://howtobsd.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 11 Feb 2014 11:21:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>1030 &#8211; Got error -1 from storage engine</title>
		<link>http://howtobsd.com/development/1030-got-error-1-from-storage-engine.html</link>
		<comments>http://howtobsd.com/development/1030-got-error-1-from-storage-engine.html#comments</comments>
		<pubDate>Sun, 13 Nov 2011 23:39:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[problems & solutions]]></category>

		<guid isPermaLink="false">http://howtobsd.com/?p=524</guid>
		<description><![CDATA[I am using on one project InnoDB type of tables. There is very important have actual data. So I am actively using foreign keys for tables linking. And once I came across problem when tried to delete from table (`group`) which linked by foreign key with another table (`subgroup`) which linked by foreign key with [...]]]></description>
				<content:encoded><![CDATA[<p>I am using on one project InnoDB type of tables. There is very important have actual data. So I am actively using foreign keys for tables linking. And once I came across problem when tried to delete from table (`group`) which linked by foreign key with another table (`subgroup`) which linked by foreign key with another table (`item`).<br />
This is error shown by phpmyadmin:<br />
<code>Error<br />
SQL query:<br />
DELETE FROM `fancypets`.`groups` WHERE `groups`.`group_id` =1<br />
MySQL said: Documentation<br />
#1030 - Got error -1 from storage engine </code></p>
<p>this error a got through mysql command line:</p>
<p><code>mysql> delete from groups where `group_id`=4;<br />
ERROR 1030 (HY000): Got error -1 from storage engine</code></p>
<p>It is mysql&#8217;s error log:</p>
<p><code>Cannot delete/update rows with cascading foreign key constraints that exceed max depth of 250</code><br />
If you use 5.1.51- Just update your mysql-server version.<br />
This is bug of mysql-server-5.1.51 &#8211; after:<br />
<code>#portupgrade mysql-server</code></p>
<p>problem disappeared.</p>
]]></content:encoded>
			<wfw:commentRss>http://howtobsd.com/development/1030-got-error-1-from-storage-engine.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation Redmine on FreeBSD</title>
		<link>http://howtobsd.com/software/redmine-on-freebsd.html</link>
		<comments>http://howtobsd.com/software/redmine-on-freebsd.html#comments</comments>
		<pubDate>Sat, 22 Oct 2011 15:32:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[problems & solutions]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://howtobsd.com/?p=500</guid>
		<description><![CDATA[Perhaps you know redmine ported in FreeBSD and first of all I tried to install it: #cd /usr/ports/www/redmine ===> redmine-1.2.1_1 is marked as broken: Does not work with RubyGems 1.8. *** Error code 1 Stop in /usr/ports/www/redmine. Sure. You wouldn&#8217;t read this post if process had been done successfully Maintainer of this port marked this [...]]]></description>
				<content:encoded><![CDATA[<p>Perhaps you know redmine ported in FreeBSD and first of all I tried to install it:</p>
<p><code>#cd /usr/ports/www/redmine<br />
===>  redmine-1.2.1_1 is marked as broken: Does not work with RubyGems 1.8.<br />
*** Error code 1</p>
<p>Stop in /usr/ports/www/redmine.</code></p>
<p>Sure. You wouldn&#8217;t read this post if process had been done successfully <img src='http://howtobsd.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Maintainer of this port marked this port as broken because of bug in Gem 1.8.</p>
<p>As result we have to install it manually. Hopefully we have official <a href="http://www.redmine.org/projects/redmine/wiki/RedmineInstall">installation guide</a>.</p>
<p>I came across with some problems during installation. So, this post will be a guide adapted for FreeBSD with some errors and solutions.<br />
Hope it will be useful. It seems as long process, but really easy. Let&#8217;s start.</p>
<p><strong>1) Get Redmine (I used svn for it):</strong></p>
<p><code>#svn co http://redmine.rubyforge.org/svn/branches/1.2-stable redmine-1.2</code></p>
<p><strong>2) Create database:</strong><br />
<code>mysql -uuser -ppasword<br />
mysql> create database redmine character set utf8;<br />
mysql> create user 'redmine'@'localhost' identified by 'passforuser';<br />
mysql> grant all privileges on redmine.* to 'redmine'@'localhost';<br />
mysql>exit;</code><br />
<strong><br />
3) Database configuration (copy from config/database.yml.example). config/database.yml:</strong><br />
<code>production:<br />
  adapter: mysql<br />
  database: redmine<br />
  host: localhost<br />
  username: redmine<br />
  password: passforuser</code></p>
<p><strong>4)Generate a session store secret.</strong><br />
<code>#rake generate_session_store<br />
Missing the i18n 0.4.2 gem. Please `gem install -v=0.4.2 i18n`</code></p>
<p>At this place started problems. Don&#8217;t worry. Just do thing redmine suggests. </p>
<p><code>#gem install -v=0.4.2 i18n<br />
Fetching: i18n-0.4.2.gem (100%)<br />
Successfully installed i18n-0.4.2<br />
1 gem installed<br />
Installing ri documentation for i18n-0.4.2...<br />
Installing RDoc documentation for i18n-0.4.2...</code></p>
<p>trying again:</p>
<p><code>#rake generate_session_store<br />
Missing the Rails 2.3.11 gem. Please `gem install -v=2.3.11 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.</code></p>
<p>I tried update  RAILS_GEM_VERSION (on 3.0.5) but Redmine doesn&#8217;t work with 3.0.5 yet, so:</p>
<p><code># gem install -v=2.3.11 rails</code></p>
<p>then again:<br />
<code># rake generate_session_store<br />
rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)<br />
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.<br />
    at /vol1/www/www.slim/httdocs/redmine/redmine-1.2/lib/tasks/email.rake:170</code></p>
<p>Googled the problem and found out it connected with rake version (need to downgrade):</p>
<p><code># gem install -v=0.8.7 rake<br />
Fetching: rake-0.8.7.gem (100%)<br />
Successfully installed rake-0.8.7<br />
1 gem installed<br />
Installing ri documentation for rake-0.8.7...<br />
Installing RDoc documentation for rake-0.8.7...</code></p>
<p><code># gem uninstall -v=0.9.2 rake<br />
Successfully uninstalled rake-0.9.2</code></p>
<p>finally it done:<br />
<code># rake generate_session_store<br />
(in /vol1/www/www.slim/httdocs/redmine/redmine-1.2)</code></p>
<p><strong>5) Database migration:</strong><br />
<code># rake db:migrate RAILS_ENV=production<br />
(in /vol1/www/www.slim/httdocs/redmine/redmine-1.2)<br />
rake aborted!<br />
syntax error on line 8, col 2: `  encoding: utf8'</p>
<p>(See full trace by running task with --trace)</code></p>
<p>Problem was &#8211; I missed space in config/database.yml before the password.</p>
<p><code># rake db:migrate RAILS_ENV=production<br />
(in /vol1/www/www.slim/httdocs/redmine/redmine-1.2)<br />
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.<br />
rake aborted!<br />
no such file to load -- mysql</code></p>
<p>installing gem mysql:<br />
<code>howtobsd# gem install mysql</code></p>
<p>and then:<br />
<code>howtobsd# rake db:migrate RAILS_ENV=production</code></p>
<p>db migration done!</p>
<p><strong>6) Load default data (recommended):</strong><br />
<code># rake redmine:load_default_data  RAILS_ENV=production<br />
(in /vol1/www/www.slim/httdocs/redmine/redmine-1.2)</p>
<p>Select language: bg, bs, ca, cs, da, de, el, en, en-GB, es, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en]</code></p>
<p>Choose language and moving ahead. </p>
<p><strong>7)According to manual set permissions (create required folders if it doesn&#8217;t exist):</strong></p>
<p><code>chown -R username:username files log tmp public/plugin_assets<br />
chmod -R 755 files log tmp public/plugin_assets</code></p>
<p><strong>8) Test installation:</strong><br />
<code>#ruby script/server webrick -e production<br />
=> Booting WEBrick<br />
=> Rails 2.3.11 application starting on http://0.0.0.0:3000</p>
<p>now you can enter in your browser http://localhost:3000</code></p>
<p>    *  login: admin<br />
    * password: admin</p>
<p>Great! It is works!</p>
<p><strong>9) We only need to configure Apache for redmine.</strong><br />
It is described in my article <a href="software/installing-ruby-on-rails-on-freebsd.html"> &#8220;Installing Ruby on Rails on FreeBSD&#8221;</a> with differences in httpd.conf for new versions.<br />
Now for me it:<br />
<code>LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/ext/apache2/mod_passenger.so<br />
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5<br />
PassengerRuby /usr/local/bin/ruby18</code></p>
<p><strong>10)My example of virtual host for redmine:</strong><br />
<code>&lt;VirtualHost *:80&gt;<br />
        ServerName my-projects.com<br />
        DocumentRoot /vol1/www/www.slim/httdocs/redmine/redmine-1.2/public/<br />
        RailsEnv production<br />
        ErrorLog /vol1/www/www.slim/httdocs/redmine/redmine-1.2/log/httpd.log<br />
&lt;/VirtualHost&gt;</code></p>
<p>That&#8217;s all!</p>
]]></content:encoded>
			<wfw:commentRss>http://howtobsd.com/software/redmine-on-freebsd.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Batch convert files using iconv</title>
		<link>http://howtobsd.com/development/batch-convert-files-using-iconv.html</link>
		<comments>http://howtobsd.com/development/batch-convert-files-using-iconv.html#comments</comments>
		<pubDate>Sat, 10 Sep 2011 20:47:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://howtobsd.com/?p=429</guid>
		<description><![CDATA[Converting file from KOI8-R to utf-8: #iconv -f KOI8-R -t utf-8 originalfile > newfile You can change KOIR-8 and utf-8 to yours. Batch converting files from folder: #mkdir new; for a in $(find . -name "*.php"); do iconv -f KOI8-R -t utf-8 &#60;"$a" &#62;new/"$a" ; done It will make &#8220;new&#8221; directory with converted files.]]></description>
				<content:encoded><![CDATA[<p>Converting  file from KOI8-R to utf-8:<br />
<code>#iconv -f KOI8-R -t utf-8 originalfile > newfile</code><br />
You can change KOIR-8 and utf-8 to yours. </p>
<p><strong>Batch converting files from folder</strong>:</p>
<p><code>#mkdir new; for a in $(find . -name "*.php");  do iconv  -f KOI8-R -t utf-8 &lt;"$a" &gt;new/"$a" ; done</code></p>
<p>It will make &#8220;new&#8221; directory with converted files.</p>
]]></content:encoded>
			<wfw:commentRss>http://howtobsd.com/development/batch-convert-files-using-iconv.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysqldump on FreeBSD</title>
		<link>http://howtobsd.com/software/mysqldump-on-freebsd.html</link>
		<comments>http://howtobsd.com/software/mysqldump-on-freebsd.html#comments</comments>
		<pubDate>Tue, 05 Jul 2011 16:32:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://howtobsd.com/?p=400</guid>
		<description><![CDATA[Just a few notes about mysqldump. Create dump of mysql base: # mysqldump -uDBUSER -pPASSWORD DBNAME > filename.sql or # mysqldump --user=username --password=password DBNAME > filename.sql if you need to make dump of a few databases you can use parametr -B (or –databases): mysqldump -uDBUSER -pPASSWORD -B DBNAME1 DBNAME2 > filename.sql Make dump of the [...]]]></description>
				<content:encoded><![CDATA[<p>Just a few notes about mysqldump. </p>
<p>Create dump of mysql base:</p>
<p><code># mysqldump -uDBUSER -pPASSWORD DBNAME > filename.sql</code></p>
<p>or<br />
<code># mysqldump --user=username --password=password DBNAME > filename.sql</code> </p>
<p>if you need to make dump of a few databases you can use parametr -B (or –databases):</p>
<p><code>mysqldump -uDBUSER -pPASSWORD -B DBNAME1 DBNAME2  > filename.sql</code></p>
<p>Make dump of the all Databases on host:<br />
<code>mysqldump -uDBUSER -pPASSWORD -A  > filename.sql</code></p>
<p>If you need only dump structure of database (without data):</p>
<p><code>mysqldump -uDBUSER -pPASSWORD --no-data DBNAME > filename.sql</code></p>
<p>If you want to make limited by records mysqldump, next command especially for you (It was really cool command when I need dump and then move test copy of project with enormous mysql database):</p>
<p><code> mysqldump -uDBUSER  -pPASSWORD --where="true limit 100" DBNAME > filename.sql  </code></p>
<p>this command will dump your database with defined amount records in each table. </p>
]]></content:encoded>
			<wfw:commentRss>http://howtobsd.com/software/mysqldump-on-freebsd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql log queries FreeBSD</title>
		<link>http://howtobsd.com/tips/mysql-log-queries-freebsd.html</link>
		<comments>http://howtobsd.com/tips/mysql-log-queries-freebsd.html#comments</comments>
		<pubDate>Thu, 10 Mar 2011 09:06:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://howtobsd.com/?p=329</guid>
		<description><![CDATA[If you want to activate logging of mysql queries, add in your my.cnf (by default it is /var/db/mysql/my.cnf) in [mysqld] section: log=/var/log/mysql.log create log file: #touch /var/log/mysql.log #chmod 666 /var/log/mysql.log and restart mysql-server: #/usr/local/etc/rc.d/mysql-server restart (it can be different on you server) That is all. PS: I don&#8217;t recommend you use it on hight loaded [...]]]></description>
				<content:encoded><![CDATA[<p>If you want to activate logging of mysql queries, add in your my.cnf (by default it is /var/db/mysql/my.cnf)<br />
in [mysqld] section:</p>
<p><code>log=/var/log/mysql.log</code></p>
<p>create log file:</p>
<p><code>#touch /var/log/mysql.log<br />
#chmod 666 /var/log/mysql.log</code></p>
<p>and restart mysql-server:</p>
<p><code>#/usr/local/etc/rc.d/mysql-server restart</code> (it can be different on you server)</p>
<p>That is all.</p>
<p>PS: I don&#8217;t recommend you use it on hight loaded servers permanently. Use it only for debugging. </p>
]]></content:encoded>
			<wfw:commentRss>http://howtobsd.com/tips/mysql-log-queries-freebsd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RapidSVN &#8211; gui svn client for FreeBSD</title>
		<link>http://howtobsd.com/software/rapidsvn-gui-svn-client-for-freebsd.html</link>
		<comments>http://howtobsd.com/software/rapidsvn-gui-svn-client-for-freebsd.html#comments</comments>
		<pubDate>Sun, 26 Dec 2010 18:44:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://howtobsd.com/?p=302</guid>
		<description><![CDATA[Everybody who worked with svn knows fine svn client for windows TortoiseSVN. But what are we have similar for the linux (especially for FreeBSD). &#8220;True&#8221;-developers will say &#8220;I use console svn client and don&#8217;t want anything else&#8221; and will be right. Although many users wants user-friendly interface. So, today I want introduce you svn client [...]]]></description>
				<content:encoded><![CDATA[<p>Everybody who worked with svn knows fine svn client for windows TortoiseSVN.   But what are we have similar for the linux (especially for FreeBSD).<br />
&#8220;True&#8221;-developers will say &#8220;I use console svn client and don&#8217;t want anything else&#8221; and will be right. Although many users wants user-friendly  interface.<br />
So, today I want introduce you svn client for FreeBSD &#8211; RapidSVN.</p>
<p>Install:</p>
<p><code>#cd /usr/ports/devel/rapidsvn<br />
#make install clean<br />
</code><br />
after that checkout your work copy from repository and enjoy.<br />
I very need the suitable diff in svn client. RapidSVN doesn&#8217;t include diff tool but we can choose external program.<br />
install diff tool for FreeBSD &#8211; dirdiff:<br />
<code>#cd /usr/ports/sysutils/dirdiff<br />
#make install clean<br />
</code><br />
and put location in settings of Rapidsvn(Settings->Programs->Diff Tool ):<br />
/usr/local/bin/dirdiff</p>
<p>If you know any better svn client for FreeBSD I will glad to learn it of from yours comments. </p>
]]></content:encoded>
			<wfw:commentRss>http://howtobsd.com/software/rapidsvn-gui-svn-client-for-freebsd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to movie a Subversion Repository to Another Server.</title>
		<link>http://howtobsd.com/software/how-to-movie-a-subversion-repository-to-another-server.html</link>
		<comments>http://howtobsd.com/software/how-to-movie-a-subversion-repository-to-another-server.html#comments</comments>
		<pubDate>Wed, 17 Mar 2010 16:04:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://howtobsd.com/?p=82</guid>
		<description><![CDATA[It&#8217;s also possible for create copyes svn repositoryes or create svn backups. $svnadmin dump /svnroot/repository &#62; name.dmp After that you can compress dump file and get it to your server where you want create copy of you repository. Create a new repository: $svnadmin create /svnroot/repository import dump in new repository $svnadmin load /svnroot/repository &#60; name.dmp [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s also possible for create copyes svn repositoryes or create svn backups.</p>
<p><code>$svnadmin dump /svnroot/repository &gt; name.dmp</code></p>
<p>After that you can compress dump file and get it to your server where you want create copy of you repository.<br />
Create a new repository:</p>
<p><code>$svnadmin create /svnroot/repository</code></p>
<p>import dump in new repository<br />
<code>$svnadmin load /svnroot/repository &lt; name.dmp</code></p>
<p>Also you should to be shure you repository whis svn owner:</p>
<p><code>$chown -R svn:svn /svnroot/repository</code></p>
<p>It&#8217;s all!</p>
<p>PS: compare you config files.</p>
]]></content:encoded>
			<wfw:commentRss>http://howtobsd.com/software/how-to-movie-a-subversion-repository-to-another-server.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to quickly build a Glassfish on FreeBSD</title>
		<link>http://howtobsd.com/software/how-to-quickly-build-a-glassfish-on-freebsd.html</link>
		<comments>http://howtobsd.com/software/how-to-quickly-build-a-glassfish-on-freebsd.html#comments</comments>
		<pubDate>Mon, 16 Nov 2009 15:42:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[glassfish]]></category>

		<guid isPermaLink="false">http://howtobsd.com/?p=35</guid>
		<description><![CDATA[cvs -d :pserver:john_ts@cvs.dev.java.net:/cvs checkout glassfish/bootstrap … maven -Djava.net.preferIPv4Stack=true checkout … maven -Djava.net.preferIPv4Stack=true bootstrap-all … maven -Djava.net.preferIPv4Stack=true build … maven -Djava.net.preferIPv4Stack=true configure-runtime … It’s all! PS: I should give you one advice – don’t try build glassfish with openjdk6 or diablo-jdk-1.6! I have built it only with diablo-jdk-1.5. If you know how to build glassfish with [...]]]></description>
				<content:encoded><![CDATA[<p><code>cvs -d :pserver:john_ts@cvs.dev.java.net:/cvs checkout glassfish/bootstrap<br />
…<br />
maven -Djava.net.preferIPv4Stack=true checkout<br />
…<br />
maven -Djava.net.preferIPv4Stack=true bootstrap-all<br />
…<br />
maven -Djava.net.preferIPv4Stack=true build<br />
…<br />
maven -Djava.net.preferIPv4Stack=true configure-runtime<br />
…</code><br />
It’s all!  PS: I should give you one advice – <strong>don’t try build glassfish with openjdk6 or diablo-jdk-1.6!</strong> I have built it only with  diablo-jdk-1.5. If you know how to build glassfish with (openjdk6 or jdk1.6) on FreeBSD let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://howtobsd.com/software/how-to-quickly-build-a-glassfish-on-freebsd.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
