rkhunter Warnigns Debian Lenny

28. Juli 2010

Unter lenny kommen einige Fehler von vorhinein.
Um dies zu vermeiden folgende schritte ausführen:

rkhunter –propupd

in der /etc/rkhunter.conf

folgende einträge ändern:

DISABLE_TESTS=”suspscan deleted_files packet_cap_apps”

zu

DISABLE_TESTS=”suspscan deleted_files packet_cap_apps  apps promisc”

UPC Nagios SNMP Wrapper Bash Scripts

27. Juli 2010

Wrapper muss im selben verzeichnis wie check_snmp liegen

/usr/lib/nagios/plugins/


#!/bin/sh
CHECK_SNMP="`dirname $0`/check_snmp"
if [ ! -x $CHECK_SNMP ]; then
 echo "UNKNOWN: Cannot find check_snmp plugin"
 exit 3
fi
#echo `$CHECK_SNMP "$@"`
BUFFER=`$CHECK_SNMP "$@"`
#2>&1`
RETURN=$?

MODUS=`echo $BUFFER | cut -d" " -f4`

case "$MODUS" in

2) echo "$MODUS - On Line " ;;
3) echo "$MODUS - On Battery " ;;
4) echo "$MODUS - On Smart Boost" ;;
5) echo "$MODUS - Timed Sleeping";;
6) echo "$MODUS - Software Bypass" ;;
7) echo "$MODUS - Off" ;;
8) echo "$MODUS - Rebooting" ;;
9) echo "$MODUS - Switched Bypass" ;;
10) echo "$MODUS - Hardware Failure Bypass" ;;
11) echo "$MODUS - Sleeping Until Power Returns" ;;
12) echo "$MODUS - On Smart Trim" ;;

esac

exit $RETURN
define command{
 command_name    check_snmp_usv_bat_mode
 command_line    $USER1$/snmp_usv_change -H $HOSTADDRESS$ -C $USER5$ -o .1.3.6.1.4.1.318.1.1.1.4.1.1.0 -c $ARG1$
}
#2 = On Line -> Aufgeladen</pre>
#3 = On Battery
#4 = On Smart Boost
#5 = Timed Sleeping
#6 = Software Bypass
#7 = Off
#8 = Rebooting
#9 = Switched Bypass
#10 = Hardware Failure Bypass
#11 = Sleeping Until Power Returns
#12 = On Smart Trim
define service{
 host_name                       com200
 service_description             USV Battery Mode
 check_command                   check_snmp_usv_bat_mode!1
 max_check_attempts              1
 normal_check_interval           1
 retry_check_interval            1
 check_period                    24x7
 notification_interval           120
 notification_period             24x7
 notification_options            w,u,c,r,f,s
 contact_groups                  admins
}

Ein raum voller Tanzender Nao Robots

30. Juni 2010

Wirklich beeindruckendes Video. NAO roboter sind wirklich teuer. Aber irgendwann hab ich eine ganzen schwarm der meinen befehlen folgt. (Hab ich mal geträumt ^^)

BRN Videos

30. Juni 2010

Bunte Republik Neustadt – Teil 1 Balkan Beats from Roque allstar on Vimeo.

Bunte Republik Neustadt – Teil 2 Sapid Steel with Dirty Deeds from Roque allstar on Vimeo.

Videos von: http://vimeo.com/roqueallstar
Kamera Canon 500d, Objektiv: 50mm f1.4

Meine BRN 2010 Highlights

20. Juni 2010

Freitag: The Ukrainiens

Danach ging mit mir nicht mehr viel. Hatte Blaue flecken, schmerzende Füße und ne Staublunge. Mehr Infos hier

Samstag: Konrad Küchenmeister

M.I.A, Born Free

3. Mai 2010

M.I.A, Born Free from ROMAIN-GAVRAS on Vimeo.

Latex Diplom Vorlage

17. Februar 2010

Latex Diplom Vorlage Download

PDF Vorschau

Original von dieser Webseite: http://www.scharrer-online.de/latex/diplomvorl.shtml

Diese Vorlage war aber schon veraltet und man musste einiges ändern, damit sie mit z.B. TexNicCenter übersetzt werden konnte.

Inwieweit diese den Standards entspricht kann ich nicht beurteilen.

Die benötigten Packete in MikTex Package Browser nachinstallieren

