xor eax, eax




Ø main()
Ø fireworkx
Ø amp
Ø gallery
Ø feedbacks
Ø about




ronybc.com
45.113.122.52



flag counter

Blogandrum - The Complete Conundrum (BETA)

Some of the following material may lack good manners, good language or any other good qualities or appropriateness of anything. In other words, can contain crap. The content put here are 'off the main' and has given less care and time, it may get suddenly disappeared at any time soon in the future of current universe. Things may be wrong to someone else's wisdom or depth or nature of thinking. In fact the poor author is seriously putting nothing intentionally wrong here. It might be the non-native English speaker, who is behind the pages, making all the trouble. Please don't shoot.

do.. Flattr micro-donation

Ø Securely erasing Flash memory and Hard disks

No filesystem erases file from disk when it is being deleted. It only counts the area been occupied by the file as mapped to no file. And the data will remain there until the space is reused in future for storing new data. There exists many software tools to recover such data. Using Magnetic Force Microscopy, it is possible to physically sniff overwritten data as well. But high densities of Terabyte hard disks will sure trouble them. While in ordinary world, there will be a mobilephone repair technician being successful using some special software to squeeze out interesting data out of those flash memory cards..!

Lets take a situation, when giving your computer, hard disk, USB Flash drive or Flash memory card to someone else. There is a thousand files which comes under the category 'personal' or 'confidential'. And there is more, those that were previously been in the storage media, which may get forgoten about. Need to consider each ones significance and what if went to a wrong hand. Had multiple users of the media? more trouble. So it is always better to wipe clean the whole drive or partitions before giving forth.

Warning: The following methods erases all data from entire storage media, beyond recovery. Use only if needed and with extreme caution. Identify and double check the disk device filename carefully and replace following '/dev/sdX' dummies with it. This is important because doing it on the wrong disk is one the top worst mistakes one can make on a computer system.

There are many ways to do so. First of all an open source dedicated tool for the job; read the manual pages and use shred on the entire disk. Shred'ing files can't always be said completely gone; different filesystems or media controllers may not work as supposed.

	$ shred -v -n1 /dev/sdX

Filling with zero's (Fast, but not always good. Intelligent controllers of SSDs and other Flash medias may skip the actual write with some shortcuts to save time and wear. The best way is; if there is 1GB, give it that much random data to be stored)

	$ dd if=/dev/null bs=1M > /dev/sdX

Filling with random numbers (/dev/urandom is slow)

	$ dd if=/dev/urandom bs=1M > /dev/sdX

Using 'pv' instead 'dd' is more interesting.

	$ apt-get install pv
	$ pv /dev/urandom > /dev/sdX

Or go for the pleasure of 'do-it-yourself'. Copy the following code.

	#include <stdio.h>
	
	#define RND(p) ((*(p) = (*(p) * 7141 + 54773) % 259200) * (1.0 / 259200.0))

	void main()
	{
		int n;
		int buf[1024];
		int seed = time(0);
	
		while(1)
		{
			for(n=0; n<sizeof(buf); n++)
			{
				buf[n] = RND(&seed) * 4294967296.0;
			}
			fwrite(buf, sizeof(int), sizeof(buf), stdout);
		}
	}

This is uses a fast Random Number Generator which is accidentally got from an example code in Ooura's FFT package (fft4g, used in SoX). Compile with enough optimizations to get maximum throughput of the random number pump.

	$ gcc -O3 -mtune=native -march=native -ffast-math -o rng-ooura rng-ooura.c

Compare its horsepower with '/dev/urandom'

	$ ./rng-ooura | pv > /dev/null
	$ pv /dev/urandom > /dev/null

On an AMD Athlon II X2 250 Processor @3.00GHz, speeds of the 'DIY Random Number Generator' and '/dev/urandom' are 424MB/s and 9MB/s respectively. That's fast enough to deal with HDDs withouts delays. Now, the super-fast HDD erasure with random:

	$ ./rng-ooura | pv > /dev/sdX

Example with 'pv' ETA timer set for a 500GB HDD.

	$ ./rng-ooura | pv -s 500g > /dev/sdx

Ø CSS3 font-face ; font freedom for webpages

There is a web standards guideline that sans-serif fonts are slightly more readable than serif ones. And most websites stick to this rule to let their visitors to read the posted text easily. Website designers who prefer the looks instead had difficulties keeping the appearance same between different browsers and platforms. The web only supported 'font families' such as sans-serif, serif and mono-type. The corresponding fonts for each of them differs between platforms and so the looks. Specifying an unique font will work only if the client side has it.

Since CSS version 3, there exists a new 'standard' way to supply the font to be used itself from the website to its user. This turns high degree of aesthetic revolution on websites. This website, as you can see those 'sharp edged' headings, already adopted it and applied on to head. (if your web browser is ancient or made of stone and incompatible with such things, f that's not my problem..! sorry, get the de facto descent Mozilla Firefox ).

Here is how it is applied, simple and easy, CSS is cool stylesheet scripting:

	<style>
	
	@font-face
	{
		font-family: biolinum;
		src: url('Biolinum_Re-0.4.1RO.ttf');
	}
	@font-face
	{
		font-family: biolinum;
		src: url('Biolinum_Bd-0.4.1RO.ttf');
		font-weight: bold;
	}
	
	body
	{
		font-family: biolinum, serif;
	}
	
	</style>
	
It won't work if the '@font-face' definition is moved to a separate CSS file instead placing inside <HEAD>...</HEAD> area. And place copy of the font file on server. And there is one more thing to take care of, that the font is being distributed to the web. Copyrights should be seriously considered. Better use open source freely distributable type ones. Such as the ones used in this website: 'Neocyr' (Open Font License) from openfontlibrary.org and 'Biolinum' (GPL, Open Font License) taken from Linux Libertine Open Fonts Project.

NAVIGATION PANEL:

Ø Parallel Resistance Calculator
Ø Voltage Divider Calculator
Ø LM317 Calculator
Ø Volume Control Pot with Parallel Resistor Graph tool
Ø Power Dissipation Across Transistor/MOSFET
Ø Display PPI Calculator
Ø Blogandrum - The Complete Conundrum
Ø The Eight Queens Puzzle
Ø Fireworkx : Linux version
Ø Kunthrantum - very low distortion audio power amplifier
Ø Creative AudioPCI soundcard mods (Ensoniq ES1370, AK4531)
Ø Buffered Flash memory access routines for PIC microcontrollers
Ø Fireworks : Windows version, coded using Win32 ASM
Ø SparcZ - tiny telnet server with remote desktop administration powers