The time now is Mon 09 Dec 2019, 23:50
All times are UTC - 4 |
Author |
Message |
Billtoo

Joined: 07 Apr 2009 Posts: 3680 Location: Ontario Canada
|
Posted: Sun 18 Jul 2010, 21:23 Post subject:
Firewall status tray icon applet - firewallstate.0.6 Subject description: icewm |
|
tasmod wrote: | ver 0.6
Thanks to vovchik -
Should work in earlier versions. It checks for existence of DISTRO_SPECS if it is not found it defaults to '/etc/puppyversion' and returns that information. |
I downloaded version 0.6 and installed the pet, I was in icewm at the time and your pet didn't work.I switched to jwm and it does work now but it says version 0.5.
I also tried it in fatdog64 and it wouldn't work in jwm so I removed the pet in ppm.
Hope this helps
|
Back to top
|
|
 |
tasmod

Joined: 04 Dec 2008 Posts: 1462 Location: North Lincolnshire. UK
|
Posted: Mon 19 Jul 2010, 05:13 Post subject:
|
|
Version 0.7 released with new icons and dependency.
Billtoo, apologies for the version info return, I forgot to update that line in the code.
Slaps back of own hands, naughty boy.
I don't use icewm so I can't test that, Micko said it worked in Lucid 212 in icewm.
I have made a few changes to the code right now, so try ver0.7 and please report back.
fatdog64 I've no idea what it looks like!
Does the icon appear in tray?
Does it show a blank?
If you right click either icon or blank does the menu come up.
If it does, does Version information work?
If you run it from a terminal does it show any error message?
I'm aware that in a fresh install of slaxerpup it complains of missing libgio.
Small plans for v0.8
Return your own IP, country in use, language and keyboard.
Just ideas at moment, not yet made any code.
Edit: keyboard info done.
_________________ Rob
-
The moment after you press "Post" is the moment you actually see the typso 
Last edited by tasmod on Mon 19 Jul 2010, 05:42; edited 1 time in total
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8739 Location: qld
|
Posted: Mon 19 Jul 2010, 05:20 Post subject:
|
|
Still looks ok to me Rob in Icewm (oh and I fixed my Ice bug )
Cheers
Description |
|
Filesize |
72.66 KB |
Viewed |
1807 Time(s) |

|
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1512 Location: Ukraine
|
Posted: Mon 19 Jul 2010, 06:56 Post subject:
|
|
Dear Rob,
Works fine in 3.x and 4.x. Thanks for the nice work....
With kind regards,
vovchik
PS. I think you could safely add a desktop file (/usr/share/applications) to the pet and have it appear under Network. I did that manually and used you "OK" icon.
|
Back to top
|
|
 |
Billtoo

Joined: 07 Apr 2009 Posts: 3680 Location: Ontario Canada
|
Posted: Mon 19 Jul 2010, 09:05 Post subject:
Firewall status tray icon applet - firewallstate.0.7 Subject description: tests |
|
tasmod wrote: | Version 0.7 released with new icons and dependency.
Billtoo, apologies for the version info return, I forgot to update that line in the code.
Slaps back of own hands, naughty boy.
I don't use icewm so I can't test that, Micko said it worked in Lucid 212 in icewm.
I have made a few changes to the code right now, so try ver0.7 and please report back.
fatdog64 I've no idea what it looks like.
|
I booted luci-213 with prefix=ram
I installed your pet and it worked.
I downloaded icewm from puppy package manager after I updated ppm.
When I clicked on the icewm pet a screen popped up and I have attached a screenshot (icewm.jpeg) of that.
In fatdog 64 I installed your pet and restarted xserver.
I noticed a greater distance between blinky and the clipboard icons in the lower right corner.
I right clicked (may have been left I forget) over the area where the firewall applet should be.
The attachment (firewall.jpg) is a screenshot of that.
thanks
Description |
|

Download |
Filename |
firewall.jpg |
Filesize |
101.31 KB |
Downloaded |
1754 Time(s) |
Description |
|

Download |
Filename |
icewm.jpg |
Filesize |
70.18 KB |
Downloaded |
1605 Time(s) |
|
Back to top
|
|
 |
