Windows: Remove files permanently from your hard drive

In Windows system the „delete” operation only removes bits of information from files.

Bellow applications can permanently remove files from your hard drive without the possibility of their later recovered.

Eraser (GNU) – http://eraser.heidi.ie/
File Shredder (freeware) – http://www.fileshredder.org/
Sys Internals (freeware) – http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx

7-zip: Command Line

7za.exe is open source program used to compress, extract, and update files through the command line.

1) Download and install 7-zip
2) Put 7z.exe file in your directory.

Archive type
-t7z – archive.7z (default option)
-tgzip – archive.gzip, archive.gz
-tzip – archive.zip (compatible)
-tbzip2 – archive.bzip2
-ttar – tarball.tar (UNIX and Linux)
-tiso – image.iso
-tudf – disk.udf

Encrypt archive
7z a archive.7z secure_folder -pSECRET

PPMd is an extraordinary algorithm for compressing text
7z a -t7z archive.7z documents -m0=PPMd

List the contents of archives
7z l archive.7z

Test the integrity of archives
7z t archive.7z

Update archive
7z u archive.zip

Update archive (replace only doc files)
7z u archive.zip *.doc

The optimization settings
-mx0: Don’t compress at all. This is called „copy mode.”
-mx1: Low compression. This is called „fastest” mode.
-mx3: Fast compression mode. Will automatically set various parameters.
-mx5: Same as above, but „normal”.
-mx7: This means „maximum” compression.
-mx9: This means „ultra” compression. You probably want to use this.

Case-insensitive file names
7z a archive.7z case_sensitive -ssc

Example
Save below text in 7.bat.
C:\Users\Robert\Desktop\7zip\7z.exe a -t7z C:\Users\Robert\Desktop\7-zip\%DATE%.7z C:\Users\Robert\Desktop\7zip\7zip\dane

Then add to Task Scheduler
C:\Users\Robert\Desktop\7zip\7z.exe a -t7z C:\Users\Robert\Desktop\7-zip\%DATE%.7z C:\Users\Robert\Desktop\7zip\7zip\dane

Postgres: basic command

As root you can login as postgres without password.

First login as root, then login as postgres
user@debian$ su
root@debian# su – postgres
postgres@debian:~$

List all databases
postgres@debian:~$ psql -l

Dump database
postgres@debian:~$ pg_dump db_name > outfile
or with compress
postgres@debian:~$ pg_dump dbname | gzip > filename.gz

Restore database
postgres@debian:~$ psql db_name < infile or postgres@debian:~$ psql --set ON_ERROR_STOP=on db_name < infile Dump all databases
postgres@debian:~$ pg_dumpall > outfile

Restore all databases
postgres@debian:~$ psql -f infile postgres

Create database
root@debian:~# su – postgres

root@debian:~# createdb db_name
or
root@debian:~# createdb -O role_name db_name

Create database from postgres shell
root@debian:~# su – postgres
postgres@debian:~$ psql

postgres=# CREATE DATABASE db_name;
or
postgres=# CREATE DATABASE dbname OWNER rolename;

postgres=# \q

Change user password
psql
alter user user_name with password ‚new_password’;

Exit from postgres shell
postgres=# \q

HP Pavilion g6: System Recovery – Windows 8

1) Press the power button and immediately tap the Esc key.
2) In the menu choose F11.
3) Choose Language
4) Choose keyboard
5) Solve problems
6) Recovery Manager
7) Windows 8
8) Recovery minimal image
9) Choose one option:
– Recovery your data
– Without Recovery your data
10) Click Next
11) Please wait untill procss finished.
– do not dicconect the power
– do not connect external devices
12) Process will:
– format partitions
– Copy information required to recover hard disk
– recover system files