neděle 8. září 2013

... chromcast like experience on smart tv

No dongle is needed to experience chromcast on SmartTV. In my case LG brand. The youtube app on the TV sucks. It's slow realllyyy sllooow. It's hard to use using only the tv remote. It's hard to use even using much better smart phone remote.       Now ... it is easy to send the youtube video from smart phone youtube app to she big screed of the smart tv.

Try it if you can!

pondělí 19. srpna 2013

... čajnafoun

... dorazil balík z dx.com obsahující telefon N6300. Cena podle kurzu Paypal 3814Kč ($184.60). Po připočtení služby České pošty v rámci celního řízení (180Kč, ale v balíku toho bylo víc, takže do ceny telefonu promítnuto jen částečně) a vyměřeného cla a DPH je reálná nákupní cena 4780Kč.

Telefon dorazil se dvěma kryty - jeden klasický "tenký" - jen zadní kryt. Druhý je pro "tlustší" variantu s větší baterkou a zkládá se ze zadního krytu a z přiklápěčího krytu displeje.

Telefon dorazil se dvěma bateriemi - jedna 1800mAh pro použití s "tenkým" krytem a druhá 2500mAh pro použití s "tlustším" krytem.

Balení dále obsahuje sluchátka, čínský nabíjecí adaptér, USB kabel a již nalepený screen protector.

UPDATE: Nevýhoda čajnafounu se ukázala díky mé nešikovnosti. A teď se nesmějte, protože to bude smutný příběh. Čajnafoun mi spadl do polevky. Fakt. A konektorem napred. A od te doby ... spise nefunguje, nez funguje. Takze jsem musel rychle hledat nahradu. A našel jsem téměř shodně vybavený trochu menší Gigabyte Aku A1. A při nákupu mi nabídli pojistku proti pohromám za 500Kč příplatek. A protože jsem stejnou pojistku využil nedávno u telefonu dětí, kývnul jsem na ni. V případě pádu do polévky by mi ho opravili za drobnou spoluúčast.

čtvrtek 8. srpna 2013

Installing GlusterFS 3.4 on Fedora 19

I was trying to install GlusterFS on Fedora 19. There were some problems which I describe here.

At first ... disable SeLinux on every Gluster node by changing /etc/selinux/config and set entry SELINUX=disabled

Packages of GlusterFS are part of Fedora 19 repository. Installation is easy.
I used following command:

sudo yum install glusterfs glusterfs-api glusterfs-fuse \
   glusterfs-server glusterfs-geo-replication 

After the packages are installed glusterd service is started. To connect the cluster nodes following command need to be issued:

sudo gluster peer probe the-other-node-ip 

But the command failed:

peer probe: failed: Probe returned with unknown errno 10

After some research using resources mentioned bellow I found the source of the problem (as usually): the firewall. Fedora 19 (and 18 already) includes firewalld.

Thing twice before changing your firewall settings. As I use virtualization and host only networking, I moved my host-only interface to the trusted zone:

sudo firewall-cmd --permanent --zone=trusted --add-interface=p7p1
sudo firewall-cmd --permanent --zone=trusted --change-interface=p7p1
sudo systemctl restart firewalld.service

To verify interface move submit:
 
sudo firewall-cmd --zone=public --list-all
sudo firewall-cmd --zone=trusted --list-all



References:

středa 7. srpna 2013

Psycho v letním kině

Dnešní promítání Psycho v letním kině mělo neopakovatelnou atmosféru. Ve chvílích, kdy film graduje se zvedl vítr přicházející bouřky .... ve scéně s Normanovou matkou ve sklepě se plátno divoce vlnilo ve větru a umocňovalo tak atmosféru filmu. Těsně před koncem plátno poryvům větru neodolalo a padlo. Úplně poslední scény s detailním záběrem do tváře Normana jsme sledovali na stěně domu daleko za původním plátnem a obličej byl tudíž obří .... nádhera.

neděle 4. srpna 2013

Convert Windows 7 Professional SP1 image from VMWare Workstation 8 to VirtualBox

I tried to  convert Windows 7 Professional SP1 running as guest in VMWare Workstation 8 to Oracle VirtualBox. The suggested scenario is to use ovftool from VMWare distribution to create OVF machine and VMDK disk image.

At the VirtualBox side the scenario suggests to Import appliance. Unfortunatelly the process fails with message "Could not find a storage controller named 'SCSI Controller'."

After some research following steps lead to working Windows guest in VirtualBox based on exported VMWare image.

I created VirtualBox machine from scratch with all settings left with their default values except memory (enlarged to 1GB) and I attached existing VMDK disk image created with ovftool (see above). Windows guest boot failed in BSOD until the disk was attached using SAS controler with LsiLogic type.

neděle 7. července 2013

Convert XML to CSV example

Input CSV

 <?xml version="1.0" encoding="utf-8"?>  
 <detail id="1243">  
  <nazev>Praktický lékař pro dospělé</nazev>  
  <jmeno>MUDr. Nomen Omen</jmeno>  
  <adresa>Street 1/234, 18000 City 8</adresa>  
  <telefon>89879076</telefon>  
  <fax/>  
  <ico>8908078</ico>  
  <poradove-cislo>000</poradove-cislo>  
  <poradove-cislo-det-prac>000</poradove-cislo-det-prac>  
  <nazev-zrizovatele>Fyzická osoba</nazev-zrizovatele>  
  <druh-zz>320 Samost.ordinace prakt.lék.pro dospělé</druh-zz>  
  <email>nomen-omen@mailer.ru</email>  
  <www/>  
 </detail>  

