RIGO.INFO TechBlog

Eventually I get into producing something I think is useful for others. You'll find random technical knowledge in this Blog so please be patient and use the search function. Some of these software are rather lame and old, the list is ordered by the approximate age (newest first). Unfortunately my older stuff are lost or scattered around my old CDs, not readable anymore 8(.

KopKop

kopkop_0.1.0-1.tar.gz - Stealthy and secure remote command triggering for IP networks. The kopkop daemon listens for encrypted, signed and fully random-looking command packets. Only the fields essential for the packets' travel trough the internet are filled with 'sane' data. Upon reception and after a preset timeout it executes user defined commands. This could be used to open firewalls, allow hosts, etc., so one can reduce your system's attack surface by hiding services like 22/tcp ssh or 1000/tcp webmin. The packet sending mechanism a.k.a. the kopkop client is also included. The communication is strictly unidirectional and quite minimal between the client and the server altough random padding is used to spread the packet size between 120bytes and 8Kbytes. Replay attacks are forestalled by storing and comparing monotoneously increasing packet ids on both sides.

2010-05-02 20:06 · 0 Linkbacks

Installing Debian Lenny and OpenVZ on an IBM xSeries

Recently I had the opportunity to install Lenny and OpenVZ on a bigger chunk of metal. You can read my full guide here.

2010-05-02 20:06 · 0 Linkbacks

Freemind to WikiMedia

Here you can find a modifyed version of freemind2wiki that converts freemind files to wikimedia markup.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="text"/>
 <xsl:template match="/">
 <xsl:apply-templates/>
 </xsl:template>
  <xsl:template name="linebreak">
   <xsl:text> 
</xsl:text>
  </xsl:template>
  <xsl:template match="map">
   <xsl:apply-templates select="child::node"/>
  </xsl:template>
  <xsl:template match="node">
   <xsl:param name="commaCount">0</xsl:param>
    <xsl:if test="$commaCount > 0">
      <xsl:call-template name="writeCommas">
       <xsl:with-param name="commaCount" select="$commaCount"/>
      </xsl:call-template>
    </xsl:if>
    <xsl:value-of select="@TEXT"/>
     <xsl:call-template name="linebreak"/>
      <xsl:apply-templates select="child::node">
        <xsl:with-param name="commaCount" select="$commaCount + 1"/>
      </xsl:apply-templates>
     </xsl:template>
     <xsl:template name="writeCommas">
      <xsl:param name="commaCount">0</xsl:param>
       <xsl:if test="$commaCount > 0">*<xsl:call-template name="writeCommas">
         <xsl:with-param name="commaCount" select="$commaCount - 1"/>
     </xsl:call-template>
    </xsl:if>
 </xsl:template>
</xsl:stylesheet>
2010-05-02 20:06 · 0 Linkbacks

Convert Video DVD or ISO to VOB using MPlayer

My custom iso2vob bash shell script to convert video DVD to VOB editable by Avidemux using MPlayer.

#!/bin/bash
info=`mplayer -ao null -vo null -frames 1 -identify -dvd-device "$1" dvd://`
 
if [ "$2" ]; then
 
	titles="$2"
	titles_num=`echo "$titles" | wc -w`
 
else 
 
	titles=`echo -e "$info" | egrep "ID_DVD_TITLE_[0-9]+_LEN" | cut -f 4 -d'_' | sort -n`
	titles_num=`echo -e "$titles" | wc -l`
 
fi
 
function dvdlabel() {
	dd if="$1" count=1 bs=1024 skip=32 2>/dev/null | cut -b 41-72 | sed 's/[^[:alnum:]]._ -]+//g' | sed 's/^ *//g' | rev | sed 's/^ *//g' | rev
}
 
tmp=`mktemp -d`
mkfifo $tmp/fifo
 
if [ -b "$1" ]; then
  echo "source type: block device"
  label=`dvdlabel "$1"`
  of="dvd.$label."`date +%s`
elif [ -f "$1" ]; then
  echo "source type: file"
  label=`dvdlabel "$1"`
  filename=`basename "$1"`
  of="$filename.$label.iso2vob"
else
  echo "error: source type unknown"
  exit 0
fi
 
echo "output dir: $of"
mkdir -p "$of"
 
mkdir -p "$tmp/mnt"
if [ -b "$1" ]; then
  echo "mounting source: block device"
  sudo mount -t iso9660 "$1" "$tmp/mnt" 
elif [ -f "$1" ]; then
  echo "mounting source: file"
  sudo mount -o loop -t iso9660 "$1" "$tmp/mnt" 
else
  echo "error: source type unknown"
  exit 0
fi
find "$tmp/mnt" | egrep -vi 'VOB$' | while read file; do cp -v "$file" "$of"; done
sudo umount "$tmp/mnt"
rm -f "$tmp/mnt"
 
echo "grabbing $titles_num titles..."
 
of="$of/$of"
 
for x in $titles; do
 
    num=`printf '%02i' $x`
    echo "dumping track $x..."
    mplayer $2 $3 $4 $5 $6 $7 $8 $9 -ao null -vo null -dvd-device "$1" dvd://$x -dumpfile $tmp/fifo -dumpstream 2>/dev/null 1>/dev/null &
    pv $tmp/fifo > "$of".$num.vob
 
done
 
rm -rf $tmp
2010-05-02 20:06 · 0 Linkbacks

Check files for holes

It's quite hard to tell if a file under Linux has holes (eg. it is a sparse file). This script tries to determine this by comparing apparent and real file sizes.

#!/bin/sh
 
where=${1:-.}
 
find "$where" -type f | while read file; do
 
#    apparentsize=`du --apparent-size "$file" | cut -f 1`
#    realsize=`du "$file" | cut -f 1`
 
    blocks=`stat -c "%b" "$file"`
    blocksize=`stat -c "%B" "$file"`
    realsize=$(($blocks * $blocksize))
    apparentsize=`stat -c "%s" "$file"`
 
    diff=$(($apparentsize < $realsize))
 
    if [ $diff -eq 0 ]; then
        echo [has holes?] $file [real:${realsize} apparent:${apparentsize}]
        hole='found'
    fi
 
done
 
if [ -z $hole ]; then
 
    echo "no hole candidates found"
 
fi
2010-05-02 20:06 · 0 Linkbacks

Linkbacks

Use the following URL for manually sending trackbacks: https://rigo.info/lib/plugins/linkback/exe/trackback.php/en:blog
en/blog.txt · Utolsó módosítás: 2009-05-15 00:00 (külső szerkesztés)
CC Attribution-Noncommercial-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0