tasmod

Joined: 04 Dec 2008 Posts: 1462 Location: North Lincolnshire. UK
|
Posted: Mon 19 Jul 2010, 11:10 Post subject:
|
|
Version 0.8 released.
has added info to menu item 'Version information'
I'm working on an all C solution using curl for the IP reporting. Right now it runs a small script.
Billtoo,
Icewm
Yes, this report means libgio is missing.
Because I have so much installed on my machine it is hard to know what else is required for firewallstate to work for someone else.
You should be able to download it from package manager.
fatdog 64,
looks like a gtk version problem or tray is different
_________________ Rob
-
The moment after you press "Post" is the moment you actually see the typso 
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1512 Location: Ukraine
|
Posted: Mon 19 Jul 2010, 11:28 Post subject:
|
|
Dear Rob,
Version 0.8 introduces three unnecessary dependencies:
libkrb5support
libgssapi_krb5
lincurl_gnutls
There are easier ways to get the external IP, e.g.:
wget -qO- whatismyip.org
I would revert to the v. 0.7 way of doing things and add the above line in a system call for simplicity's sake.
With kind regards,
vovchik
|
Back to top
|
|
 |
tasmod

Joined: 04 Dec 2008 Posts: 1462 Location: North Lincolnshire. UK
|
Posted: Mon 19 Jul 2010, 14:51 Post subject:
|
|
vovchik, that is how it's done.
it may be that because I listed libgio as a dependency it is asking for them.
I have a CURL routine that is not working correctly, it won't write to the file. So as a temporary fix i made a call to an external bash script.
Code: | { /* Get your IP address from tmp file */
fp = (FILE *)popen("cat /tmp/ipis.txt | awk '{print $1}' " , "r" );
fgets(ipis,sizeof ipis,fp);
pclose(fp);
} |
script
Code: | #!/bin/bash
`wget -O /tmp/ipis.txt -q icanhazip.com`
echo "`cat /tmp/ipis.txt`" #A test |
_________________ Rob
-
The moment after you press "Post" is the moment you actually see the typso 
|
Back to top
|
|
 |
tasmod

Joined: 04 Dec 2008 Posts: 1462 Location: North Lincolnshire. UK
|
Posted: Mon 19 Jul 2010, 14:59 Post subject:
|
|
This is the CURL section that won't play ball, I'm sure I have something wrong in write_data
All this and two lines in bash does it :-
Code: |
/*//////////////////////////////////////////////////* For the CURL routine below */
static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
{
int written = fwrite(ptr, size, nmemb, (FILE *)stream);
return written;
}
///////////////////////////////////////////////////// Should run IP routine but doesn't write
*/
gboolean ISip(gpointer ptr);
gboolean ISip(gpointer ptr) { //Create file, write returned IP and then open file and read.
CURL *curl;
curl = curl_easy_init();
if(curl) {
fp =(FILE *) fopen("/tmp/ip.txt","w");
curl_easy_setopt(curl, CURLOPT_URL, "http://www.icanhazip.com");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
curl_easy_cleanup(curl);
fclose(fp);
}
{
fp =(FILE *) fopen("/tmp/ip.txt","r");
fgets(ipresult,sizeof ipresult,fp);
fclose(fp);
}
}
|
_________________ Rob
-
The moment after you press "Post" is the moment you actually see the typso 
|
Back to top
|
|
 |
tasmod

Joined: 04 Dec 2008 Posts: 1462 Location: North Lincolnshire. UK
|
Posted: Mon 19 Jul 2010, 15:06 Post subject:
|
|
Arghhhh, just realised I left the #include <curl/curl.h> in the code and I may have another lib missing so the curl won't work anyway.
Thanks vovchik, I will remake the pet.
_________________ Rob
-
The moment after you press "Post" is the moment you actually see the typso 
|
Back to top
|
|
 |
tasmod

