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

Friday, January 20, 2012

Clearing Terminal history (Ubuntu)

Terminal history can be a nuisance for some users. I rather not delete it (as I am the only user of my PC), but the deletion can come in handy in work environments, where you can be ridiculed by co-workers by typing "pink" instead of ping.

First of all, be sure to be logged as the user, whose Terminal history you wish to clear/modify.

The most basic way is the complete wipe with this command:
history -c

You could also delete an individual notation in history by doing this:
history -d PIN

(eg. history -d 1300)

(*Note, that the PIN is shown when you run 'history' in the Terminal. It is the number noted infront of the commands you ran, check picture bellow)

This will however leave a track. It will be recorded in history :)

If you wish to avoid that open the .bash_history file with an text editor and manually find&delete that damn line:
sudo gedit ~/.bash_history


Thursday, January 19, 2012

Clearing history in Ubuntu (watched movies, opened documents, etc)

Watched a dirty movie? Or are you just unhappy with everyone seeing what you do with your PC?
Let's see, how we can fix that in Ubuntu (11.10).

Luckily, nearly all questionable history (movies watched, documents opened, ...) are recorded in the same file named recently-used.xbel .
Do the following commands to delete the file containing history, and then recreate an empty file with same name:

sudo rm -rf ~/.local/share/recentyl-used.xbel

sudo touch ~/.local/share/recently-used.xbel

Your history is now clear, but any new actions will be noted in the file, so further modification is needed to stop that.

This will disable history logging:
sudo chattr +i ~/.local/share/recently-used.xbel

This will enable historry logging (if you change your mind later on):
sudo chattr -i ~/.local/share/recently-used.xbel

I'll post about clearing Terminal history tomorrow.-

Wednesday, January 18, 2012

Create/Convert various pictures or documents to PDF

doPDF is a free program which lets you create PDFs out of any printable workspace (eg.: Word, Excel).

It works as a Virtual printer, meaning you create PDFs via the usual "File"->"Print" step, where you select the doPDF virtual printer "device", which then does not print on papers, but creates a PDF document on your PC.

It also allows you to convert to PDF from a big variety of file types (DOC, DOCX, DJVU, XLS, XLSX, XPS, PPT, PPTX, DOT, EML, VSD, PUB, PUBX, MPP, WPD, OpenOffice, DWG, HTML, TXT, PNG, JPEG, GIF, TIFF +  a few hundred more).

One interesting fact I found when installing it was the extra multi-language support, where I counted over 30 available languages (but then again, it really isn't that text rich tool!).
Anyway, excellent tool. Fast, stable, and does indeed save time when doing that annoying office work +  it is free.

Tuesday, January 17, 2012

Extracting Exif data from pictures

This post will be a mini guide on how to 'extract' all kind of data from a picture.Why would this interest you?
Because some new gadgets (Iphone and other newage smartphones) save all kind of data in a picture. Even the location where the picture was taken (coordinates)!

So next time you post a picture on Internet, ask yourself, can the info it contains harm me in any way? Predators must be angry now. But so is the Police (Yes, they are checking this too).

Windows users can try the Exif Farm found here. Its use is pretty straightforward.
See bellow how it displays the info:

Ubuntu users can use the command line tool called jhead, which is also a great tool to manipulate exif data (delete/change).

Get it by running this in terminal:
sudo apt-get install jhead

To delete all EXIF info from a picture run this:
jhead -purejpg /path/to/image.jpg

To delete all EXIF info from all pictures (jpeg) in current directory, run this:
ls | xargs jhead -purejpg


Alternatively, you could also try Exif, get it with:
sudo apt-get install exif
And then check the manual with:
man exif

Another alternative to see EXIF data is this website, try it out if you hate installs.


Monday, January 16, 2012

New Topic link - Ubuntu

Decided to create a new Topic named Ubuntu today, that is going to be available under Links. That's how it looks:

As I already posted about it and plan to do even more, it will ease the browsing a little bit.

I have been doing a few bigger projects these days, so expect it posted within a week, or so.

Have a great day :)

Sunday, January 15, 2012

Make ISO images in Ubuntu command line

Hate to use all that fancy graphical programs, that have just too many functions?
Luckily, there is a nifty command line tool available: genisoimage.

Install it with the following command in Terminal:

sudo apt-get install genisoimage