XSLT template file - takes one parametr output-header - when true, header is output first, output is Tab separated, no escaping nor quoting is done

 <xsl:stylesheet version="1.0"  
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">  
  <xsl:output method="text" omit-xml-declaration="yes" indent="no"/>  
  <xsl:param name="output-header" value="false"/>  
  <xsl:template match="/">  
   <xsl:if test="$output-header='true'">  
    <xsl:value-of select="concat('id','&#x09;')"/>  
    <xsl:value-of select="concat('type','&#x09;')"/>  
    <xsl:value-of select="concat('nazev','&#x09;')"/>  
    <xsl:value-of select="concat('jmeno','&#x09;')"/>  
    <xsl:value-of select="concat('adresa','&#x09;')"/>  
    <xsl:value-of select="concat('telefon','&#x09;')"/>  
    <xsl:value-of select="concat('fax','&#x09;')"/>  
    <xsl:value-of select="concat('ico','&#x09;')"/>  
    <xsl:value-of select="concat('poradove-cislo','&#x09;')"/>  
    <xsl:value-of select="concat('poradove-cislo-det-prac','&#x09;')"/>  
    <xsl:value-of select="concat('nazev-zrizovatele','&#x09;')"/>  
    <xsl:value-of select="concat('druh-zz','&#x09;')"/>  
    <xsl:value-of select="concat('email','&#x09;')"/>  
    <xsl:value-of select="concat('www','')"/>  
    <xsl:text>  
 </xsl:text>  
   </xsl:if>  
   <xsl:for-each select="//detail">  
    <xsl:value-of select="concat(@id,'&#x09;')"/>  
    <xsl:value-of select="concat('detail','&#x09;')"/>  
    <xsl:value-of select="concat(nazev,'&#x09;')"/>  
    <xsl:value-of select="concat(jmeno,'&#x09;')"/>  
    <xsl:value-of select="concat(adresa,'&#x09;')"/>  
    <xsl:value-of select="concat(telefon,'&#x09;')"/>  
    <xsl:value-of select="concat(fax,'&#x09;')"/>  
    <xsl:value-of select="concat(ico,'&#x09;')"/>  
    <xsl:value-of select="concat(poradove-cislo,'&#x09;')"/>  
    <xsl:value-of select="concat(poradove-cislo-det-prac,'&#x09;')"/>  
    <xsl:value-of select="concat(nazev-zrizovatele,'&#x09;')"/>  
    <xsl:value-of select="concat(druh-zz,'&#x09;')"/>  
    <xsl:value-of select="concat(email,'&#x09;')"/>  
    <xsl:value-of select="concat(www,'')"/>  
    <xsl:text>  
 </xsl:text>  
   </xsl:for-each></xsl:template>  
 </xsl:stylesheet>  

Customization: use your own element names, template matching rule and whatever to process more complex XMLs. Keep the structure (spaces, line ends) of the  tailing <xsl:text> to get proper line ends at the right places.

pondělí 10. června 2013

Create independent distribution of certain cygwin utility

In some cases you can find some cygwin utility useful for windows and you don't want or can't fully install cygwin. There is a handy utility called cygcheck which you can use to extract information about  certain cygwin executable dependencies. You can use the information to create standalone distribution directory of the utility. Following command extracts xmllint utility into /tmp/distro with all dependant DLLs.

mkdir /tmp/distro && cygcheck $(which xmllint) | \
grep cygwin |sed -e "s/^ \\+//" | \
cygpath -f - | \
while read x; do cp -v $x /tmp/distro; done


pátek 18. ledna 2013

... a way out of Windows symlink permission hell

For some reasons we needed to create symlinks on a Windows fileshare. Our environment was symlink ready (Win7 & WinServer 2008R2 & SMB2 everywhere). We started to try ... it sometimes worked sometimes not. Sometimes we received "You do not have sufficient privilege to perform this operation". Frustrating.
Finally we managed to make it working. We can now create symlinks from our server app directly in a shared folder.

Prerequisites
  • Windows 7+ and Windows Server 2008 R2 + and SMB2 enabled

Fileserver setup
  • the user willing to create symlinks must be 
    • granted "Create symbolic link" privilege (use Local Security Policy tool on the server)
    • granted modify right for the folder containing the symlink
Client setup
  • the user willing to create symlinks must be granted "Create symbolic link" privilege (use Local Security Policy tool on the client)
  • the right to  create symlinks must not originate from Administrators group -> the right must be granted directly to the user or indirectly via a security group
  • the user should not be a member of the Administrators group or the Administrators group should not bring the Create symlink permission (UAC disables the permission when it comes from the Administrators group --- UAC is EVIL)
  • depending on the link type used, the client computer must be able to resolve symlinks of certain type
    • turn symlink evaluation on using command (enables all kind of symlinks)
      • fsutil behavior set symlinkevaluation L2L:1 L2R:1 R2L:1 R2R:1 
If everything goes well you should be able to invoke following command to create directory symlink:

mklink /d \\server1\links-are-here\this-is-a-link \\server2\data-are-here\this-is-a-link-target