OpenCL testfiles in nem projekt

18. Januar 2010

http://herox.net/tmp/opencl_tryout.tar.gz

starten mit:

make
make examples
cd examples
./main

oder ./main2

oder ./helloMulti

;)

OpenCL C++ Multiple GPU Hello World example

18. Januar 2010

Simple OpenCL C++ example for computing the square on all GPUs
You can find the header file here: here

main.cpp

/*
 * gtx 280
 * tesla c1060
 */
#define __CL_ENABLE_EXCEPTIONS
//#define __NO_STD_VECTOR
//#define __NO_STD_STRING

#include
#include
#include
#include
#include "cl.hpp"

const unsigned int BLOCK_N = 512;
const unsigned int THREAD_N = 512;
const unsigned int ACCUM_N = BLOCK_N * THREAD_N;

class Source
{
public:

	Source( const char* filename )
	: m_size(0),
	  m_source(0)
	{
		std::ifstream file( filename,
                            std::ios::in | std::ios::binary | std::ios::ate );
		if( file.is_open() ) {
			m_size = size_t(file.tellg()) + 1;
			m_source = new char[m_size];
			file.seekg( 0, std::ios::beg );
			file.read( m_source, m_size-1 );
			file.close();
			m_source[m_size-1] = '\0';
		}
	}

	virtual ~Source()
	{
		if( m_source ) delete [] m_source;
	}

	const char* get()
	{
		return m_source;
	}

	std::pair&lt; char*, size_t &gt; getPair()
	{
		return std::make_pair( m_source, m_size );
	}

	size_t size()
	{
		return m_size;
	}

private:

	size_t m_size;
	char*  m_source;

};

int main( int argc, char** argv )
{

	unsigned int count = 65536;
	size_t memSize = sizeof(float)*count;

	float data[count];
	float results[count];

	for( unsigned int i=0; i &lt; count; ++i )
		data[i] = rand()/(float)RAND_MAX;

	Source source("square.cl");
	std::cout &lt;&lt; source.get();

	try {
		cl::Context context( CL_DEVICE_TYPE_GPU );

		std::vector devices = context.getInfo();
		std::cout &lt;&lt; "I Found " &lt;&lt; devices.size() &lt;&lt; " OpenCL devices" &lt;&lt; std::endl;

		cl::Program::Sources clsource( 1, source.getPair() );
		cl::Program program( context, clsource );
		program.build( devices );

		cl_event GPUDone[devices.size()];

	std::vector queues(devices.size());
	cl::Buffer input[devices.size()];
        cl::Buffer output[devices.size()];
	cl::Kernel kernel[devices.size()];
	size_t localSize[devices.size()];

	int sizePerGPU = count / devices.size();
	int workOffset[devices.size()];
   	int workSize[devices.size()];

    	size_t localWorkSize = {THREAD_N};
    	size_t globalWorkSize = {ACCUM_N};

    	workOffset[0] = 0;
   for(unsigned int i = 0; i &lt; devices.size(); ++i )
   {
		workSize[i] = (i != (devices.size() - 1)) ? sizePerGPU : (count - workOffset[i]);

		queues[i] = cl::CommandQueue( context, devices[i] );

		input[i] = cl::Buffer(context, CL_MEM_READ_ONLY, workSize[i] * sizeof(float));
		output[i] = cl::Buffer(context, CL_MEM_WRITE_ONLY, workSize[i] * sizeof(float));

		queues[i].enqueueWriteBuffer( input[i], CL_TRUE, 0, workSize[i] * sizeof(float) , &amp;data[workOffset[i]] );

		kernel[i] = cl::Kernel( program, "square" );

		localSize[i] = kernel[i].getWorkGroupInfo&lt; CL_KERNEL_WORK_GROUP_SIZE &gt;(devices[i] );

		cl::KernelFunctor func = kernel[i].bind(
				queues[i],
				cl::NDRange(globalWorkSize),
				cl::NDRange(localWorkSize) );

		func( input[i], output[i], workSize[i] ).wait();

		queues[i].enqueueReadBuffer( output[i], CL_TRUE, 0, workSize[i] * sizeof(float), &amp;results[workOffset[i]] );

		if(i==devices.size()-1)
			break;
		else
       			workOffset[i + 1] = workOffset[i] + workSize[i];

}

	} catch( cl::Error error ) {

		std::cerr
			&lt;&lt;"ERROR: "
			&lt;&lt; error.what()
			&lt;&lt; "("
			&lt;&lt; error.err()
			&lt;&lt; ")"
			&lt;&lt; std::endl;
	}

	unsigned int correct = 0;
	for( unsigned int i = 0; i &lt; count; ++i ) {
		if( results[i] == data[i]*data[i] )
			++correct;
	}

	std::cout &lt;&lt; "Computed " &lt;&lt; correct &lt;&lt; "/" &lt;&lt; count;
	std::cout &lt;&lt; " correct values." &lt;&lt; std::endl;

	return 0;
}

