![]() |
Re: Desktop Command Execution Widget scripts
Many new battery scripts had been added to the wiki. Also, don't forget about DCEW wiki page, scripts are constantly being added and improved.
|
Re: Desktop Command Execution Widget scripts
Quick script to get % full MyDocs:
df /home/user/MyDocs -h | grep 'MyDocs' | cut -c53-55 Disclaimer: There's probably a much easier way to do this, but it works for me. :) |
Re: Desktop Command Execution Widget scripts
df /home/user/MyDocs | awk '/My/ {print $5}'
The better one. Displays percentage column, not fixed characters. Also percentage and space free scripts for all filesystems had been added to the wiki. |
Re: Desktop Command Execution Widget scripts
Sweet. Never used awk before, but that's what I wanted to do, just didn't know how. :)
Today I am mostly liking sqlite and the events db. :) |
Re: Desktop Command Execution Widget scripts
Is this application causing desktop freezes (all widgets, won't work anymore, only after a reboot) ? For me, it freezes my desktops, i uninstalled it, i'll see how it'll goes.
|
Re: Desktop Command Execution Widget scripts
Love this widget and I used it a lot since day one...recommend to everyone :)
Great Job!!! U da Man! |
Re: Desktop Command Execution Widget scripts
Quote:
|
Re: Desktop Command Execution Widget scripts
Quote:
All commands are executed on boot and thus if your commands take too long or if they lock if executed on boot... it locks! Next versions will have another check box to enable/disable execution at boot. Will be fixed on the next version.. (my thesis is due to friday... so... I'm kinda.. well.. ) Thanks for your comprehension |
Re: Desktop Command Execution Widget scripts
Quote:
|
Re: Desktop Command Execution Widget scripts
Quote:
|
Re: Desktop Command Execution Widget scripts
Quote:
In particular, any use of wget requires the "-T" option be set. I like the real IP preloaded command, by adding "-T 5" it now never locks up. Maybe at the least, improve the default scripts not to lock up. Later you can try a "throw and catch" execution model. Great widget, orac. |
Re: Desktop Command Execution Widget scripts
can anyone help me out, i would like to use this widget to check the status of a webserver, does anyone have a cmd that does that?
|
Re: Desktop Command Execution Widget scripts
Quote:
|
Re: Desktop Command Execution Widget scripts
Quote:
i consulted some people and the best i have is this wget --timeout=10 --tries=1 http://mywebsite/sometestfile.txt echo "$?" thats it. |
Re: Desktop Command Execution Widget scripts
that might work if you know what the return codes mean. easier might be clear text message like following:
wget .... && echo "success" || echo "fail" the last echo will only fire up if one of the previous commands fails and an echo never fails ;) |
Re: Desktop Command Execution Widget scripts
I was actually able to accomplish it by this thanks to the awesome people on freenode's #linux
first i created a script called qwebcheck in /usr/bin Code:
wget --timeout=10 -O /dev/null http://theserveruwanttocheck.xxx/somefile.html |
Re: Desktop Command Execution Widget scripts
Here is my solution since I am interested in the return code:
Add a desktop widget command that contains the following line: perl -lae '$_=`sh -c "wget -T 10 --tries=1 --spider http://www.yourserver.com/" 2>&1`;@a=split(/g\ response\.\.\.\ /s,$_);@b=split(/\n/,@a[$#a]);if (!((/failed/)||(/error/))) {print @b[0];} else {print "Error"};' I think its safe, it should not lock up, but it does sometimes need you click it a few times to confirm its not just a network error on the way to your server. If you can, I would recommend using the IP of your server to prevent name lookups everytime you run it. orac. |
Re: Desktop Command Execution Widget scripts
Quote:
|
Re: Desktop Command Execution Widget scripts
Quote:
|
Re: Desktop Command Execution Widget scripts
Quote:
The following script was posted on Reddit by theSov: before we start install queenbeecon drop to a shell and create the following script in your /usr/bin wget -O /dev/null http://theserveruwanttocheck.xxx/somefile.html if [ $? -eq 1 ] ; then exit 2 ; fi echo "System OK" save it, chmod +x it. then you add a widget for queenbeecon edit the widget, click on add command type any name u want and the name of the script you created under "command" set any settings u want. select "when connected" and your auto update at the bottom of the widget properties and there you go, remote monitoring on the go. screens: http://imgur.com/WfosH.png http://imgur.com/QtyLo.png Haven't tried it yet as just being lazy at the moment. Edit. Note that Queen Beecon is in Extras Dev so usual warnings apply |
Re: Desktop Command Execution Widget scripts
Using the option --spider prevents you from having to actually download content, you only need the response code.
|
Re: Desktop Command Execution Widget scripts
Hi !
I am a newbie for this DCEW, just playing with it since few days, reading its wiki pages and this forum regularly. I got lost as for me for certain reasons, scripts i could found on wiki or even the built in ones not working or better to say, several of them not working. E.g. I would like to create a battery indicator as follows : Battery : 45% (445mAh / 1200mAh) - Charging "- Charging" part ONLY if charging This should be simple as this script should do the main part (except the "- Charging") : hal-device bme | awk '/l.p/ {perc = $3}; /g.c/ {curr = $3}; /g.la/ {last = $3}; /s_c/ {isch = $3} END if (isch == "false") {print perc" % ("curr"/"last" mAh)"} else {print "Charging"}' Problem is, that it does not show the full capacity (1200mAh) for some reason. I had found an other script where they used something like "grep" and that one could read out the 1200mAh, but I could not combine the 2 as I did not understood the structure how it works as lack of experience. The other thing is, I tried to create a command retrieves the actual IP address which the device reachable from : echo WAN IP: `wget -q -O - api.myiptest.com | awk -F"\"" '{print $4" ("$12" @ "$20", "toupper($28)")"}'`; echo LAN IP: `/sbin/ifconfig | awk '/Bc/ {print $2}' | cut -c6-` Problem is, while my device connected to my home router, lcoal ip shown, but when the device conencted to my Mobile Internet , no ip shows at all, and none of the cases shows any country or such. However, if I load e.g. ipchicken.com, logically, I can see my public ip even through the firewall. Could someone help me to go through these 2 examples to make it udnerstandable how tehy work, so i can learn it and create other scripts pelase ? I know I am sking a lot, btu hoping someone could spare a bit of time, Many Thansk in advance, Andrew |
Re: Desktop Command Execution Widget scripts
Quote:
|
Re: Desktop Command Execution Widget scripts
coolice: Ok, let's go through your questions...
First of all, everything built-in and in wiki is TESTED and it WORKS. So that means that problems are on your side. First script that you ask for is the one you pasted and is the same as in wiki. It does EXACTLY what you want. It shows percentage, current mAh, last full mAh (after a reboot last full mAh becomes 0 because the phone forgets the value, but everything else works) and when the phone is charging, it displays "Charging". The other one you found (using grep) reads design mAh, which is always the same. Last full mAh used in the script using awk is better, because you can also monitor battery wear level with it, but it displays 0 value between a reboot and next charging. About the IP script: The script you found displays wlan0 LAN ip and WAN IP as seen from the internet. The gprs0's IP which you can get with ifconfig is often from private address range, because mobile operators like to use NAT, so this method is not reliable and therefore not used. Go to myiptest.com from N900's browser while connected to GPRS and post the results here. Maybe myiptest.com doesn't recognize your IP yet. |
Re: Desktop Command Execution Widget scripts
Quote:
To start with, we are in agreement, but you seem to misunderstand the following: If you can, I would recommend using the IP... There is an implication by stating "If you can" that what follows will not be suitable for all cases. Of course it is true that for all cases an IP can be used to just test the server and it goes without saying that it can be done. What cannot be done by using the IP is as you stated, when using name based virtual hosting - which is why I refer to the status response as being important, since my script will give a different error response for the following conditions: 1. server cannot be resolved, server is down or server is up, but nothing from the appropriate port. 2. conditions which may indicate a running server but no website. maybe your account has been blocked returning a file not found. I am with Bluehost and there 2 things I will note here, 1, I will need to modify the script further to get the result because they will block your account by simply placing a different .htaccess file in your folder if there is a potential cross site script problem with any php they know of as a security risk. updating the php code will have the site unblocked. 2. It costs an extra dollar a month to have your own IP. I can operate personal services on incoming ports. This script will pause the entire desktop whilst running, so avoiding a name lookup is quite appropriate, an alternative solution is add your host to the /etc/resolv.conf and this will allow name based hosts to be checked more quickly. I tried to make my solution as generic as possible, so only people who know about virtual hosts would know what they need to use. Those who don't know may or may not care that its just the physical server that is being checked and therefore may prefer the speed of an IP check For those who know what they are looking for, they can of course modify this or write their own. I thought your original comment was useful, to help clarify. Neither of us was wrong though. orac. |
Re: Desktop Command Execution Widget scripts
actually i have to use the dns names because i have internal ip's when im at work on the wlan and external ip's when im outside work. however i am ALWAYS working.
|
Re: Desktop Command Execution Widget scripts
Quote:
I only need to check public facing servers. orac |
Re: Desktop Command Execution Widget scripts
could someone help me with a command?
I would like a command that shows the full date. preferably in this format: <day nr (1-31)>-<month name><monthnumber>-<year> with those i should be able to mod it if i want it changed. |
Re: Desktop Command Execution Widget scripts
Quote:
Basically it's date +<format string>. For more info on format string possibilities see http://unixhelp.ed.ac.uk/CGI/man-cgi?date. |
Re: Desktop Command Execution Widget scripts
Quote:
edit: for other users. make sure you disable updating or it'll drain your battery. or so it did for me |
Re: Desktop Command Execution Widget scripts
Does anyone know where/if I can access the data for GPRS data download?
I want to make a 2 queries to show 1) GPRS data download (units) for last month 2) GPRS data download (units) for this month 1 unit for me is 100k of data for every connection startup. Sumed from a given day in month I'm looking for info where/if I can find this data... I will make this query by myself, and post for all ;) |
Re: Desktop Command Execution Widget scripts
anyone can help?
i can only open 3 widgets on desktop, fourth only shows as "result" and all desktop widgets and shortcuts freeze. then hildon-home crashes. |
Re: Desktop Command Execution Widget scripts
cpu and memory usage ?
|
Re: Desktop Command Execution Widget scripts
I wanted to try out the widget, and I created a new command that I called Reboot, sudo reboot. That was not so smart.... :-) My N900 started to reboot and reboot and reboot. We can call it major loop :-) I solved it by flashing the phone. http://wiki.maemo.org/Updating_the_tablet_firmware # Flashing_the_eMMC_in_the_N900
I dident flash the eMMC, only point: 2.3 Windows 2.3.1 N900: XP (SP3) / Vista (SP2) / Windows 7 32-bit Maybe this can help someone in the future. // DrH |
Re: Desktop Command Execution Widget scripts
Many scripts have been added to the DCEW wiki page lately. I suggest that author somehow connects/integrates/embeds those scripts into the program (at least the link to the wiki page should be added because it really has tons of scripts). Also some of the default scripts are a little outdated or better version has been added to the wiki.
Scripts that are in the wiki and not in the program: 1. Enhanced battery, IP, uptime/load scripts 2. Date 3. Disk usage 4. Wi-Fi signal 5. CPU frequency 6. Memory (RAM, swap) usage 7. GPRS data usage 8. Top X processes 9. World time |
Re: Desktop Command Execution Widget scripts
Ram usage conky 135,64 / 239,76
script : RAM used : free | awk '/M/ {printf ("%.1f MB\n",$3/1024)}' output 30 MB :) ? |
Re: Desktop Command Execution Widget scripts
is it possible to make a script to show how many SMS's you've sent this month.
The devel app "SMS counter" isn't stable for me (weird graphical glitches) and sometimes doesn't count correctly - ie a deleted SMS wont be counted, or some new SMSs wont even be registered.... |
Re: Desktop Command Execution Widget scripts
Quote:
Also keep in mind that the commands are very similar and therefore when you see multiple almost same commands on the wiki page you might take the wrong one in confusion. Again, please retest and rethink and I'll do the debug work when I get more feedback. Quote:
It is not possible at the moment, because N900 does not count sent SMSes yet. Aforementioned app scans your messages and counts sent SMSes this month, that's why deleted SMSes are not counted. |
Re: Desktop Command Execution Widget scripts
free | awk '/M/ {printf ("%.1f MB\n",$3/1024)}'
output : 214,2 MB RAM free free | awk '/M/ {printf ("%.1f MB\n",$4/1024)}' output : 25,2 MB 25,2 is little syteminfowidget = 136 MB used conky = 138 MB used |
Re: Desktop Command Execution Widget scripts
Please enter command free in root terminal and post the output. Also post output of cat /proc/meminfo. Don't worry, the data is not sensitive.
|
| All times are GMT. The time now is 06:37. |
vBulletin® Version 3.8.8