Wednesday, February 8, 2012

Mediatomb, stream your PC media to TV (Ubuntu)

MediaTomb is an open source UPnP Media server with a cool web user interface, which allows you to stream your digital media through your home network and listen to, or watch it on a variety of UPnP compatible devices. That means no cable directly connected to your PC! It even makes it possible (with some tweaking) to stream YouTube videos to your TV.

You can get it with this CLI command in Ubuntu:
sudo apt-get install mediatomb

Now start your Mediatomb and quit it right after it starts, either with CTRL+C or kill pid, does not matter.
You can start it with this command:

(*Note, I had to do this for the config file to be created in the hidden directory, .mediatomb that is)

Open the config file (be sure you are in right directory!):
sudo gedit ~/.mediatomb/config.xml

<ui enabled="no" show-tooltips="yes">
<ui enabled="yes" show-tooltips="yes"

if you wish to enable web user interface (this is a major security risk though, anyone on your network can access your root files and manipulate them, so be sure to disable this when done with the config, especially if you plan to run this for a few hours+!).
You can select within it, which folder is being scanned for media. It is quite user friendly and straightforward.

If you have a TV with a ethernet port, be sure to plug it into the same network, and source-find Mediatomb. When opened, you will be able to select videos, music or photos available from your PC, and play them!
Do not forget to select which folder is "sharing" content to your TV, which is done in the Web user interface.

***I had some issues with the Samsung TV, everything i tried to play gave me "unsupported format" error. Here is a fix that seemed to work even for other TV brands.

Open the config file:
sudo gedit ~/.mediatomb/config.xml

Remove the comments (<!-- -->) from <custom-http-headers> part and add/modify things so it looks like this (note that 017000 000.. is all in a same line):
<add header=" Streaming"/>
<add header=" DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=017000 00000000000000000000000000"/>

Now, find <mappings> and add the following:
<map from="avi" to="video/mpeg"/>
<map from="mkv" to="video/mpeg"/>

You need to restart Mediatomb for the changes to take effect.

***To disable Mediatomb autorun, do this (backup first):
sudo mv /etc/init.d/mediatomb /etc/init.d/mediatomb.backup
sudo update-rc.d mediatomb remove

If you instead wish to use the autorun feature, be sure to edit the config file located in /etc/mediatomb (yes, there are actually two config.xml).


Saturday, February 4, 2012

Automate Desktop screenshoting in Ubuntu

Today I'll present (and explain) a tiny script used to create a screenshot of the active window in your Ubuntu installation.
Naturally, you can easily press Print Screen key and take the screenshot with the native Gnome-screenshot, but automating screen capture can be good in case you wish to stream your desktop or active program to some other computer - but still wish to avoid CPU intensive programs that stream it live.

I will be using ImageMagick (import), which you can easily get via apt, if it is not already installed on your Ubuntu.

Here is the script:
echo "taking screenshots"
while :
        import -window root -resize 1920 Screenshot.png
        sleep 10
Save it and execute in Terminal with "bash scriptname" (eg.: bash /home/user/scriptname). You could also make it executable either via chmod +x in Terminal or by ticking it in the file options accessible via right click.

As you can see, it is a bash script. Echo will output the text between quotes, while : do signals the beginning of the endless loop (which means this screen will be canceled upon kill signal, either a CTRL+C or kill pid in Terminal).
Import -window root -resize 1920 Screenshot.png will screenshot your active window (your browser, a program, etc), resize it to 1920x1080 pixels and save it as Screenshot.png in your home (~/) folder.
Sleep 10 is the delay (in seconds), and since it is the last line in the loop, it is the delay until the loop repeats itself. You may switch that as you see fit.


Thursday, February 2, 2012

Sandboxie protects your Windows

Today I present you Sandboxie. A Windows application which may save you a headache or two.
Basically, what it does, is runs applications in a closed environment (sandbox), preventing them from making any changes to your system.

