<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/blog/templates/default/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <link href="http://www.kraftek.com/blog/index.php?/feeds/atom.xml" rel="self" title="roberto dircio palacios-macedo's notepad" type="application/atom+xml" />
    <link href="http://www.kraftek.com/blog/"                        rel="alternate"    title="roberto dircio palacios-macedo's notepad" type="text/html" />
    <link href="http://www.kraftek.com/blog/rss.php?version=2.0"     rel="alternate"    title="roberto dircio palacios-macedo's notepad" type="application/rss+xml" />
    <title type="html">roberto dircio palacios-macedo's notepad</title>
    <subtitle type="html">solaris/linux/java notes open to all since 2004</subtitle>
    <icon>http://www.kraftek.com/blog/templates/default/img/s9y_banner_small.png</icon>
    <id>http://www.kraftek.com/blog/</id>
    <updated>2010-08-27T16:50:22Z</updated>
    <generator uri="http://www.s9y.org/" version="1.4.1">Serendipity 1.4.1 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>

    <entry>
        <link href="http://www.kraftek.com/blog/index.php?/archives/336-stream-a-webcam,-using-highly-compressed-h264-instead-of-typical-mpg.html" rel="alternate" title="stream a webcam, using highly compressed h264 instead of typical mpg" />
        <author>
            <name>rdircio</name>
                    </author>
    
        <published>2010-08-26T18:53:51Z</published>
        <updated>2010-08-27T16:50:22Z</updated>
        <wfw:comment>http://www.kraftek.com/blog/wfwcomment.php?cid=336</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.kraftek.com/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=336</wfw:commentRss>
    
            <category scheme="http://www.kraftek.com/blog/index.php?/categories/3-Linux" label="Linux" term="Linux" />
    
        <id>http://www.kraftek.com/blog/index.php?/archives/336-guid.html</id>
        <title type="html">stream a webcam, using highly compressed h264 instead of typical mpg</title>
        <content type="xhtml" xml:base="http://www.kraftek.com/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Got a logitech webcam c300, it uses the &quot;uvcvideo&quot; kernel module.</p> <br />
<p>Typically you would&#160; grab video using &quot;motion&quot; and stream it on mpeg, well that's rubbish if you want better compression, so let's do it using the best of the best: h264.</p> <br />
<p><font size="1"><em>&#160;#!/bin/ksh<br /><br />DEV=/dev/logitechcam<br />ps -ef | grep -i vlc | grep -v grep |grep -i logitechcam | awk '{ print $2 }'| while read P;do<br />kill -9 $P<br />done<br /><br />VLC=&quot;/usr/local/bin/cvlc v4l2://$DEV :input=2 :input-slave=alsa://hw:2,0&#160; --alsa-samplerate=32000 --v4l2-controls-reset --v4l2-auto-white-balance=1 --v4l2-do-white-balance=1 --v4l2-autogain=1 --sout &quot;<br /><br />CAM=&quot;transcode{vcodec=h264,acodec=mp4a,width=320,height=240,vb=64,ab=24,channels=1,venc=x264}:standard{access=http,dst=0.0.0.0:8090/stream.flv}&quot;<br /><br />#CAM=&quot;transcode{vcodec=mjpg,width=320,height=240}:duplicate{dst=std{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a}.mux=mpjpeg,dst=0.0.0.0:8090/m.mjpg}}&quot;<br /><br />${VLC} &quot;#$CAM&quot;<br /></em></font><br /></p> <br />
<p>this produces a very decent quality stream at around 100kbps, audio also included!<br /></p> <br />
<p>Enjoy!<br /></p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://www.kraftek.com/blog/index.php?/archives/334-Test-nics-to-see-if-were-on-the-desired-vlan.html" rel="alternate" title="Test nics to see if we're on the desired vlan" />
        <author>
            <name>rdircio</name>
                    </author>
    
        <published>2010-08-20T14:35:54Z</published>
        <updated>2010-08-20T14:39:32Z</updated>
        <wfw:comment>http://www.kraftek.com/blog/wfwcomment.php?cid=334</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.kraftek.com/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=334</wfw:commentRss>
    
            <category scheme="http://www.kraftek.com/blog/index.php?/categories/3-Linux" label="Linux" term="Linux" />
    
        <id>http://www.kraftek.com/blog/index.php?/archives/334-guid.html</id>
        <title type="html">Test nics to see if we're on the desired vlan</title>
        <content type="xhtml" xml:base="http://www.kraftek.com/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>You want to know if one of your nics is in the vlan you need it to be? Quite tedious if you want to do it manually.</p> <br />