Joined: 04 Dec 2008 Posts: 1462 Location: North Lincolnshire. UK
|
Posted: Mon 19 Jul 2010, 15:13 Post subject:
|
|
Version 0.9 with removed lib call and added Network IP to reporting
_________________ Rob
-
The moment after you press "Post" is the moment you actually see the typso 
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1512 Location: Ukraine
|
Posted: Mon 19 Jul 2010, 15:30 Post subject:
|
|
Dear Rob,
Yep, you got rid of the curl dependencies nicely and it all works except of the local IP, which is wrong. In my case it shows 192.168.1.0 as the local network, when, in actual fact, it is 192.168.2.x. Look at the way I did it in ipinfo - which you scrapped because it's not in all puppies. I also did another checkip prog
http://www.murga-linux.com/puppy/viewtopic.php?search_id=47152002&t=56678 that checks the entire local network, but you probably don't want to use that because it takes 45 secs to get all live IPs on a LAN (ping takes over 4 minutes!). However, there is probably a routine in it that just grabs the local machine IP expenditiously. I can't remember.
Nice work.
With kind regards,
vovchik
|
Back to top
|
|
 |
tasmod

Joined: 04 Dec 2008 Posts: 1462 Location: North Lincolnshire. UK
|
Posted: Mon 19 Jul 2010, 20:08 Post subject:
|
|
Hi vovchik,
Yes, I removed the ipinfo as I wasn't sure if it would work with earlier puppys. I also didn't want to force on someone another app in the pet, rather just make a call to it from code.
Network IP is not the machines own ip but the base ip of the router.
Seems no-one wants that.
OK I believe there is a list of connected pcs in /etc/hosts. However I can only print one so far to the Version Information , I'm not sure yet how to make additional lines display, all calls stop at single line when newline is met in the array. i need to trap them out then re-insert during display.
I've been working on that one but for now was happy to just have a working app.
Micko reports that the report-video just flashes on briefly in the luci version. I can't get it to do that, it works for me.
_________________ Rob
-
The moment after you press "Post" is the moment you actually see the typso 
|
Back to top
|
|
 |
big_bass
Joined: 13 Aug 2007 Posts: 1742
|
Posted: Mon 19 Jul 2010, 22:52 Post subject:
|
|
vovchick you posted this on the other page I like that
Code: |
#!/bin/sh
myfile="$@"
gcc `pkg-config --cflags --libs gtk+-2.0` -o "$myfile" "$myfile".c
strip "$myfile" |
I had some fun with it and added a little cream to your strawberry dessert
you can compile the c code in this thread with it
Code: |
#!/bin/sh
# drag N drop c compiler
# gcc compiler flags config by vovchick
# file filters , Xdialog and gcc version checking by big_bass
# 7-19-2010
MY_CFILE="$@"
DIR_N=`dirname "$@"`
MY_FILE=`basename "$@" .c`
#check gcc version
gcc_version=`gcc -dumpversion`
Xdialog --title "gcc version" \
--infobox "\ngcc version $gcc_version\n" 0 0 2000
if echo `basename "$@"` | grep -q '.c$'; then
Xdialog --wrap --title "COMPILE" \
--yesno "Do you want to compile $@ " 0 0
case $? in
0)
echo "Yes chosen."
gcc `pkg-config --cflags --libs gtk+-2.0` -o "$DIR_N"/"$MY_FILE" "$MY_CFILE"
strip "$DIR_N/$MYFILE"
;;
1)
echo "No chosen."
exit
;;
255)
echo "Box closed."
exit
;;
esac
Xdialog --title "Complete" \
--infobox "\nConversion to $MY_FILE bin has finished.\n" 0 0 4000
else
Xdialog --title "ERROR MESSAGE drag N drop" \
--msgbox "only C code allowed " 0 0
case $? in
0)
echo "OK"
exit
;;
255)
echo "Box closed."
exit
;;
esac
fi
|
 |
Description |
|

Download |
Filename |
c-compiler.tar.gz |
Filesize |
652 Bytes |
Downloaded |
1093 Time(s) |
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1512 Location: Ukraine
|
Posted: Tue 20 Jul 2010, 03:24 Post subject:
|
|
Dear Joe,
Thanks....
I like that.
With kind regards,
vovchik
|
Back to top
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|