<?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>Pieces of Life...</title>
	<atom:link href="http://www.bogdanirimia.ro/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bogdanirimia.ro</link>
	<description>Bogdan Irimia&#039;s Web Space</description>
	<lastBuildDate>Tue, 20 Mar 2012 16:25:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Amazing perspective &#8211; programming and life</title>
		<link>http://www.bogdanirimia.ro/amazing-perspective-programming-and-life/281</link>
		<comments>http://www.bogdanirimia.ro/amazing-perspective-programming-and-life/281#comments</comments>
		<pubDate>Tue, 20 Mar 2012 16:25:28 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[principle]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=281</guid>
		<description><![CDATA[This is an amazing presentation, from both the technological viewpoint, as well as from the personal development viewpoint. Bio: Bret Victor invents tools that enable people to understand and create. He has designed experimental UI concepts at Apple, interactive data graphics for Al Gore, and musical instruments at Alesis. For more on Bret, see http://worrydream.com. [...]]]></description>
			<content:encoded><![CDATA[<p>This is an amazing presentation, from both the technological viewpoint, as well as from the personal development viewpoint.</p>
<p><iframe src="http://player.vimeo.com/video/36579366?byline=0&amp;autoplay=1" width="580" height="326" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<p>Bio: Bret Victor invents tools that enable people to understand and create. He has designed experimental UI concepts at Apple, interactive data graphics for Al Gore, and musical instruments at Alesis.</p>
<p>For more on Bret, see <a href="http://worrydream.com" target="_blank">http://worrydream.com</a>.</p>
<p>This talk was given at CUSEC 2012 (http://2012.cusec.net).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/amazing-perspective-programming-and-life/281/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change SSH port in VMware ESXi</title>
		<link>http://www.bogdanirimia.ro/change-ssh-port-in-vmware-esxi/278</link>
		<comments>http://www.bogdanirimia.ro/change-ssh-port-in-vmware-esxi/278#comments</comments>
		<pubDate>Mon, 19 Mar 2012 11:20:51 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Server administration]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=278</guid>
		<description><![CDATA[We decided to consolidate our office network and we bought a new server with 32GB of memory and some new processor and motherboard. We will use this machine to run all the machines as VMs in VMware ESXi. We decided to use another port for SSH, say&#8230; 222. These are the steps to reconfigure VMware [...]]]></description>
			<content:encoded><![CDATA[<p>We decided to consolidate our office network and we bought a new server with 32GB of memory and some new processor and motherboard. We will use this machine to run all the machines as VMs in VMware ESXi.<br />
We decided to use another port for SSH, say&#8230; 222.</p>
<p>These are the steps to reconfigure VMware ESXi to have the SSH service listening on port 222:</p>
<p>0. You need to have console access to ESXi. For this, you can enable shell access and have a keyboard and monitor connected to the server, or you can use SSH (on the default port, 22, at the beginning). vSphere client also proved useful for administration.</p>
<p>1. In the console, edit the file &#8220;<code>/etc/services</code>&#8220;, changing the port for the SSH service, like this:</p>
<pre class="brush: bash; title: ; notranslate">
ssh 222/tcp # SSH Remote Login Protocol
ssh 222/udp # SSH Remote Login Protocol
</pre>
<p>2. Edit the configuration file of the SSH services, &#8220;<code>/etc/ssh/sshd_config</code>&#8220;, uncomment the &#8220;Port&#8221; directive and change the value to 222:</p>
<pre class="brush: bash; title: ; notranslate">
Port 222
</pre>
<p>3. Create a new file in the datastore:</p>
<pre class="brush: bash; title: ; notranslate">
vi /vmfs/volumes/datastore1/ssh222.xml
</pre>
<p>and add the following content:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!-- Firewall configuration information --&gt;
&lt;ConfigRoot&gt;

        &lt;!-- SSH Port 222 --&gt;
        &lt;service id='1000'&gt;
                &lt;id&gt;sshServer222&lt;/id&gt;
                &lt;rule id='0000'&gt;
                        &lt;direction&gt;inbound&lt;/direction&gt;
                        &lt;protocol&gt;tcp&lt;/protocol&gt;
                        &lt;porttype&gt;dst&lt;/porttype&gt;
                        &lt;port&gt;222&lt;/port&gt;
                &lt;/rule&gt;
                &lt;rule id='0001'&gt;
                        &lt;direction&gt;outbound&lt;/direction&gt;
                        &lt;protocol&gt;tcp&lt;/protocol&gt;
                        &lt;porttype&gt;dst&lt;/porttype&gt;
                        &lt;port&gt;222&lt;/port&gt;
                &lt;/rule&gt;
                &lt;enabled&gt;true&lt;/enabled&gt;
                &lt;required&gt;false&lt;/required&gt;
        &lt;/service&gt;

&lt;/ConfigRoot&gt;
</pre>
<p>4. Enable this settings file in the firewall, adding at the end of the file &#8220;<code>/etc/rc.local</code>&#8221; this code:</p>
<pre class="brush: bash; title: ; notranslate">
cp /vmfs/volumes/datastore1/ssh222.xml /etc/vmware/firewall/
/sbin/esxcli network firewall refresh
</pre>
<p>5. Reboot the server. If you are using vSphere client, go to the tab Configuration->Security Profile, check if the new firewall rule appears (of course, after reboot) and check if the SSH service is started by default (as it should be). If the new firewall rule is not enabled, enable it. You can disable the old (default) SSH rule in the firewall.</p>
<p>That&#8217;s it &#8211; you have ESXi with SSH access on port 222.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/change-ssh-port-in-vmware-esxi/278/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu, SVN as root in cron</title>
		<link>http://www.bogdanirimia.ro/ubuntu-svn-as-root-in-cron/276</link>
		<comments>http://www.bogdanirimia.ro/ubuntu-svn-as-root-in-cron/276#comments</comments>
		<pubDate>Fri, 24 Feb 2012 15:09:24 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Server administration]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=276</guid>
		<description><![CDATA[My latest adventure with Linux was today. I needed to make a cron job to update some folders from SVN periodically. The folders were located in /var/www, so I had to checkout them from SVN using sudo: When I checked out, my username and password were required, and I answered with yes when asked if [...]]]></description>
			<content:encoded><![CDATA[<p>My latest adventure with Linux was today.<br />
I needed to make a cron job to update some folders from SVN periodically. The folders were located in <code>/var/www</code>, so I had to checkout them from SVN using <code>sudo</code>:</p>
<pre class="brush: bash; title: ; notranslate">
sudo co svn://my-svn-repo/my-folder/ ./
</pre>
<p>When I checked out, my username and password were required, and I answered with yes when asked if I wanted to save these credentials.<br />
When i tried to add the update jobs in crontab, like this:</p>
<pre class="brush: bash; title: ; notranslate">
# sudo crontab -e
</pre>
<p>and add the line</p>
<pre class="brush: bash; title: ; notranslate">
0 5 * * * /usr/bin/svn up /var/www/next4.me/server/ 2&gt;&amp;1
</pre>
<p>all I obtained was this in my <code>syslog</code> file:</p>
<pre class="brush: bash; title: ; notranslate">
(CRON) error (grandchild #xxxxx failed with exit status 1)
</pre>
<p>I managed to find out that this happened because the credentials of SVN were saved not in the root&#8217;s home folder, but in my home folder.<br />
All I had to do was to run </p>
<pre class="brush: bash; title: ; notranslate">
sudo -H svn up /path-to-folder/
</pre>
<p>and to enter again my credentials and to save them. This is because <code>sudo -H</code> uses the root&#8217;s home folder as the context for the command, whereas without the <code>-H</code> switch svn uses the current&#8217;s user home folder!</p>
<p>I didn&#8217;t know that!</p>
<p>The OS is Ubuntu 11.10 Server x64</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/ubuntu-svn-as-root-in-cron/276/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symbolic links on Samba server working from Mac OS X</title>
		<link>http://www.bogdanirimia.ro/symbolic-links-on-samba-server-working-from-mac-os-x/274</link>
		<comments>http://www.bogdanirimia.ro/symbolic-links-on-samba-server-working-from-mac-os-x/274#comments</comments>
		<pubDate>Fri, 18 Mar 2011 18:24:39 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Server administration]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[symbolic]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=274</guid>
		<description><![CDATA[I am reevaluating my decision of becoming an Apple fan or not&#8230; And I tend towards becoming one. Just because of the excellent marketing and the excellent hardware! But the software isn&#8217;t that bad either! Mac OS X, once you get a bit used to it, might become your favorite OS! Of course, it has [...]]]></description>
			<content:encoded><![CDATA[<p>I am reevaluating my decision of becoming an Apple fan or not&#8230; And I tend towards becoming one. Just because of the excellent marketing and the excellent hardware! But the software isn&#8217;t that bad either!</p>
<p>Mac OS X, once you get a bit used to it, might become your favorite OS! Of course, it has its oddities, but&#8230; we all do! <img src='http://www.bogdanirimia.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now&#8230; one of Mac OS X&#8217;s oddities is the fact that the Samba protocol implementation isn&#8217;t so brilliant. I have an Ubuntu box on which I run a Samba server. I have a shared folder, and in it I have created a symbolic link. When connecting from Mac OS X to that folder, the symbolic link can&#8217;t be followed (it appears to be a shortcut file, and when clicked, pops an error with the option to fix the link, but with no success either). From Windows, it worked fine.</p>
<p>The solution to this symbolic link issue was to add in the &#8220;general&#8221; group of the Samba server configuration file the following line:</p>
<p><code>unix extensions = off</code></p>
<p>My Samba configuration file is &#8220;/etc/samba/smb.conf&#8221;. I then restarted the Samba server and reconnected from Mac OS X, and it worked! It also works from Windows too <img src='http://www.bogdanirimia.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/symbolic-links-on-samba-server-working-from-mac-os-x/274/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Strange routing issue, solved</title>
		<link>http://www.bogdanirimia.ro/strange-routing-issue-solved/272</link>
		<comments>http://www.bogdanirimia.ro/strange-routing-issue-solved/272#comments</comments>
		<pubDate>Wed, 29 Sep 2010 10:49:11 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Server administration]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[priority]]></category>
		<category><![CDATA[routes]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=272</guid>
		<description><![CDATA[I just encountered this problem: I have an Ubuntu box, on which ran this downloading service. Because some complaints from the Internet provider, I decided to use another network (from another provider) for this downloading service. Everything else needed to remain the same. So I installed a new network card on the system, and it [...]]]></description>
			<content:encoded><![CDATA[<p>I just encountered this problem: I have an Ubuntu box, on which ran this downloading service. Because some complaints from the Internet provider, I decided to use another network (from another provider) for this downloading service. Everything else needed to remain the same.</p>
<p>So I installed a new network card on the system, and it became <span style="font-family: book antiqua,palatino;">eth1</span>. The first one, <span style="font-family: book antiqua,palatino;">eth0</span>, was connected to network <span style="font-family: book antiqua,palatino;">192.168.2.0</span>. Now, I connected<span style="font-family: book antiqua,palatino;"> eth1</span> to network <span style="font-family: book antiqua,palatino;">192.168.1.0</span>. Both networks provides DHCP.</p>
<p>The first issue was when I configured both NICs with DHCP. No outside access was available on the box because there were two default gateways. So I configured <span style="font-family: book antiqua,palatino;">eth1 </span>as static, and didn&#8217;t specify any default gateway for it. But this rendered the internet connection through <span style="font-family: book antiqua,palatino;">eth1 </span>useless, because all the traffic (for the outside world) was routed through <span style="font-family: book antiqua,palatino;">eth0 </span>now. So when the downloading service was bound to <span style="font-family: book antiqua,palatino;">eth1</span>, it couldn&#8217;t connect anywhere outside the network.</p>
<p>After some searching effort on the Internet, I found this solution:</p>
<p>- <span style="font-family: book antiqua,palatino;">/etc/network/interfaces</span>:</p>
<pre class="brush: bash; title: ; notranslate">

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

# The secondary network interface
auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0

up /etc/network/prioritize_networks.sh
</pre>
<p>- <span style="font-family: book antiqua,palatino;">/etc/network/prioritize_networks.sh</span>:</p>
<pre class="brush: bash; title: ; notranslate">

#!/bin/sh

#Set up the first subnet's routing table (we'll name it 70)
ip route flush table 70
ip route add table 70 to 192.168.2.0/24 dev eth0
ip route add table 70 to default via 192.168.2.1 dev eth0

#Set up the second subnet's routing table (we'll call it 80)
ip route flush table 80
ip route add table 80 to 192.168.1.0/24 dev eth1
ip route add table 80 to default via 192.168.1.1 dev eth1

#Create the rules to choose what table to use. Choose based on source IP
#We need to give the rules different priorities; for convenience name priority
#after the table
ip rule add from 192.168.2.0/24 table 70 priority 70
ip rule add from 192.168.1.0/24 table 80 priority 80

#Flush the cache to make effective
ip route flush cache
</pre>
<p>So now all the traffic goes by default through <span style="font-family: book antiqua,palatino;">eth0</span>, but all applications bound to <span style="font-family: book antiqua,palatino;">eth1 </span>are routed through the correct gateway of <span style="font-family: book antiqua,palatino;">192.168.1.0</span> network.</p>
<p>I found this hack here: <a href="http://www.physics.umd.edu/pnce/pcs-docs/Glue/linux-route-hack.html" target="_blank">http://www.physics.umd.edu/pnce/pcs-docs/Glue/linux-route-hack.html</a></p>
<p>Hope this helps anybody.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/strange-routing-issue-solved/272/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android widget, click event, multiple instances</title>
		<link>http://www.bogdanirimia.ro/android-widget-click-event-multiple-instances/269</link>
		<comments>http://www.bogdanirimia.ro/android-widget-click-event-multiple-instances/269#comments</comments>
		<pubDate>Fri, 09 Jul 2010 13:03:42 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[click]]></category>
		<category><![CDATA[instances]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=269</guid>
		<description><![CDATA[Ok&#8230; I started to do some Android devel&#8230; And I started to like it, even if it is based on Java, works in Eclipse and has a ton of classes. Now, the first project is a widget (weather widget). For this, there&#8217;s this &#8220;AppWidgetProvider&#8221; class that implements the design and functions for data retrieval (using [...]]]></description>
			<content:encoded><![CDATA[<p>Ok&#8230; I started to do some Android devel&#8230; And I started to like it, even if it is based on Java, works in Eclipse and has a ton of classes.</p>
<p>Now, the first project is a widget (weather widget). For this, there&#8217;s this &#8220;AppWidgetProvider&#8221; class that implements the design and functions for data retrieval (using threads), and also a configuration Activity. When the configuration activity finishes (a &#8220;Save&#8221; button is pressed), a static function of the AppWidgetProvider class is called. This static function updates the settings of the widget and also does something of interest: it sets the event handler for &#8220;onClick&#8221; &#8211; so that when I click (touch) the widget, to be able to modify the layout somehow (to rotate a needle).</p>
<p>This is a part of the static function that updates the widget:</p>
<pre class="brush: java; title: ; notranslate">
...
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_layout);
Intent clickIntent = new Intent(context, DigiStation.class);
clickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, appWidgetId, clickIntent, 0);
views.setOnClickPendingIntent(R.id.widget_normal_relativelayout, pendingIntent);
appWidgetManager.updateAppWidget(appWidgetId, views);
...
</pre>
<p>The AppWidgetProvider class is called &#8220;DigiStation&#8221; &#8211; we&#8217;re using it for creating an intent that targets it.</p>
<p>Ok. For handling the events, the DigiStation class (which is of type AppWidgetProvider) implements the function &#8220;onReceive&#8221;. The function is called with two parameters: the context and the intent.</p>
<p>Now, the issue was to be able to distinguish between multiple instances of the same AppWidgetProvider class. To be able to do that, I had to put some extra information in the intent (clickIntent.putExtra). The field contains the appWidgetId &#8211; the widget ID &#8211; of the instance.</p>
<p>The onReceive function looks like this:</p>
<pre class="brush: java; title: ; notranslate">
@Override
public void onReceive(Context context, Intent intent) {
    if (intent.getAction()==null) {
        Bundle extras = intent.getExtras();
        if(extras!=null) {
            int widgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
            // do something for the widget that has appWidgetId = widgetId
        }
    }
    else {
        super.onReceive(context, intent);
    }
 }
</pre>
<p>All looks simple enough, but there are some little details that I must underline, because I spend a few days with them:</p>
<p style="text-align: left;">1. To be able to distinguish between multiple instances of the same AppWidgetProvider, when registering the &#8220;onClick&#8221; event (intent) you must add an extra value with the widget ID (appWidgetId)</p>
<p style="text-align: left;">2. Update only the views of the current instance! &#8211; appWidgetManager.updateAppWidget(appWidgetId, views);</p>
<p style="text-align: left;">3. <strong>Android reuses intents, so when you create an intent, make sure you put an unique ID, or else the same intent used before will be triggered for all instances! </strong> Only with this detail I spent half a day! ( PendingIntent pendingIntent = PendingIntent.getBroadcast(context, <strong>appWidgetId</strong>, clickIntent, 0); )</p>
<p style="text-align: left;">4. When handling the click event, get the appWidgetId from the &#8220;extras&#8221; payload of the intent.</p>
<p>Hope this helps people not spending so much time for little undocumented details! <img src='http://www.bogdanirimia.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/android-widget-click-event-multiple-instances/269/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>New WordPress 3.0</title>
		<link>http://www.bogdanirimia.ro/new-wordpress-3-0/267</link>
		<comments>http://www.bogdanirimia.ro/new-wordpress-3-0/267#comments</comments>
		<pubDate>Mon, 21 Jun 2010 09:36:52 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=267</guid>
		<description><![CDATA[It seems that the long-awaited WordPress 3.0 is out and it also seems to have some new features that, in my opinion, brings WordPress closer to what a real CMS should be. I worked quite a lot with Drupal and now I consider WordPress to be a good alternative for all those projects. The most [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that the long-awaited WordPress 3.0 is out and it also seems to have some new features that, in my opinion, brings WordPress closer to what a real CMS should be. I worked quite a lot with Drupal and now I consider WordPress to be a good alternative for all those projects.<br />
The most important feature I consider to be the new custom post type functionality, that should open up great ways for customization. Before, I had to use a plugin that extended the properties of a post. Now, a new post type can be created, with all the new features it needs. Just great!<br />
And I have to mention the new menu feature that was&#8230; just needed!<br />
Here&#8217;s a short video that presents the new features. Hmm&#8230; maybe I&#8217;ll update my site soon <img src='http://www.bogdanirimia.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><embed src="http://v.wordpress.com/wp-content/plugins/video/flvplayer.swf?ver=1.21" type="application/x-shockwave-flash" width="640" height="360" wmode="transparent" seamlesstabbing="true" allowfullscreen="true" allowscriptaccess="always" overstretch="true" flashvars="guid=BQtfIEY1&amp;width=640&amp;height=360&amp;locksize=no&amp;dynamicseek=false&amp;qc_publisherId=p-18-mFEk4J448M" title="Introducing WordPress 3.0 &quot;Thelonious&quot;"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/new-wordpress-3-0/267/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transparent text over images</title>
		<link>http://www.bogdanirimia.ro/transparent-text-over-images/265</link>
		<comments>http://www.bogdanirimia.ro/transparent-text-over-images/265#comments</comments>
		<pubDate>Mon, 15 Mar 2010 12:26:14 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[transparent]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=265</guid>
		<description><![CDATA[I needed recently to overlap, on a web page, a text on an image, and the text was to be white, with a black background, with alpha. For this, the solution is to make two DIVs, both positioned in a container div. The container div has to have &#8220;position: relative&#8221;. The second div has to [...]]]></description>
			<content:encoded><![CDATA[<p>I needed recently to overlap, on a web page, a text on an image, and the text was to be white, with a black background, with alpha. For this, the solution is to make two DIVs, both positioned in a container div. The container div has to have &#8220;position: relative&#8221;. The second div has to have &#8220;position: absolute&#8221;, and to set &#8220;top&#8221; and &#8220;left&#8221; properties so that it would be positioned where you want.</p>
<p>So, to wrap things up:</p>
<p>- container div:</p>
<pre class="brush: css; title: ; notranslate">

#container {
position: relative;
}
</pre>
<p>- image div (or just image tag) &#8211; has nothing special, maybe remove its borders&#8230;</p>
<pre class="brush: css; title: ; notranslate">

#container img {
border: 0;
}
</pre>
<p>- text div (or a special tag, like &#8220;h2&#8243;)</p>
<pre class="brush: css; title: ; notranslate">

#container h2 {
display: block;
position: absolute;
top: 10px;
left: 0;
width: 100px;
height: 30px;
color: white;
background: rgb(0, 0, 0); /* fallback color */
background: rgba(0, 0, 0, 0.15);
}

#IEroot #container h2 {
background:transparent;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#40000000,endColorstr=#40000000);
zoom: 1;
}
</pre>
<p>For IE compatibility, you need to use conditional statements. This is done by adding this code before the container div:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!--[if IE]&gt;
&lt;div id=&quot;IEroot&quot;&gt;
&lt;![endif]--&gt;
</pre>
<p>and this code after the container div:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!--[if IE]&gt;
&lt;/div&gt;
&lt;![endif]--&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/transparent-text-over-images/265/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Delete SVN folders&#8221; context menu item</title>
		<link>http://www.bogdanirimia.ro/delete-svn-files-context-menu-item/263</link>
		<comments>http://www.bogdanirimia.ro/delete-svn-files-context-menu-item/263#comments</comments>
		<pubDate>Wed, 24 Feb 2010 12:06:01 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[folder]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=263</guid>
		<description><![CDATA[If you&#8217;re using Windows and you have some projects synced with SVN, you could have sometimes the need to remove the folder&#8217;s SVN references. This can be done in Windows Explorer by browsing and removing all the .svn subfolders, but if your folder has many subfolders, you&#8217;ll have a lot of work to do. There&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using Windows and you have some projects synced with SVN, you could have sometimes the need to remove the folder&#8217;s SVN references. This can be done in Windows Explorer by browsing and removing all the .svn subfolders, but if your folder has many subfolders, you&#8217;ll have a lot of work to do. There&#8217;s a simpler way: tweaking the registry to add a context menu item that allows to delete the SVN references.</p>
<p>This is the reg file:</p>
<pre class="brush: bash; title: ; notranslate">

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
@=&quot;Delete SVN Folders&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
@=&quot;cmd.exe /c \&quot;TITLE Removing SVN Folders in %1 &amp;&amp; COLOR 9A &amp;&amp; FOR /r \&quot;%1\&quot; %%f IN (.svn) DO RD /s /q \&quot;%%f\&quot; \&quot;&quot;
</pre>
<p>Run it, then right-click on a folder and you&#8217;ll see the aforementioned item. Works well on Windows 7.</p>
<p>The idea comes from<a href="http://weblogs.asp.net/jgalloway/archive/2007/02/24/shell-command-remove-svn-folders.aspx" target="_blank"> Jon Galloway</a>&#8216;s blog. Neat!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/delete-svn-files-context-menu-item/263/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C application with MySQL, built with NetBeans, on CygWin</title>
		<link>http://www.bogdanirimia.ro/c-application-with-mysql-built-with-netbeans-on-cygwin/262</link>
		<comments>http://www.bogdanirimia.ro/c-application-with-mysql-built-with-netbeans-on-cygwin/262#comments</comments>
		<pubDate>Mon, 22 Feb 2010 12:38:23 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[CygWin]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[NetBeans]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=262</guid>
		<description><![CDATA[Because MySQL became one of the most used database engine in the world and because of the ease of development in PHP with MySQL, most of the prototype application can be developed at first using this combination (PHP+MySQL). But then, mainly because of performance issues, one might want to implement that project in C &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Because MySQL became one of the most used database engine in the world and because of the ease of development in PHP with MySQL, most of the prototype application can be developed at first using this combination (PHP+MySQL). But then, mainly because of performance issues, one might want to implement that project in C &#8211; so there&#8217;s the need to connect from a C application to the MySQL server. Nothing easier &#8211; you say. MySQL provides us the mysql-connector that has a C implementation and binaries for the most important platforms. But I wanted to develop my application in a full-fledged IDE, and because my workstation runs Windows (7 &#8211; big fan) I needed to make it compile somehow on Windows. But the application will run on a Linux server (or Unix), so it had to be POSIX compatible. This took Visual Studio out of the equation.</p>
<p>So, to build a POSIX C application on Windows I recommend using NetBeans IDE (6.8 at this time) &#8211; it has lots of features, making it a good development environment. It has a C/C++ plugin implementing support for these two languages.</p>
<p>Now, to make it compile, I needed gcc, so I installed CygWin. It works fine on Windows 7 x64. When installing CygWin, you must make sure you install <strong>gcc </strong>(and all that it depends on), <strong>libncurses-devel</strong>, <strong>readline </strong>and <strong>libreadline </strong>(from the Devel category). Of course I didn&#8217;t unselect anything from the default list. I just added these libraries.</p>
<p>To make CygWin more friendly (I have this friendliness obsession  <img src='http://www.bogdanirimia.ro/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ) I&#8217;m using <a href="http://code.google.com/p/puttycyg/" target="_blank">PuTTYcyg</a>, a great expansion of PuTTY. I am also editing the <strong>.vimrc</strong> file just like in the post for Solaris. The <strong>.bashrc</strong> file should exist and contain also the line</p>
<pre class="brush: bash; title: ; notranslate">

export PS1='[\u@\h \w]\$ '
</pre>
<p>Now, I&#8217;m having this Linux-like environment running on my Windows. All I have to do is to install the mysql-connector and to configure NetBeans to compile on CygWin.</p>
<p>To install mysql-connector on CygWin I had to download the sources of MySQL (not only mysql-client, I couldn&#8217;t compile it). MySQL includes the client when compiling. These are the steps to follow if you want mysql-client on CygWin</p>
<ul>
<li>make sure you have gcc, libncurses-devel, readline and libreadline</li>
<li>download the mysql sources and extract them in a folder in CygWin</li>
<li>copy the file <strong>ttydefaults.h</strong> (from a working Unix system) in <strong>/usr/include/sys/</strong></li>
<li>go into the sources folder and run<strong> ./configure &#8211;without-readline CFLAGS=-O2 </strong>(you can add &#8211;without-server, but I didn&#8217;t test that)</li>
<li>wait for it to finish (took me about 20 minutes). Hopefully you won&#8217;t have any errors</li>
<li>run <strong>make &amp; make install</strong> and wait for it to finish (should take more than half an hour, but maybe your PC is faster)</li>
</ul>
<p>This should be it. Of course, if you run configure and have a missing library error, install that library and rerun configure. If you have an error during compilation, make sure to run <strong>make clean</strong> before retrying!</p>
<p>Ok. Now to make sure that NetBeans compiles your C application successfully, follow these steps:</p>
<ul>
<li>create a new C project and paste the following code</li>
</ul>
<pre class="brush: cpp; title: ; notranslate">

/*
 * File:   main.c
 * Author: Bogdan
 *
 * Created on February 18, 2010, 1:09 PM
 */

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

#include &lt;my_global.h&gt;
#include &lt;mysql.h&gt;

int main(int argc, char** argv) {

 printf(&quot;Running just fine!\n&quot;);
 printf(&quot;MySQL client version: %s\n&quot;, mysql_get_client_info());

 return (EXIT_SUCCESS);
}
</pre>
<ul>
<li>go to Tools-&gt;Options and select C/C++ tab. Click the &#8220;Add&#8221; button and select the &#8220;bin&#8221; folder of your CygWin installation (mine is C:\cygwin\bin). The other two fields should auto-complete. Click OK, make sure all paths are correct and then click OK again.</li>
<li>right-click your project in Projects pane. Go to Properties</li>
<li>in the Build-&gt;C Compiler section, add the value &#8220;c:/cygwin/usr/local/include/mysql&#8221; in the &#8220;Include directories&#8221; field (supposing that you installed CygWin in C:\cygwin)</li>
<li>in the Build-&gt;Linker section, add the value &#8220;c:/cygwin/usr/local/lib/mysql&#8221;</li>
<li>in the same section (Linker) click on the button near &#8220;Libraries&#8221;, click &#8220;Add Library&#8221;, go to &#8220;/usr/local/lib/mysql&#8221; and add &#8220;libmysqlclient.a&#8221;</li>
<li>after clicking &#8220;Select&#8221;, press again &#8220;Add Library&#8221;, go to &#8220;/lib&#8221; and add &#8220;libz.a&#8221;</li>
<li>click OK and then OK again</li>
</ul>
<p>Now your application should compile and run successfully. So now I&#8217;m ready to develop and test a C application with MySQL connection on my PC and then to deploy it on a UNIX server (of course it will need to be recompiled).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/c-application-with-mysql-built-with-netbeans-on-cygwin/262/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

