Archive for the ‘windows’ Category

permanently delete data

Saturday, November 22nd, 2008

Some of you are wondering if files and directory structure as well as contents of them can be restored if deleted from the computer. Sure, but… not if you delete them knowing what you do :)

GNU and other free and powerful programs are the best choice for permanently deleting data ( for those which burning the disk is a bit extreme option ).

Data on diskOn NTFS or FAT file systems recovering is quite easy and with that security can be compromised. On other file systems recovering with a bit of laboratory treatment can also be achieved.

Use programs such as shred for example to destroy data. Shred not just unlinks inode from the file system table, it also overwrite file you want to delete with some other data firstly. So bits of data doesn’t get just lost, they firstly get overwritten and then lost. Consider printing some text on your highly classified A4 paper before “grizly” shreds it into pieces.

For more workload and more professional approach, I used Dban boot and nuke to wipe whole drives.

Example in bash, first create 10MB file, then shred it :)

ludo:~$ dd if=/dev/zero of=10MB.txt bs=10M count=1
1+0 records in
1+0 records out
10485760 bytes (10 MB) copied, 0.184 s, 57.0 MB/s
ludo:~$ /usr/bin/find -name "10MB.txt" -exec shred -fuvxz -n1 {} \;
shred: ./10MB.txt: pass 1/2 (random)...
shred: ./10MB.txt: pass 2/2 (000000)...
shred: ./10MB.txt: removing
shred: ./10MB.txt: renamed to ./00000000
shred: ./00000000: renamed to ./0000000
shred: ./0000000: renamed to ./000000
shred: ./000000: renamed to ./00000
shred: ./00000: renamed to ./0000
shred: ./0000: renamed to ./000
shred: ./000: renamed to ./00
shred: ./00: renamed to ./0
shred: ./10MB.txt: removed

how to describe the universe. What is Universe?

Thursday, July 3rd, 2008

easy job, if you are from outer space :)

Universe is group of objects, data, waves,… mashed and revoked as the constantly changing elemental parts of its makeofs. But the point is, that the Universe is limited in between terms of +π and -π. Math.PI. Extract all amount of data between 3.141592653589… and you surely win a Loto game.

The terms space, universe… are nothing more than true and false evaluated rules and knowledges learned trough lives of civilizations. And yes, lives not times as time is nothing more than local counting seconds or whatever you count. Times really do not change. Life therefore is the maker of the universe, as it is a part of it. Finally one loops their minds with all possible words, froms,.. thoughts. Or nothing :)

Everything and Nothing Between +π and -π is the Universe.

breign Breign

php system script for maintaining mysql databases and tables

Thursday, June 12th, 2008

This is one of the php system scripts I wrote and would like to share. It can be extended but it already does its basic stuff - mysql maintenance with email notification.

Use it in cron and have a peace with tables, indexes and keys :)

< ?php
// which databases to maintain
$databases  = "provider wp subversion mysql";
 
$returnval = maintain_mysql($databases);
@mail("root","mysql database maintainer", $returnval);
 
/**
* mysql table maintainer - optimizes and rebuilds indexes on mysql tables
*
* @author benjamin.povirk@***** 3.1.07
* @return string
* @param databases to maintain
*/
function maintain_mysql ($databases) {
 
$database = explode(" ", $databases);
foreach ($database as $db) {
$returnval .= "maintenance on all tables in ".$db." started\r\n";
// Connecting, selecting database
$link = mysql_connect('localhost', 'YOUR_USER_HERE', 'YOUR_PASSWORD_HERE') or die('Could not connect: ' . mysql_error());
 
mysql_select_db($db) or die('Could not select database '.$db);
 
//repair and optimize all tables in current database
$query = "SHOW TABLES";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
 
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
  foreach ($line as $col_value) {
    $lock = mysql_query("LOCK TABLE ".$col_value." WRITE") or die('Query failed: ' . mysql_error());
    $optimize = mysql_query("OPTIMIZE TABLE ".$col_value) or die('Query failed: ' . mysql_error());
    $repair = mysql_query("REPAIR TABLE ".$col_value." QUICK") or die('Query failed: ' . mysql_error());
    $unlock = mysql_query("UNLOCK TABLES") or die('Query failed: ' . mysql_error());
  }
}
mysql_free_result($result);
mysql_free_result($repair);
mysql_free_result($optimize);
 
// Closing connection
mysql_close($link);
$returnval .= "maintenance on all tables in ".$db." finished successfuly\r\n\r\n";
}
 
return $returnval;
}
 
?>

goodnight sleep in geeks kinda way :)

Saturday, May 10th, 2008

this is a bash howto oneliner which after 45minutes or 2700seconds kills windows media player:

 $ sleep 45m;tskill $(ps -W|grep player|awk {'print$1'})

usefull for wmp, since it is missing the lack of “close automatically” functionalities. some player…

bash version: GNU bash, version 3.2.15(14)-release (i686-pc-cygwin)

saturday - from excel to mysql

Saturday, March 8th, 2008

Ha…

I was spending some hour today for transfering data from Excel file to MySQL. I decided to write VBA macro that will write a sqldump file for me since I had three worksheets of about 20K rows and some 5-10 columns each. And I had to fill that data in 4 different MySQL tabels. So LOAD DATA INFILE was really not an option.

Well the thing is that the task was really simple, but the stupid windows registry on my updated XP was driving me crazy. In VBA macro, I was receiving runtime errors when I was trying to use Scripting.FileSystemObject which I needed for making a file…

On anybody’s behalf, there is a command regsrv32.exe %windir%\system32\scrrun.dll which will register the Scripting.FileSystemObject in your registry and from there on, you can browse it your VBA macro editor from options->references to enable it in your procedure. Worked for me :)

Then Jan and me went for a lunch. That passed today’s hacking and the database is populated.

Now Samo is comming. My father got a son yesterday - and I got a step brother named Juš so we have to grab some beer :)

Bucket of 100 roses

And yes, HAPPY WOMEN’S DAY TO ALL WOMEN.
Especially to my Tanja. Roses are for you :*


Oh yes, I use and recomend Firefox 2

AJAXed with AWP