Dynamic-Sig.com BETA Powered by:
September 10, 2010, 05:46:54 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Don't forget that you need to download our client program to be able to use your signature image. Click here to download the client program.
 
  Home   Forum   Help Search Login Register About Dynamic-Sig.com  
Pages: [1]
  Print  
Author Topic: Show OS Info?  (Read 1545 times)
xMoDx
Newbie
*
Posts: 1


View Profile Email
« on: May 19, 2007, 08:54:29 AM »

XP, ME, 98 , Vista  perhaps??? any patch on sig that will display these?
Logged
Daniel15
Owner of this site :D
Administrator
Jr. Member
*****
Posts: 96

208646779
View Profile WWW
« Reply #1 on: July 07, 2007, 08:59:56 PM »

I may implement something soon (since I'll be implementing a Linux client one day) Smiley.
Logged

Jacen
Newbie
*
Posts: 25


View Profile Email
« Reply #2 on: July 08, 2007, 02:38:36 PM »

Not trying to rush you or anything, but how close is the linux client to being ready?
Logged



Daniel15
Owner of this site :D
Administrator
Jr. Member
*****
Posts: 96

208646779
View Profile WWW
« Reply #3 on: July 08, 2007, 05:05:47 PM »

The Linux client was actually a PHP script I was working on just to see how well it would work Smiley. It's not really finished, as I never got around to finishing it. Here's the most recent copy of the script:
sigclient.php:
Code:
#!/usr/bin/php
<?php
/**************************************************************\
|    Dynamic-Sig.com Signature Client - PHP Linux version      |
| (c) 2007 DanSoft Australia - http://www.dansoftaustralia.net |
\**************************************************************/

define('CLIENT''PHP Linux Client');
define('VERSION''0.1 Beta');
define('SIG_SERVER''http://www.dynamic-sig.com/updateSig.php');

// Get our configuration
$config parse_ini_file('sigclient.conf');

// Start with blank array.
$data = array();

// --- Uptime ---
$seconds = (float) file_get_contents('/proc/uptime');
// Some numbers
$secs intval($seconds 60);
$mins intval($seconds 60 60);
$hours intval($seconds 3600 24);
$days intval($seconds 86400);

if (
$days 0)
{
$uptimeString .= $days;
$uptimeString .= (($days == 1) ? ' day' ' days');
}

if (
$hours 0)
{
$uptimeString .= (($days 0) ? ', ' '') . $hours;
$uptimeString .= (($hours == 1) ? ' hour' ' hours');
}

if (
$mins 0)
{
$uptimeString .= (($days || $hours 0) ? ', ' '') . $mins;
$uptimeString .= (($mins == 1) ? ' minute' ' minutes');
}

if (
$secs 0)
{
$uptimeString .= (($days || $hours || $mins 0) ? ", " "") . $secs;
$uptimeString .= (($secs == 1) ? ' second' ' seconds');
}
$data['uptime'] = $uptimeString;

// --- Memory stuff ---
// !!! There must be a better way to do this!
$meminfo = array();
preg_match(
'/MemTotal: +(?P<totalram>[0-9]+) kB
MemFree: +(?P<availram>[0-9]+) kB/'
file_get_contents('/proc/meminfo'), $meminfo);

// Convert kilobytes to bytes.
$data['totalram'] = ($meminfo['totalram'] * 1024);
$data['availram'] = ($meminfo['availram'] * 1024);

// --- Network interface stuff ---
// !!! Use ifconfig instead?
$matches = array();
$temp file_get_contents('/proc/net/dev');
// Get the line for the current network device
preg_match('/' $config['network_interface'] . ':(.+)' "\n/"$temp$matches);
$temp $matches[1];
// Split it up
$matches preg_split('/\s+/'trim($temp));
// Get the amount received
$data['netReceived'] = $matches[0];
$data['netSent'] = $matches[8];

// -----------------------------------------------------------------------------

// Now, time to send the data off :).
// !!! Rewrite this so it doesn't use cURL?
// Open the Curl session.
$session curl_init(SIG_SERVER);
curl_setopt($sessionCURLOPT_HEADERfalse);
curl_setopt($sessionCURLOPT_RETURNTRANSFERtrue);

// The POST variables we send to the update script.
$postvars 'client=' CLIENT '&version=' VERSION '&username=' $config['username'] . '&password2=' sha1(strtolower($config['username']) . $config['password']) . '&timezone=' $config['timezone'];

// Loop through all our data.
foreach ($data as $key => $value)
// Add this as a POST variable.
$postvars .= '&' $key '=' $value;

curl_setopt ($sessionCURLOPT_POSTtrue);
curl_setopt ($sessionCURLOPT_POSTFIELDS$postvars);

// Make the call.
$return curl_exec($session);
curl_close($session);
if (
strpos($return'ERROR') === FALSE)
echo 'Server returned: ' $return "\n";
else
fwrite(STDERR'Error encountered: ' $return "\n");
?>


sigclient.conf:
Code:
; Configuration file for Dynamic-Sig.com client

; Your username on Dynamic-Sig.com
username = test2
; Your password
password = test

; Your timezone
timezone = 10
; Your network interface (eg. eth0)
network_interface = eth0

I have not tested this script since April, but it should work. It requires PHP 4.3.0 or higher (including PHP 5) and the cURL extension to be installed. Change the settings in the configuration file, set the file to executable (chmod +x sigclient.php in a console), and then run the script (./sigclient.php in a console). To have it update every so often, you'd need to add a cronjob for it.

Please tell me whether this works for you, and whether I should continue development (and finish it) Smiley.

Edit: Oh yeah, any comment line with a !!! at the start of it is a "To do" line (like in the SMF code). It's a note for me, basically Smiley
« Last Edit: July 08, 2007, 05:07:27 PM by Daniel15 » Logged

Jacen
Newbie
*
Posts: 25


View Profile Email
« Reply #4 on: July 09, 2007, 02:00:34 AM »

Not able to test it yet  as I have PHP installed as a modual, so the script refused to run

EDIT: Nevermind about the password thing. I'll let you know how the script goes here

Quote
   With PHP you can also write desktop GUI applications using the PHP-GTK
   extension. This is a completely different approach than writing web
   pages, as you do not output any HTML, but manage Windows and objects
   within them. For more information about PHP-GTK, please visit the site
   dedicated to this extension. PHP-GTK is not included in the official
   PHP distribution.
From the INSTALL file of the PHP source. Nice Tongue

EDIT: Finally got curl working, but now it takes forever to do anything, sticking to a blank line. Is that supposed to happen?
« Last Edit: July 09, 2007, 03:04:55 AM by Jacen » Logged



Daniel15
Owner of this site :D
Administrator
Jr. Member
*****
Posts: 96

208646779
View Profile WWW
« Reply #5 on: July 09, 2007, 02:06:44 PM »

Quote
From the INSTALL file of the PHP source. Nice
Yeah, I've played around with making GUIs in Glade and then using them in PHP scripts Cheesy

Quote
EDIT: Finally got curl working, but now it takes forever to do anything, sticking to a blank line. Is that supposed to happen?
It shouldn't take that long... Do the updates actually work? How long do they take?
Logged

Jacen
Newbie
*
Posts: 25


View Profile Email
« Reply #6 on: July 09, 2007, 02:29:43 PM »

No, the updates don't seem to work (the sig image stays the same) and it takes about a minute or two, then I ctrl-c it.

EDIT: Ya know, this script would be slightly better if you can make an interface (one that can stay in the system tray or something) and autoupdates like the windows one. I personally don't know how to use cron Tongue
« Last Edit: July 09, 2007, 02:56:29 PM by Jacen » Logged



Blaster
Jr. Member
**
Posts: 85


View Profile
« Reply #7 on: July 26, 2007, 03:04:00 PM »

Hmm now thats an idea. I like that idea. Also can't wait for a linux friendly version
Logged

First person to test out a dynamic sig... before this site was even up.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Dynamic-Sig.com version 0.6 ©2006–2007 Daniel15.
Valid XHTML 1.0! Valid CSS!
Page created in 0.047 seconds with 14 queries.