kernel:
square.cl

A simple kernel:
__kernel void square(
        __global float* input,
        __global float* output,
        const unsigned int count
)
{
        const size_t id = get_global_id(0);
        if( id < count )
                output[id] = input[id]*input[id];
}
<pre>

OpenCL C++ HelloWorld example

13. Januar 2010

Simple OpenCL C++ example for computing the square on one GPU
You can find the header file here: here
main.cpp

* gtx 280
* tesla c1060
*/

#define __CL_ENABLE_EXCEPTIONS
//#define __NO_STD_VECTOR
//#define __NO_STD_STRING

#include
#include
#include
#include
#include "cl.hpp"

class Source
{
public:

Source( const char* filename )
: m_size(0),
m_source(0)
{
std::ifstream file( filename,
std::ios::in | std::ios::binary | std::ios::ate );
if( file.is_open() ) {
m_size = size_t(file.tellg()) + 1;
m_source = new char[m_size];
file.seekg( 0, std::ios::beg );
file.read( m_source, m_size-1 );
file.close();
m_source[m_size-1] = '\0';
}
}

virtual ~Source()
{
if( m_source ) delete [] m_source;
}

const char* get()
{
return m_source;
}

std::pair&lt; char*, size_t &gt; getPair()
{
return std::make_pair( m_source, m_size );
}

size_t size()
{
return m_size;
}

private:

size_t m_size;
char*  m_source;

};

int main( int argc, char** argv )
{

unsigned int count = 1024;
size_t memSize = sizeof(float)*count;

float data[count];
float results[count];

for( unsigned int i=0; i &lt; count; ++i )
data[i] = rand()/(float)RAND_MAX;

Source source("square.cl");
std::cout &lt;&lt; source.get();

try {

cl::Context context( CL_DEVICE_TYPE_GPU );

std::vector devices = context.getInfo();

cl::Program::Sources clsource( 1, source.getPair() );
cl::Program program( context, clsource );
program.build( devices );

cl::CommandQueue queue( context, devices[0] );

cl::Buffer input( context, CL_MEM_READ_ONLY, memSize );
cl::Buffer output( context, CL_MEM_WRITE_ONLY, memSize );

queue.enqueueWriteBuffer( input, CL_TRUE, 0, memSize, data );

cl::Kernel kernel( program, "square" );

//kernel.setArg( 0, input );
//kernel.setArg( 1, output );
//kernel.setArg( 2, count );

size_t localSize = kernel.getWorkGroupInfo&lt; CL_KERNEL_WORK_GROUP_SIZE &gt;(
devices[0] );

cl::KernelFunctor func = kernel.bind(
queue,
cl::NDRange(count),
cl::NDRange(localSize) );

func( input, output, count ).wait();

queue.enqueueReadBuffer( output, CL_TRUE, 0, memSize, results );

} catch( cl::Error error ) {

std::cerr
&lt;&lt;"ERROR: "
&lt;&lt; error.what()
&lt;&lt; "("
&lt;&lt; error.err()
&lt;&lt; ")"
&lt;&lt; std::endl;

}

unsigned int correct = 0;
for( unsigned int i = 0; i &lt; count; ++i ) {
if( results[i] == data[i]*data[i] )
++correct;
}
std::cout &lt;&lt; "Computed " &lt;&lt; correct &lt;&lt; "/" &lt;&lt; count;
std::cout &lt;&lt; " correct values." &lt;&lt; std::endl;

return 0;
}

A simple kernel:

__kernel void square(

        __global float* input,

        __global float* output,

        const unsigned int count

)
{

        const size_t id = get_global_id(0);

        if( id &lt; count )

                output[id] = input[id]*input[id];

}