That means it is a great app to run your:
-web browser (when visiting questionable websites)
-suspicious applications (cd-key generators for example)
-email client (those supposedly funny emails that threaten you will die if you don't forward it to 10 friends)
-etc . . .

Definately a great application + it keeps your Windows installation nice&tidy!

You can get it HERE

Sunday, January 29, 2012

Converting Dicom (aka Medical) images

Today, I will explain how to convert a Dicom image (.dcm), which is a standard in medical imaging, to other formats (pgm/ppm, png, etc...). Usually MRI and such images are saved in this format.

There is a CLI tool to read&convert this kind of files, you can get it by running this in the Terminal (Ubuntu users):
sudo apt-get install dcmtk

You can then use these tools:
I had to use dcmj2pnm, as dcm2pnm gave me errors (really depends on what kind of images you have).

Note* (in case of permission issues first copy the .dcm files to your disk, if they are on a CD issued by the doctor, and change permissions. A chmod 775 *.dcm run in the images dir will do the trick).

Run this command and it will convert the picture in a different format:
dcmj2pnm --all-frames input_image.dcm output_image


Wednesday, January 25, 2012

Disposable, temporary email's

Today I present you Disposable emails. Ever been to a site or maybe a forum that required registration, but you were reluctant to give your real info or just too lazy to create a new Gmail/Hotmail etc..? This situation is completely bypassable with disposable, "temporary" emails + it gives somehow limited, but still solid Anonimity.

Here are two of them:

one, which requires registration, and that means you have to put yourself on the line + registration takes precious seconds! But it sends notifications of incoming messages to your real mail, that you provide on registration. Well, you could just create another Gmail and set up forwarding for that, no? Depends what you do.. :) The cute thing is that you set the mail expiration, from 1 day to max 1 year, which makes this a disposable email only you can use. is the fast thing, althought anyone has access to that which it contains. The mail is automatically created when something is sent to their domain, and you can access it through their web page. (e.g.: mail send to, and if that specific mail does not exist, it is automatically created).
This means, that you might share your temporary mail with someone else, if you aren't artistic about the naming.

You can ofcourse find many of these by looking up on your favourite search engine.


Monday, January 23, 2012

Viewing hidden files/folders in Ubuntu

Press Ctrl+H when in a directory containing hidden files/folders.
Hidden files/folders are now fully shown.

If you want hidden files/folders displayed at all times, open up a folder and go to
Edit>Preferences and tick "Show hidden and backup files"

Here are some Terminal commands for this purposes.

Display all files/folders, hidden ones included:


ls -a

Display only hidden files and folders:
ls -A | grep "^\."

Display only hidden directories:
ls -A --file-type | grep "/$" | grep "^\."

Display only hidden files:
ls -A --file-type | grep -v "/$" | grep "^\."

Sunday, January 22, 2012

Export (supposedly) non exportable Certificates

Today I'll expain how to export (supposedly) non-exportable Certificates in Windows. Here is a crafty tool, Mimikatz that can export ANY certificate. Yes, you can export even your personal Bank certificate, and it won't ask you for a password. Makes you wonder, how safe you really are. All you need is Administrative rights + it works on Windows Vista/7 !

First of all, download the archive containing the tool (the latest release is in the trunk). Get it here:

Extract the contents, access the either the Win32 or x64 folder (depends which OS you have installed, 32 or 64 bit) and run mimikatz.exe

1) A Command prompt will apear, and there you need to type:

2) Afterwards type this:

2b) If you get errors, try this instead:

3) And the last step:

3b) Again, if you get errors, try this one:
crypto::exportCertificates CERT_SYSTEM_STORE_LOCAL_MACHINE

Your Certificate(s) should now be dumped to your Documents folder. They are the pfx files and have assigned a password, "mimikatz". That is what you will need to input when you try to import them on any computer.

Enjoy, and remember not to use this for malicious purposes :P