<p>check this small script to config the ip, ping and unconfig</p> <br />
<p><em>for i in 1 2 3 4 5 6 7 8 9 10 11;do set -x;ifconfig eth$i inet 10.203.102.102 netmask 255.255.254.0 up; ping -c 5 10.203.102.1; ifconfig eth$i down; done</em><br /></p> <br />
<p> </p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://www.kraftek.com/blog/index.php?/archives/333-Create-LVM-structures.html" rel="alternate" title="Create LVM structures" />
        <author>
            <name>rdircio</name>
                    </author>
    
        <published>2010-08-06T08:27:43Z</published>
        <updated>2010-08-06T08:27:43Z</updated>
        <wfw:comment>http://www.kraftek.com/blog/wfwcomment.php?cid=333</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.kraftek.com/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=333</wfw:commentRss>
    
            <category scheme="http://www.kraftek.com/blog/index.php?/categories/3-Linux" label="Linux" term="Linux" />
    
        <id>http://www.kraftek.com/blog/index.php?/archives/333-guid.html</id>
        <title type="html">Create LVM structures</title>
        <content type="xhtml" xml:base="http://www.kraftek.com/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>for eaach disk to include in a volume group, initialize it as a LVM disk:</p><br />
<p><em> pvcreate /dev/sdX</em></p><br />
<p>create a volume group with that disk:<br /></p><br />
<p><em>vgcreate myvg&#160; /dev/sdX</em></p><br />
<p>Create a 20gb volume called &quot;myvol&quot; inside the &quot;myvg&quot; volume group:</p><br />
<p><em>lvcreate -L 20g -n myvol myvg</em></p><br />
<p>Make a filesystem in the new volume: <br /></p><br />
<p><em>mkfs.ext3 /dev/mapper/myvg-myvol</em> </p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://www.kraftek.com/blog/index.php?/archives/331-Adding-udev-rules.html" rel="alternate" title="Adding udev rules" />
        <author>
            <name>rdircio</name>
                    </author>
    
        <published>2010-07-12T22:38:55Z</published>
        <updated>2010-07-13T06:46:37Z</updated>
        <wfw:comment>http://www.kraftek.com/blog/wfwcomment.php?cid=331</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.kraftek.com/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=331</wfw:commentRss>
    
            <category scheme="http://www.kraftek.com/blog/index.php?/categories/3-Linux" label="Linux" term="Linux" />
    
        <id>http://www.kraftek.com/blog/index.php?/archives/331-guid.html</id>
        <title type="html">Adding udev rules</title>
        <content type="xhtml" xml:base="http://www.kraftek.com/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I inspected all the devices i wanted to add to udev using &quot;udevadm info&quot; for each path i knew was the device i needed.<br /></p> <br />
