ping adresses from file, send sms report to adresses by list
Google translator:
Guys, prompt, really I create a variable named stream?
I want the next copy flow and rename it to a variable was created and written with the new name of the stream. {Flow_name} understandable. But how to create a recess with the same name?
For example. I want to ping the IP pieces 20. Every minute to write the log of the results. Then, when the state variable and the status of the ping, disappeared so to speak, I will send a sms with the text of the ping and the IP address.
Can anyone implemented such a thing?
Or please tell me how to file a list of IP by turns to take each line and ping this address.
Write to a file ravine easy. Understood.
By ftp or something else is taken from time to time files:
1. hosts
2. phonenumbers
3. log
Taken one by one the IP address of the hosts file and ping.
(Host reacheble ping)
Is compared with the current state of the Previous and the difference is sent SMS.
SMS is formed on the result of the passage of all addresses. Infa accumulates and then sent.
"/ N" works as a new line? printed only as text and everything. Maybe the code should be some kind?
Just please tell me the procedure (code) to read a line from a file and writes to the array a. On the arduino can do, and then what?
There is a file: hosts. it placed the IP address line (20 pieces, strings).
Pinging each address one time per minute.
Compare the current state of the IP address (192.168.0.1) to the last variable ("192.168.0.1").
If different, write to another variable "TEXTtoSMS": IP address, date, time, current status.
Write to the variable ("192.168.0.1") the current status of the address.
And so for each IP address of the file.
When all the rows have been (address) check for the presence of text in the variable "TEXTtoSMS" and send SMS to the addresses that I take from another file.
Do I need to somehow individually declare a variable? Or enough (stat_19216801 = "on")? I want to create a variable named stream. {Flow_name}. Really it?
Or it is necessary to enclose an array of two columns? The first IP address, the second status. After checking the status of an IP address, run the array. Looking in the first column of our address and check the option recorded in the second column. How do I proceed with the formation of protsedurka "TEXTtoSMS" ..
How to add a translation to a new line when writing text into a variable "TEXTtoSMS"?
for example
files:
1. hosts:
192.168.0.1
192.168.0.2
......
.
.
..
2. calls:
+7********
+7********
+7********
3. log:
ip adress, date, time, status (online, ofline)
1. need to read from file HOSTS, ip adress from line1 and ping. Or get all lines from file HOSTS to array with 2 columns. Frist column for ip adress, second column for previous status (online, ofline).
For each ip need ping then compare now status with previous status.
If status changed, add to value "TEXTtoSMS" (ip, status). At the end of string add "/n", for insert code NEXT STRING (like in Arduino "Println(text)").
Please give me code (example) for read strings from file. Line1, Line2, Line3.
Or get strings from file to array.
I need just it. Next steps not strong for me.
Related
I have encountered the same "loading screen" problem when restoring sms from the old builds to the current new hero builds using Backup for Root Users. This is what I did to solve it:
the logcat reveals this missing table field "index_on_sim", thus using a sqlite editor, I compared the old mmssms.db and the new mmssms.db files. The missing field in under the sms table so all one need is to ADD the new field "index_on_sim" with type INTEGER. Upon careful observation, this field is used with value "-1" for incoming sms, not for outgoing ones.
Thus, I used the following sql commands:
1. to check for the correct index_on_sim rows with non-empty service_center info
=> SELECT sms.index_on_sim FROM sms WHERE service_center IS NOT NULL
2. to modify the above index_on_sim rows with '-1'
=> UPDATE sms SET index_on_sim = '-1' WHERE service_center IS NOT NULL
okay once done, verify that the rows are updated correctly and save the db.
push the edited mmssms.db to the Backup for Root Users folder or directly into /data/data/com.android.providers.telephony/databases.
That's it! Your old sms will appear in the new hero build.
Attached is the sqlite program. ( To be used in linux/ubuntu )
Anyone knows how to automate the above process with a script??
nice. i'll have to try this. thanks!
edit:
It worked great! Thanks again!
edit2:
Not sure why but I can't mark any of my new recieved text messages as read and the text messages that I sent have an icon to the right of it (notification? information? something).
I'm having the same problem also after editing the mmssms.db file
This is what worked for me i got it from a post on another forum here is a link to the original post: http://android.modaco.com/content-p...-2-versions-based-on-the-new-update/page/800/
Code:
adb shell
sqlite3 /data/data/com.android.providers.telephony/databases/mmssms.db
ALTER TABLE sms ADD COLUMN index_on_sim INTEGER DEFAULT -1;
(Press Control-D)
exit
Ok, I don't get it.
Porting CM7 and I have an odd one - the stock email application blows up when an account is added. Tracing it down I found the problem - the Sqlite schema is defective. Here's what I have in /data/data under the appropriate directory, examined by Sqlite3
sqlite> .schema account
CREATE TABLE Account (_id integer primary key autoincrement, displayName text, emailAddress text, syncKey text, syncLookback integer, syncInterval text, hostAuthKeyRecv integer, hostAuthKeySend integer, flags integer, isDefault integer, compatibilityUuid text, senderName text, ringtoneUri text, protocolVersion text, newMessageCount integer, securityFlags integer, securitySyncKey text, signature text, accountColorinteger);
Note the last field. There's supposed to be a space there; when the table was created the type statement was obviously keyed next to the field name without the required space. It also appears that SQLite is perfectly happy to create a field in a table without an explicit type declaration, which disturbs me, but it is what it is.
Here's the thing - obviously somewhere there's a declaration of that variable and type in some file somewhere. Right?
Well, where is it then - because I can't find it with a complete pass through the source using find / grep!
Nevermind - found it. The android guys were cute with the defines in the code and it indeed was a missing space in the email provider source.....
No idea where to put this, admin; feel free to move or delete.
There's a lot of really cool custom theming going on with Android and an often important part of that is the visual indication of missed phone calls, new messages, new mail, etc. (unread bubbles next to app icons, in lockscreens, etc.). There's a host of solutions to get this info but for me e-mail counts had always been a bit of a issue. Missed phone calls are tracked by the Android system, and WhatsApp notifications can be counted from the notification bar with Tasker and reset when you open the app because your phone is the only place where you will check your WhatsApp messages. E-mail however is not centralized in Android (yet) so if you use anything else than Gmail the system won't know how many unread mails you have and you could uee a notification counter on your mail app but when a new email arrives it will put the counter on +1, if you then read the e-mail on another device (for example your computer) your notification counter on your phone will still be on +1 even though you read the mail.You then have to open your mail app to get the counter back to 0 again.
That why I made this PHP / Tasker solution for my IMAP mail. This is a PHP script that checks how many unread mails there are in your inbox:
PHP:
<?php
function mailCount($host, $login, $passwd) {
$mbox = imap_open($host, $login, $passwd);
$mail = '';
if($mail = imap_check($mbox)) {
$msgnos = imap_search($mbox, 'UNSEEN');
return $msgnos;
}
}
$hostname = '{imap.yourhost.com:143/imap}INBOX';
$username = 'your_username';
$password = 'your_password';
$count = mailCount($hostname, $username, $password);
if ($count != "") $number = sizeof($count);
else $number = 0;
echo $number;
Change yourhost, your_username and your_password and the port (143). (if you want to, add some extra security by doing IP or Cookie checks), put the PHP file online on your server. The script will then simply show a number of unread mails in your inbox.
Then you can use Tasker to read this number. Add a tasks (for example CheckMailCount) then add the action Net > HTTP Get. For 'Serverort' fill in the url of your script (http://www.yourserver.com/unreadmail.php) and set the Mime Type to 'text/*'. Then in the same task add an action Variables > Variable Set. Give the variable a Name (for example: %MAILCOUNT) and set it To %HTTPD. This will set the %MAILCOUNT variable to the result of the last http Get request ie. the number of unread mails.
You now have a tasker variable with the actual number of unread mails in your inbox.
I use this on my WidgetLocker lockscreen so I trigger the task on Event > Display > On. I added a third action in the CheckMailCount action to set a Zooper Variable (Plugin > Zooper Widget Pro >Edit > ZW Variable = MAILNOTI, ZW Text = %MAILCOUNT) you could also make this %HTTPD straight away if you don't use the variable for anything else. You then have the #TMAILNOTI# variable in Zooper to use to display how many unread mails you have in a widget. I don't use the count but I display a mail icon indicating that I have a new mail if the #TMAILNOTI# is anything but 0. I do this by adding a bitmap in Zooper of a mail icon and then in Avanced Parameters I put
$#TMAILNOTI#=0?/sdcard/icons/nomail.png$
This tells Zooper that if the variable #TMAILNOTI# = 0 it should use the bitmap nomail.png in my icons folder on the sd card. nomail.png in my case is simply an empty transparent png.
Hope this helps somebody!
nielshtc said:
No idea where to put this, admin; feel free to move or delete.
There's a lot of really cool custom theming going on with Android and an often important part of that is the visual indication of missed phone calls, new messages, new mail, etc. (unread bubbles next to app icons, in lockscreens, etc.). There's a host of solutions to get this info but for me e-mail counts had always been a bit of a issue. Missed phone calls are tracked by the Android system, and WhatsApp notifications can be counted from the notification bar with Tasker and reset when you open the app because your phone is the only place where you will check your WhatsApp messages. E-mail however is not centralized in Android (yet) so if you use anything else than Gmail the system won't know how many unread mails you have and you could uee a notification counter on your mail app but when a new email arrives it will put the counter on +1, if you then read the e-mail on another device (for example your computer) your notification counter on your phone will still be on +1 even though you read the mail.You then have to open your mail app to get the counter back to 0 again.
That why I made this PHP / Tasker solution for my IMAP mail. This is a PHP script that checks how many unread mails there are in your inbox:
PHP:
<?php
function mailCount($host, $login, $passwd) {
$mbox = imap_open($host, $login, $passwd);
$mail = '';
if($mail = imap_check($mbox)) {
$msgnos = imap_search($mbox, 'UNSEEN');
return $msgnos;
}
}
$hostname = '{imap.yourhost.com:143/imap}INBOX';
$username = 'your_username';
$password = 'your_password';
$count = mailCount($hostname, $username, $password);
if ($count != "") $number = sizeof($count);
else $number = 0;
echo $number;
Change yourhost, your_username and your_password and the port (143). (if you want to, add some extra security by doing IP or Cookie checks), put the PHP file online on your server. The script will then simply show a number of unread mails in your inbox.
Then you can use Tasker to read this number. Add a tasks (for example CheckMailCount) then add the action Net > HTTP Get. For 'Serverort' fill in the url of your script (http://www.yourserver.com/unreadmail.php) and set the Mime Type to 'text/*'. Then in the same task add an action Variables > Variable Set. Give the variable a Name (for example: %MAILCOUNT) and set it To %HTTPD. This will set the %MAILCOUNT variable to the result of the last http Get request ie. the number of unread mails.
You now have a tasker variable with the actual number of unread mails in your inbox.
I use this on my WidgetLocker lockscreen so I trigger the task on Event > Display > On. I added a third action in the CheckMailCount action to set a Zooper Variable (Plugin > Zooper Widget Pro >Edit > ZW Variable = MAILNOTI, ZW Text = %MAILCOUNT) you could also make this %HTTPD straight away if you don't use the variable for anything else. You then have the #TMAILNOTI# variable in Zooper to use to display how many unread mails you have in a widget. I don't use the count but I display a mail icon indicating that I have a new mail if the #TMAILNOTI# is anything but 0. I do this by adding a bitmap in Zooper of a mail icon and then in Avanced Parameters I put
$#TMAILNOTI#=0?/sdcard/icons/nomail.png$
This tells Zooper that if the variable #TMAILNOTI# = 0 it should use the bitmap nomail.png in my icons folder on the sd card. nomail.png in my case is simply an empty transparent png.
Hope this helps somebody!
Click to expand...
Click to collapse
This looks way to confusing but I get it a little bit... lets say I want to use UCCW tasker variable option to show the counts...:silly:
Hello,
please check my latest app called 'Search Contacts':
Search Contacts gives you the possbility to easily find the contacts on your device by searching for their attributes.
Just enter the search term and the app will immediately show you all matching contacts and which attribute matched the search. Furthermore you can also directly share the contacts most important information by email or sms.
Search Contacts will search in all those contact attributes:
- Display name
- Phone numbers
- Email addresses
- Structured name (Given name, family name, prefix, middle name, phonetic given name, phonetic middle name, phonetic family name)
- Structured address (City, country, formatted address, neighborhood, pobox, postbox, region, street)
- Organization (Company, department, job description, office_location, phonetic name. symbol)
- Websites
- Note
- Nicknames
- Sip addresses
- Relations
Google Play
Maybe it's useful to someone
Hi guys,
I'm looking for an android app to read the value of an NFC chip and write that value to a text file.
What I'm looking for is basically the same functionality as when you would hook up an USB NFC-reader to a PC, and write the scanned values to a notepad file.
The situation in which this would be used is to scan people entering a training session on a company event.
Attendees would have an NFC-enabled name tag, and we have a list of nfc-values to correspond to the attendees already stored in the database.
Do you guys know of any apps that could provide this functionality?