Use it with this command (make an iso out of entire directory):

genisoimage -o OUTPUT.iso INPUTDIRECTORY/

(*Note, you can name the .iso anything you like.)

Or this (make an iso out of selected files):


Here are the examples:

geniso image -o mymovies.iso /home/user/mymoviesdirectory/

geniso image -o mymovies.iso clip3.mpg clip4.avi

Saturday, January 14, 2012

Multiple screen support in Ubuntu

It is widely known that Ubuntu has some problems with multiple screen support. This is easily solvable with a few clicks. I will explain in bellow.

First of all, we need to install gconf-editor, do it with the following command in Terminal:

sudo apt-get install gconf-editor

Afterwards, run it either within your App list or by writing the following in Terminal:


When the program starts navigate through "desktop", then choose your shell (Unity, Gnome, etc.. whatever you use). Afterwards choose "shell" and then "windows".
Check the window on right for values. You need to uncheck the "workspaces_only_on_primary" to have the multiscreen functionality work as intended.
If you have a curious nature, you can check out other settings and actually mod your Ubuntu looks as you see fit.

Here is a picture in case those programs steps confused you (uncheck the option if you want multiscreen to work as intended):

Friday, January 13, 2012

Switch from Unity to Gnome shell on your Ubuntu installation

If you are one of those, that just cannot cope with Unity, know that there is a good alternative (and i do not mean KDE). You can try Gnome 3 shell, which is fully supported in Ubuntu 11.10.

You can install it with the following command in Terminal:

sudo apt-get install gnome-shell

Afterwards reboot your computer; you can use the following command:

sudo reboot

When your Ubuntu loads, just before you log in, click on the Maintenance icon next to your Login, and select Gnome. That will default the Gnome shell for your Ubuntu installation.

Enjoy & remember to use your Superpower button - the Windows key on your keyboard to bring up your Applications bar and Search !

Thursday, January 12, 2012

Automate Windows restart script to prank friends

Here is a little crafty script meant to annoy your colleagues or friends by restarting their computer whenever its run. Be sure to apply it in Windows XP, as it will probably not work on newer Windows versions.

Start by opening Notepad. Write this inside and be sure to save it as .bat file (eg.: anyname.bat). Naturally, you need to select "File type" as "Any" when saving.

@echo off
shutdown -r -t 01

Now to spice things a little bit, hide this script anyware on the computer. We will now make sure this script runs whenever Windows start - making it an interesting loop of senseless and non-stop restarting. Open up the scheduler, by going to Start -> Settings -> Scheduled Tasks.

Click on "Add Scheduled Task", click "Next" and then click on "Browse". Select your newly made script and click "Next".

After that, name your new very mean task and select when does it perform - When i log on / When my computer starts is very mean, as it will be fixable only by going to Safe mode. Click "Next" and input credentials if asked to and then click on "Finish". That's it, you are done!

Enjoy pranking your friends!

Wednesday, January 11, 2012

FFMpeg, video converter for Iphone / Nokia / PSP and other devices

FFmepg is a command line utility to convert audio/video, resize it, manipulate frame and bit rate, etc etc. I use it to convert .avi videos to .mp4, which are watchable on my phone.

Get it with this command in Terminal:

sudo apt-get install ffmpeg

(*Note for writtings bellow: INPUT.avi is the movie name you wish to convert, so name it accordingly, OUTPUT.mp4 can be named as you see fit.)

To check video information do the following command:

ffmpeg -i INPUT.avi

To change video bitrate:

ffmpeg -i INPUT.avi -b:v 64k OUTPUT.avi

To force the frame rate of output file to 30 fps, do the following:

ffmpeg -i INPUT.avi -r 30 OUTPUT.avi

If you wish to turn a number of images to video:

ffmpeg -f image -i image%d.jpg VIDEO-OUTPUT.mpg

Or vice versa, turn a video into a number of pictures:

ffmpeg -i VIDEO-INPUT.mpg image%d.jpg

For Iphone users that wish to convert from .avi to .mp4:

ffmpeg -i INPUT.avi input -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X OUTPUT.mp4

PSP and Nokia owners, use this to convert from .avi to .mp4:

ffmpeg -i INPUT.avi -f mp4 -vcodec mpeg4 -b 2200k -r 30 -s 640x360 -acodec libfaac -ar 32000 -ab 128k -ac 2 -threads 8 OUTPUT.mp4