<p><font size="1"><em>udevadm info -a -p $(udevadm info -q path -n /dev/video1)<br />udevadm info -a -p $(udevadm info -q path -n /dev/video0)<br />udevadm info -a -p $(udevadm info -q path -n /dev/input/mouse1)<br />udevadm info -a -p $(udevadm info -q path -n /dev/input/event1)<br />udevadm info -a -p $(udevadm info -q path -n /dev/input/event2)<br />udevadm info -a -p $(udevadm info -q path -n /dev/input/mouse2)</em></font><br /></p> <br />
<p>Then just created the udev file /etc/udev/rules.d/95-my.rules</p> <br />
<p><em><font size="1">KERNEL==&quot;video*&quot;, SUBSYSTEM==&quot;video4linux&quot;, ATTR{name}==&quot;saa7133*&quot;, SYMLINK+=&quot;tvcard&quot;<br />SUBSYSTEM==&quot;video4linux&quot;, ATTR{name}==&quot;gspca main driver&quot;, SYMLINK+=&quot;geniuscam&quot;<br />KERNEL==&quot;mouse*&quot;, ATTRS{name}==&quot;Microsoft Basic Optical Mouse&quot;, SYMLINK+=&quot;input/cecimouse&quot;<br />KERNEL==&quot;event*&quot;, ATTRS{name}==&quot;AT Translated Set 2 keyboard&quot;, SYMLINK+=&quot;input/cecikb&quot;<br />KERNEL==&quot;event*&quot;, ATTRS{name}==&quot;Logitech Logitech USB Keyboard&quot;, SYMLINK+=&quot;input/betokb&quot;<br />KERNEL==&quot;mouse*&quot;, ATTRS{name}==&quot;USB Optical Mouse&quot;, SYMLINK+=&quot;input/betomouse&quot;</font></em><br /></p> <br />
<p>reboot, and i get pretty aliases for all my devs :)<br /></p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://www.kraftek.com/blog/index.php?/archives/330-Get-asterisk-music-on-hold-live-from-an-icecast+ices2-server.html" rel="alternate" title="Get asterisk music-on-hold live from an icecast+ices2 server " />
        <author>
            <name>rdircio</name>
                    </author>
    
        <published>2010-07-12T18:19:34Z</published>
        <updated>2010-07-12T18:19:34Z</updated>
        <wfw:comment>http://www.kraftek.com/blog/wfwcomment.php?cid=330</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.kraftek.com/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=330</wfw:commentRss>
    
            <category scheme="http://www.kraftek.com/blog/index.php?/categories/3-Linux" label="Linux" term="Linux" />
    
        <id>http://www.kraftek.com/blog/index.php?/archives/330-guid.html</id>
        <title type="html">Get asterisk music-on-hold live from an icecast+ices2 server </title>
        <content type="xhtml" xml:base="http://www.kraftek.com/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>My asterisk version is 1.6.2.6</p><br />
<p>My freepbx version is 2.7.0.1</p><br />
<p>To get music-on-hold from a live source, i made a script (/scripts/streamx.ksh):</p><br />
<p><font size="1"><em>#!/bin/ksh<br />/usr/bin/ogg123 -q -b 128 -p 32 -d wav -f - http://kraftek.com:8000/stream.ogg| sox -t wav - -r 8000 -c 1 -t raw - vol 0.10 </em></font><br /></p><br />
<p>and configured /etc/asterisk/musiconhold_additional.ksh with:</p><br />
<p><em><font size="1">[default]<br />mode=custom<br />application=/scripts/streamx.ksh</font></em><br /></p><br />
<p>And that is it!, just dial a conference room and you'll get live music on hold while waiting for your friends to join :)<br /></p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://www.kraftek.com/blog/index.php?/archives/329-See-a-live-list-of-open-connections-to-mysql.html" rel="alternate" title="See a live list of open connections to mysql" />
        <author>
            <name>rdircio</name>
                    </author>
    
        <published>2010-07-06T16:43:54Z</published>
        <updated>2010-07-06T16:43:54Z</updated>
        <wfw:comment>http://www.kraftek.com/blog/wfwcomment.php?cid=329</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.kraftek.com/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=329</wfw:commentRss>
    
            <category scheme="http://www.kraftek.com/blog/index.php?/categories/3-Linux" label="Linux" term="Linux" />
    
        <id>http://www.kraftek.com/blog/index.php?/archives/329-guid.html</id>
        <title type="html">See a live list of open connections to mysql</title>
        <content type="xhtml" xml:base="http://www.kraftek.com/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                watch 'mysql -e &quot;show processlist;&quot;' 
            </div>
        </content>
        
    </entry>

</feed>