Monthly Archives: July 2009

Backup / restore PostgreSQL database

To backup / dump entire DB (database cluster), use the following command: pg_dumpall > outfileor with username and gzipped pg_dumpall -U postgres | gzip > db_backup.gz-U usename – connect as specified database user To restore from dump file “db_backup” use: … Continue reading

Posted in Databases | Tagged , | Leave a comment

STL breaks after installing Microsoft Security Advisory 973882

After installing through Microsoft Update Vulnerabilities in Microsoft Active Template Library (ATL) Could Allow Remote Code Execution STL broke with the following error: c:\program files\microsoft visual studio 9.0\vc\include\xutility(2764) : error C3861: ‘_Swap_adl’: identifier not found Most probably, this is caused … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Batch script to test if folder / directory is empty

Yesterday I needed a Dos batch script to check if folder is empty. A little Google search revealed some methods: Using dir and find commands, does not work on non-english Windows versions: www.computing.net Using dir command with /a-d, does not … Continue reading

Posted in OS, Programming | Tagged , , , , , | 13 Comments

Join (merge / concatenate) split files: Windows or Linux

Sometimes you have to join two files together. There are plenty of tools for file spitting and joining (restoring), but I prefer the build in ones. Use copy command under Windows: copy /B file1.ext + file2.ext result_file.ext “B” stands for … Continue reading

Posted in OS | Tagged , | Leave a comment

My Linux command quick reference

My day-to-day job does not involve Linux, so I made a command reference for me. Some useful nix commands: list directory contents ls list directory contents wish permissions, dates, size, etc. ls -l print (name of) working directory pwd text … Continue reading

Posted in OS | Tagged , | Leave a comment

Ubuntu Server static ip problems – ubuntu reverts back to DHCP on its own

Many people report that Ubuntu Server suddenly reverts its static IP address to dynamic (via DHCP). Here are some discussions: static ip reverts back to DHCP (ubuntuforums.org). Static IP reverting to DHCP on Ubuntu Server 8.04 (www.howtogeek.com). This happened to … Continue reading

Posted in OS | Tagged , , , | Leave a comment

How to change Ubuntu Server from dynamic address (DHCP) to a static IP address?

You need to change addresses into following files: /etc/network/interfaces /etc/resolv.conf The following article from www.howtogeek.com prefers vi editor, but I use nano editor. sudo nano /etc/network/interfaces change to something like this iface eth0 inet static      address 192.168.1.5      netmask 255.255.255.0      network … Continue reading

Posted in OS | Tagged , , , | Leave a comment