nav-left cat-right
cat-right

Disable deprecation of functions

When using old functions in MFC which happens quite easily when one imports old VS6 examples or has to use old projects one gets this warning quite often: warning C4996: ‚fopen‘: This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. c:\programme\microsoft visual studio 8\vc\include\stdio.h(234): Siehe Deklaration...

Installation of openSuse 10.2

Note: A similar description can be found at Pimp my Suse. [TOC] Installation The Installation worked mainly as usual. It only failed at writing grub into the MBR, which is absolutely unacceptable. I had to install an option for the boot loader in an older distribution (10.1) to get 10.2 started. After that everything worked again as expected. Grub The reasons for grub not working could be found in /boot/grub/device.map,...

Restore some configuration files

Sometimes I do not want to reuse my old $HOME/.kde folder completely or other hidden folders after I reinstalled the operating system. In this case I want to copy only selected folders and file to the new $HOME. This script does most of the necessary copy operations for me: CopyConfigFiles.script #!/bin/bash   # --------------------------------------------------------- # copy_and_backup_Files () { COPY=$3...

Local network shares with linux

[TOC] NFS shares First NFS needs to be activated (client and server), then we can start with the configuration files. Configuration files The exported shares are listed in /etc/exports /home/links/Musik/ 192.168.2.0/255.255.255.0(ro,root_squash,sync) /home/links/Install/ 192.168.2.0/255.255.255.0(ro,root_squash,sync) /home/matthias/ 192.168.2.0/255.255.255.0(rw,root_squash,sync) /home/sarah/...

shell: is the device mounted ?

The following function allows to test if a device is already mounted. #!/bin/sh # --------------------------------------------------------- # function is_mounted () { # 1. mount aufrufen. # 2. Mit grep Zeile mit $MOUNTDIR ausfiltern. # 3. Anzahl der Zeilen zaehlen. # 4. Alle Leerzeichen entfernen. # Wenn eine Zeile vorhanden war, ist der Wert von RETURN 1   MOUNTDIR=$1 TESTVALUE=$(mount | grep $MOUNTDIR...

shell: does the server exist ?

The following function allows to test for the existens of a server in the network via ping, but with a better interface #!/bin/sh   # --------------------------------------------------------- # function server_exists () { # ping Optionen: # -c : Anzahl von pings # -n : nur numerisch, keine DNS Abfragen TESTSERVER=$1 if (ping -c 1 -n -w 2 $TESTSERVER > /dev/null 2>&1) ; then # echo...

bash: Copy everthing except …

If you want to copy multiple files, keep the permission, and want to exclude multiple files from being copied this can be done with the following code: tar cp --exclude-from=$EXCLUDE $FROMDIR | (cd $DESTDIR ; tar xpv)tar cp --exclude-from=$EXCLUDE $FROMDIR | (cd $DESTDIR ; tar xpv) $EXCLUDE contains the file that contains the folders and files that shall be exluded. It can be created and filled with...

Find the programm, that prohibits the unmounting o...

The simple solution is the command „lsof“ which means „list of files“, invoked with lsof /dev/hdclsof /dev/hdc if /dev/hdc is the cdrom would give the list of files and programs which prohibit...