dracoblue.net

Add Google Analytics (Tracking) to Redmine

Today I added some google analytics tracking to my redmine at

dev.webdevberlin.com.

This was pretty easy, open:

app/views/layouts/base.rhtml

Search for the

-tag and add the given code (from analytics page) before the tag.

You don't even need to restart your redmine.

Should work pretty much the same for all other tracking services!

In by DracoBlue @ 17 Apr 2009 | 60 Words

Online tool to autoindent Pawn-Code

Just a quick note, that I made one of my web-scripts available to everyone at TidyPawn.

I use TidyPawn usally to autoindent loosly formated pawn code.

In pawn by DracoBlue @ 11 Apr 2009 | 27 Words

DFairPlay Query-Server API

The dfairplay main servers, have a http-GET-based query system, which can be used by servers to check for unfair players. <!--more--> This article is pretty technically, because it's about the API.

If you want to access the API directly (without using one of the interfaces, like e.g.

filterscript for samp servers) you will have to query the following url:

http://dfairplay-query.webdevberlin.com

this is the root, and should be prepended to all following examples.

All calls are made in the following scheme:

/[strong]function_name[/strong]/param1/param2/.../

In the following documentation I'll use some wildcards:

  • %token% The token received by a previous create_session call.
  • %game% The game the server is for, currently it can be only "gtasa-samp".

Free functions (no token required):

  • /create_session/%game%/ Retruns a string, the token of the session. This token must be renewed after at least 300 seconds by any call requiring it, or by using the ping-function.
  • /is_alive/ Returns 1. Is just for checking if the server is there and working :).

Restricted functions (token required):

  • /ping/%token%/ Refreshs a timeout for a session. Retruns 1.
  • /destroy_session/%token%/ Destroys a session. Retruns 1 on success else 0.
  • /add_user/%token%/id/ip/ Adds a user with the corrosponding id (on the samp server) and her ip to the server. Influcens the result of the get_incidents function. Retruns 1 if the user is using dfairplay or 0 if she does not!
  • /delete_user/%token%/id/ Removes a player from the servers session. Retruns 1 on success else 0.
  • /delete_user/%token%/id/ Removes a player from the servers session. Retruns 1 on success else 0.
  • /get_incidents/%token%/ Returns a ","-seperated list of player-ids (on the samp server), which have matching incidents.

Usage You'll mostly find your self using adduser to check if the player has dfairplay installed and deleteuser to remove it. If you do that on every connect/disconnect you can safely use get_incidents to find all players which have reported incidents while dfairplay installed!

Error-Codes

All functions may return these error codes:

 1 = true
 0 = false
-1 = function not found
-2 = incorrect parameter count
-3 = invalid parameter
-4 = session expired 

In api, dfairplay by DracoBlue @ 07 Apr 2009 | 386 Words

Mounting SSH/SFTP Remote Folders in Eclipse

If you are using windows as operating system and want to access files available on unix-based remote file systems, you have only limited amount of options. In case you are using Eclipse as development environment, we'll have a look at an alternative, which does not use samba-shares.

A nice option is the plugin

Target Management (RSE). It allows you to add any remote systems to the remote file system explorer.

Once RSE is installed, you are able to add a folder (like you did before) but link it to local or RSE location. Select RSE and choose the path on your remote system!

In eclipse, open source by DracoBlue @ 01 Apr 2009 | 105 Words

Fixing compiling issues with magnet.c

Jan Kneschke maintains lighttpd and posted a simple FCGI for lua. This magnet.c should be easily compiled with

 gcc -Wall -O2 -g -o magnet magnet.c -llua5.1 -lfcgi -ldl -lm

This may not work if your lua-include is not in the path for compiling.

And you'll run into such error messages:

magnet.c:3:20: error: lualib.h: No such file or directory
magnet.c:4:21: error: lauxlib.h: No such file or directory
magnet.c:11: Error: expected »)« before »*« token
magnet.c:19: Error: expected »)« before »*« token
magnet.c:59: Error: expected »)« before »*« token

Since you may not be used to compiling, I think it might be good to post a reason for that and a solution.

The reason is, that lualib.h is not in include path. To add it specific folder for the compiling to the include path you may use the

-I /path/name/ parameter.

 gcc -Wall -O2 -g -o magnet magnet.c [strong]-I/usr/include/lua5.1/[/strong] -llua5.1 -lfcgi -ldl -lm
There are some distributions, where the -llua5.1 may not work and result in cannot find -llua5.1. In this cases try -llua instead.

Have fun compiling!

In lua, open source by DracoBlue @ 19 Mar 2009 | 199 Words

Page 25 - Page 26 - Page 27

Give something back

Were my blog posts useful to you? If you want to give back, support one of these charities, too!

Report hate in social media Campact e.V. With our technology and your help, we protect the oceans from plastic waste. Gesellschaft fur Freiheitsrechte e. V. The civil eye in the mediterranean

Recent Dev-Articles

Read recently

Recent Files

About