If this does not work for you (libfaac errors), check this extensive guide on installing and setting ffmpeg up manually:

Tuesday, January 10, 2012

Fix boot problems - Grub 2

Here is a quick how-to guide on how to fix Grub2 without a liveCD. There are many possibilities on how to break it in the first place, but the most common one is setting up new partitions on a secondary OS - eg. setting up partitions in Windows, while the bootloader is indeed Grub. Doing this will most likely make it impossible to boot up your OS's in a normal way.

Here is what you need to do:

When you boot up this will appear if Grub 2 was not able to find its folder or load a module:

grub rescue>

(*Note "grub>" appears if modules were successfully loaded, but the grub.cfg file in the boot process)

You can type in "set" to see current setting.

To find out your partition table do:


They will be noted in a format similar to this: hdx,y (where x is the disk, and y is the partition - this might be relevant to you if you have more than 1 disk).
Find the partition with your Ubuntu/other linux installation and write it down to a piece of paper.

Do the following command, and input your partition:

set root (hdx,msdosy)

(eg. set root=(hd0,msdos3) or set root=(hd0,sda3) etc.. depends what you have)

We will now be setting the prefix, determining where is the boot folder. Usually it is one the same partition as your OS, so use that.

set prefix (hdx,msdosy)/BOOT LOCATION

(eg:set prefix (hdx,msdosy)/boot/grub)

Write this to load the normal module:

insmod normal

Now we attempt to activate the normal module. Grub 2 menu should appear if all went good. Write this:


After successfull boot to your OS, be sure to do the following in Terminal:

sudo grub-install --boot-directory=/boot/grub /dev/sda

Voila, you fixed your Grub 2. This is ofcourse much easier with a LiveCD, because the only thing you need to do is mount your filesystem and do the grub-install command.

Monday, January 9, 2012

Surf anonymous with Proxychains (Ubuntu)

There is a bunch of apps that switch proxies for you but I found this one to work the best for me. What does it do? Basically, it automatically switches between proxies you listed, which can make it hard to trace you back. Some even consider using this on their jobs, to access content they would not be able to, because of their company policies.
It supports HTTP, socks4 and socks5 servers which can be chained together.

Lets get started, shall we?
First of all, you will (probably) need to add a source to your apt list. Backtrack repo has proxychains, so we will be adding it to our list. You can always remove the added lines later on, or put a comment before them.
You can do that by editing the file /etc/apt/sources.list with gedit/nano/vi(m). Be sure to use sudo!

eg.: sudo nano /etc/apt/sources.list

Scroll down to the end of file and add the following:

## Backtrack
deb revolution main microverse non-free testing
deb revolution main microverse non-free testing
#deb revolution main microverse non-free testing
deb revolution main microverse non-free testing

*Note, as you can see i have commented the 64.repository, as I use a 32bit system.
Choose the one that will work for you.

Save & close the file and then run the following in your Terminal:

sudo apt-get update && sudo apt-get install proxychains

When proxychains is successfully installed, it is time for configuration.
Nano/vi(m)/gedit this file: /etc/proxychains.conf.

eg.: sudo nano /etc/proxychains.conf

There will be a bunch of information here, take your time and read it if you wish.
If you scroll down the file, you will notice nearly everything is commented (#), it is important not to mess with comments too much. Common logic applies - comment stuff that is not needed and uncomment that, which is needed.
You have three possible options (leave one of them uncommented):
-dynamic_chain which takes the proxies in the order you added them and skips dead proxies.
-random_chain which takes the proxies from the list in a random order.
-strict_chain which takes the proxies in the order you added them like the dynamic_chain except this chaining option does not skip dead proxies.

*Note that if you select random_chain you will also need to setup the chain_len parameter.

I think dynamic and random chains are the most useful, but I will leave that to you. Scrolling further down will show you the following:

# add proxy here ...
# meanwile
# defaults set to "tor"
socks4 9050

Here is the place you place your proxies. Be sure to leave that line with your localhost, and just add proxies bellow it.

Here is an example of three added proxies (*Note that they are fictional, and also notice what i put before the IP - socks4/5 or HTTP):

# add proxy here ...
# meanwile
# defaults set to "tor"
socks4 9050
socks4 1111
socks5 2121
HTTP 1080

You can get a free list of proxies on Google. Just search something similar to "free socks4 proxy". Naturally, do not forget to enter port (which is the number right after the IP). Althought free proxies are most likely honeypots, either put there by the Government or some malicious people stealing creds, it will do for this test (as long as you do not log in your PayPal/Gmail or do some illegal stuff :P).

When you have your proxies saved in configuration file, test them with the following command in the Terminal:


You can then type the following to start browsing with your proxy:

proxychains firefox

(*Note, this starts the web-browser Firefox. You could put here Chrome, Opera, or even telnet or ssh.)

Even adding a website works:

proxychains firefox

Be sure not to close your Terminal;  within it you can see, how is your connection working out. Also, putting too many proxies (especially public ones) will make your surfing extremely slow. Surfing dynamic websites will take ages. Enjoy your anonimity! :->)

Sunday, January 8, 2012

Operating system Virtualization

There is a number of apps allowing you to virtualize an operating system, within another operating system. I found VirtualBox quite appealing, as it is free, has great support from the community, is extremely easy to use and covers a great number of OS's.

I successfully virtualized:
~Windows (98 -- which is still a crappy OS that takes alot of time to install and has weird processor handling -- XP and 7)
~Linux (Ubuntu, Red Hat its kid CentOS and Suse)
~Android OS
Before you atempt to virtualize MacOS, be sure your processor supports Virtualization, that is Intel-VT or AMD-V (depends on your processor brand).
You can check it with this ( tool made by Gibson Research Corp (Hack the Gibson! :-) )

*Note, that MacOS will not run as it is supposed to. Expect random crashes, stuff not working, etc.

I will write an extensive guide with pictures on VirtualBox in a new post.

You can get VirtualBox HERE.

Saturday, January 7, 2012

A very own Apache server with MySql/Php/Perl + more

Ever wanted your own apache server with MySql/Php/Perl/Etc..? Maybe for your website development test environment or just a general use apache server for sharing files with friends/colleagues? XAMPP offers just that, with an easy installation and configuration, taking a few clicks at most. I found this bundle very useful even when flashing STBs/Router's, as I could download required packages from my own apache server.

It is possible to install different modules (MySql, Apache, FileZilla, Mercury) as services, meaning they will start up automatically on system boot - which is great but presents a possible security issue. Be sure to change default passwords and consider disabling features you do not need (meaning, do not install them as services in the first place).

Your apache server is accessible over a web-browser typing the following:


*Note: localhost is same as, as long as you did not change your loopback address. If you left your hosts file untouched, localhost will work just fine.

The following will open XAMPP's default Administration panel, where you can check a number of settings - Security and Status will probably be your first choice after installation. Placing files under <path_to_xampp_installation>/htdocs will make them available for download or make it visible, if the files represent a website.


So, for example, if you coded a webpage and named it mypage.html, then placed it in the htdocs folder, it will be available via browser at http://localhost/mypage.html .

XAMPP is also excellent for those that wish to learn/practice MySql syntax. Start-up MySql and either use provided web based client phpMyAdmin or run the sql command line (mysql.exe) under <xampp_folder>/mysql/bin . Use the windows native command prompt to run it by entering the following (be sure to swap the <xampp_folder> with the actual path - usually it is c:\xampp):

<xampp_folder>\mysql\bin\mysql.exe -u root -p

(-u meaning username, root being the username and -p stating you will be typing in a password)
Then type in your password and voila, you are in the MySql shell.

I suggest you make a simple script that will make this a one click procedure.
Open up notepad and type in the following:

@echo off
<xampp_folder>\mysql\bin\mysql.exe -u root -p

Save it as .bat file (be sure to select "Any" under "File type"). Place this script on desktop and run it when MySql is actually started. (check your XAMPP Control Panel to see if it is "Running")
If Firewall starts to complain, be sure to allow XAMPP and its components.

Linux procedure is fairly similar, but I suggest you use LAMP instead. I will write an extensive guide in another blog entry.

Taken from their website: 
XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.
You can get it from

Sunday, January 1, 2012

Windows password reset (Sticky keys abuse)

Resetting the Windows administrator/user password is ridiculously easy. While there are other options, I find this one quite entertaining. It involves "abuse" of the Sticky key feature (which is invoked upon repeatedly pressing the SHIFT key for five times). The entire procedure is explained in detail bellow.
Summarizing it all .. this procedure replaces the sethc.exe (which runs the Sticky keys) with cmd.exe, and also renames it as the original file. So when SHIFT key is pressed five times, we invoke CMD instead of Sticky keys, allowing us to manipulate Windows users.

- STEP 1: Boot your Windows recovery CD.

- STEP 2: Access the partition where Windows is installed (by default either c:\ or d:\)

- STEP 3: Write the following (where "c:" is the drive letter of Windows installation):

copy c:\windows\system32\sethc.exe c:\
(This will create a copy of sethc.exe for the restore step)

- STEP 4:
Afterwards, write this (to replace sethc.exe with cmd.exe):

copy /y c:\windows\system32\cmd.exe c:\windows\system32\sethc.exe

- STEP 5: Now reboot your computer and normally start your Windows installation.
When the logon screen appears, press the SHIFT key five times in an adequately rapid timing.
CMD should appear, where you can enter the following to set your new Windows password:

net user yourusername yournewpassword

(in case you don't remember your username, write "net user" to list all available usernames)

You just changed your password and can now login with it!

- STEP 6 (restore): It is advisable to restore the sethc.exe file to it's respective place (we did a backup copy a few steps before).
Once again, boot your Windows recovery CD and write the following:

copy /y c:\sethc.exe c:\windows\system32\sethc.exe

Pressing the SHIFT key five times will now (again) invoke Sticky keys.

This is also possible by booting a Live CD (eg. Ubuntu, Knoppix) and manually doing copy/paste/rename for all involved files.

Clearing browsing history off a computer (through way)

How to completely clear your browsing history:

Clear your (recent)browsing history (cookies, saved passwords, cache, etc...) in your browser. The options is usually located under settings/tools. Additionally, some browser offer the option to automate this (eg. Firefox has an option to clear browsing history each time you close it - you can find it under "Privacy" tab in the browser "Preferences")
Most people already know about this, and do it frequently, but it is not enough.
Windows also keeps a list of domains, a local DNS cache, viewable with the "ipconfig /displaydns" written in the CMD.

So after clearing the browser cache, it is also advisable to flush and reset the contents of the DNS client resolver cache. This is also useful for when an invalid DNS entry is cached (either by mistake or an hacker poisoning your DNS cache).

- Windows users do this in the CMD:
ipconfig /flushdns

Optionally, you could make an executable script and place it on desktop, so you don't have to repeat the command each time.
Do this by opening notepad and writing the following:
@echo off
ipconfig /flushdns

Click on "File", "Save As" and enter a name followed by ".bat" extension. Be sure to select the "File type" as "Any" (so you do not get a file named anyname.bat.txt).
You can run the script by double clicking on it (each time you stop browsing the web, if you are paranoid).

- Linux (Ubuntu does not store DNS cache locally by default, so if you did not turn it on, this is not necessary) users do this in the Terminal:
sudo /etc/init.d/dns-clean start

Script how-to (Ubuntu Linux):
Make a new textfile with any text editor (eg. gedit, vi/m, nano).
Write the following:
sudo /etc/init.d/dns-clean start

Give it a name and save it with ".sh" extension. To make it executable either write "chmod +x" in Terminal or right click your file and under "Permissions" tab, check "Allow executing file as program".
You can now run it with a double click (be sure to select "Run in Terminal") or by writing "./" in the Terminal. The command will be run after you enter your password.

Access Linux partitions from Windows

There are a number of options for accessing Linux partitions from Windows. One of them is Ext2 IFS for Windows .

Its functionality is indeed great, but what I really want is a program that won't show my Linux partitions whenever i check My Computer.
Explore2fs offers just that, showing the partitions within the program + it is portable, as there is no installation, just unpack&run.

Features (from :
  • Reads ext2
  • Reads ext3
  • Drag & Drop
  • 1.44Meg Floppy Disk Support
  • LS120 Floppy Disk Support
  • ZIP & Jazz Disk Support
  • USB & CF Disk Support
  • CDROM Support
  • Supports Windows 98 extended partition scheme
  • Export files as binary
  • Export files as text
  • Export directory
  • View/Execute file
  • Large disk support
  • Large file support
  • LVM2
  • ReiserFS Detection
  • Unicode UTF8 support
  • Preserve time stamps on export