Hi all, im trying to get image size(DIMENSIONS) of hundreds of remote images and getimagesize is way too slow. ive done some reading and found out the quickest way would be to use get_file_contents to read a certain aount of bytes from the images and examining the size within the binary data. Anyone attempted this before? How would i examine different formats. Seen any library for this? please let me know
I have a very simple server written in C and an equally simple client written in Java. When I run them both on the same computer everything works, but when I try to run the server on computer A and the client on computer B, I get the error IOException connection refused from the java client. I can't seem to find out whats happening, any thoughts? I've even turned off the firewalls but the problem still persists.
server.
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#define PORT 3557
#define BUF 256
int main(int argc, char *argv[])
{
struct sockaddr_in host, remote;
int host_fd, remote_fd;
int size = sizeof(struct sockaddr);;
char data[BUF];
host.sin_family = AF_INET;
host.sin_addr.s_addr = htonl(INADDR_ANY);
host.sin_port = htons(PORT);
memset(&host.sin_zero, 0, sizeof(host.sin_zero));
host_fd = socket(AF_INET, SOCK_STREAM, 0);
if(host_fd == -1) {
printf("socket error %d\n", host_fd);
return 1;
}
if(bind(host_fd, (struct sockaddr *)&host, size)) {
printf("bind error\n");
return 1;
}
if(listen(host_fd, 5)) {
printf("listen error");
return 1;
}
printf("Server setup, waiting for connection...\n");
remote_fd = accept(host_fd, (struct sockaddr *)&remote, &size);
printf("connection made\n");
int read = recv(remote_fd, data, BUF, 0);
data[read] = '\0';
printf("read = %d, data = %s\n", read, data);
shutdown(remote_fd, SHUT_RDWR);
close(remote_fd);
return 0;
}
client.
import java.net.*;
import java.io.*;
public class socket {
public static void main(String[] argv) {
DataOutputStream os = null;
try {
Socket socket = new Socket("192.168.1.103", 3557);
os = new DataOutputStream(socket.getOutputStream());
os.writeBytes("phone 12");
os.close();
socket.close();
} catch (UnknownHostException e) {
System.out.println("Unkonw exception " + e.getMessage());
} catch (IOException e) {
System.out.println("IOException caught " + e.getMessage());
}
}
}
Hi all ,
i was building an application that use local connection and listens to another application that also uses local connection , the second application is sort of remote control for the first app. it invokes function of the listening app from outside.
anyway , everything works good on local host.
BUT
once i have put the listening app on a server and try to work it , it does not connect anymore.
any idea's?
Thanks
I've used ( and still use ) mercurial and git. I have some repos hosted in a server with gitosis which is great and easy to setup. I am looking for a similar tool for hosting mercurial repos.
It must provide minimal acl and ssh access and allow for remote config ( in the style of gitosis's "clone the admin repo and push changes" ).
Extra points for automating hgweb config via said tool.
Hey
I'd like to know how to use XMLHttpRequest to load the content of a remote URL and have the HTML of the accessed site stored in a JS variable.
Say, if I wanted to load and alert() the HTML of http://foo.com/bar.php, how would I do that?
Thanks!
I get an "The remote name could not be resolved: 'mine.com'"
When using this open ID identifier:
https://www.google.com/accounts/o8/site-xrds?hd=mine.com
And it's true, that the mine.com DNS record doesn't exist. But I'm wondering why it goes to look there in the first place. All I want to be doing is to check if the user can login to our hosted domain. Is that really so hard?
I want to access a MySQL database from Java, but remote connection is disabled by the host.
So I will send the data to PHP and then PHP will locally access the database.
The data is pretty big (about 2~4kb)
I've never done this before.
What should I do?
Hi All,
I was googling for tools for checking broken links in a remote web page. The w3c validator seemed a good one. But I am still unsure as how to check for pages which are restricted, i.e. the pages which I can only access by logging in to the site. Can we do that using the w3c validator? If not than is there any other tool for the same?
I am attempting to set a character set of IBM850 on slackware linux for a particular application (epic5).
Im using rxvt-unicode and have setup LANG/LC_*=en_US. Now if I set the encoding to IBM850 in kde's konsole program im able to display certain characters correctly. I'd rather not use IBM850 for everything; is there a way to set/alias a command for a per application execution?
Ive tried things like:
LC_CTYPE=IBM850 epic5
LC_ALL=IBM850 epic5
No success. Any help would be appreciated
Hello, I have configured some lighttpd rewrites, of which one does not work.
This is the line that does not work as it should and causes a white (blank) page to be thrown:
url.rewrite-once = (
...
"^/search/([^\/]+)*/([^\/]+)*/([0-9]+)$" => "search.php?t=$1&k=$2&p=$3",
...
);
Also note that it is the only one with 3 parameters, all the rest in the section have 0-2.
I found this error in the lighttpd error.log:
2011-01-07 17:13:09: (mod_rewrite.c.374) execution error while matching: -8
Can someone help? Thanks.
Recently i designed one Abode air Chat application, which gets the chat messages from admin-Application(we bApplication), band width consumption is too high while each client launching air application to pull the data from database to my-amf endpoint.
in this am using blazeds,Jetty server,simple java classes(not servlets) calling with remote object,
Please any one suggest me few techiniques to
1)reduce the bandwidh consumption while sending message to each client from admin
2)minimize the time to pull the data from database while client launching application.
Regards,
Thirst for Excellence
Can I create an event so I can execute some javascript whenever an element with a specific ID becomes visible or appears on the page?
The element comes from a remote resource (so isn't in MY html code but appears on page load) and I'd like some code to run when it appears (and only if it appears, it may not appear every load).
Thanks!
I am importing data from another database.
My process is importing data from a remote DB into a List<DataModel> named remoteData and also importing data from the local DB into a List<DataModel> named localData.
I am then using LINQ to create a list of records that are different so that I can update the local DB to match the data pulled from remote DB. Like this:
var outdatedData = this.localData.Intersect(this.remoteData, new OutdatedDataComparer()).ToList();
I am then using LINQ to create a list of records that no longer exist in remoteData, but do exist in localData, so that I delete them from local database.
Like this:
var oldData = this.localData.Except(this.remoteData, new MatchingDataComparer()).ToList();
I am then using LINQ to do the opposite of the above to add the new data to the local database.
Like this:
var newData = this.remoteData.Except(this.localData, new MatchingDataComparer()).ToList();
Each collection imports about 70k records, and each of the 3 LINQ operation take between 5 - 10 minutes to complete. How can I make this faster?
Here is the object the collections are using:
internal class DataModel
{
public string Key1{ get; set; }
public string Key2{ get; set; }
public string Value1{ get; set; }
public string Value2{ get; set; }
public byte? Value3{ get; set; }
}
The comparer used to check for outdated records:
class OutdatedDataComparer : IEqualityComparer<DataModel>
{
public bool Equals(DataModel x, DataModel y)
{
var e =
string.Equals(x.Key1, y.Key1) &&
string.Equals(x.Key2, y.Key2) && (
!string.Equals(x.Value1, y.Value1) ||
!string.Equals(x.Value2, y.Value2) ||
x.Value3 != y.Value3
);
return e;
}
public int GetHashCode(DataModel obj)
{
return 0;
}
}
The comparer used to find old and new records:
internal class MatchingDataComparer : IEqualityComparer<DataModel>
{
public bool Equals(DataModel x, DataModel y)
{
return string.Equals(x.Key1, y.Key1) && string.Equals(x.Key2, y.Key2);
}
public int GetHashCode(DataModel obj)
{
return 0;
}
}
've been puzzling over cronjobs for the last few hours. I've read documentation and examples. I understand the basics and concepts, but haven't gotten anything to work. So I would appreciate some help with this total noob dilemma.
The ultimate goal is to schedule the execution of a django function every day. Before I get that far, I want to know that I can schedule any old script to run, first once, then on a regular basis.
So I want to:
1) Write a simple script (perhaps a bash script) that will allow me to determine that yes, it did indeed run successfully, or that it failed.
2) schedule this script to run at the top of the hour
I tried writing a bash script that simple output some text to the terminal:
#!/bin/bash
echo "The script ran"
Then I dropped this into a .txt file
MAILTO = *****.******@gmail.com
05 * * * * /home/vadmin/development/test.sh
But nothing happened. I'm sure I did many things wrong. Where do I start to fix all of this?
This doesn't need to be a real time solution, but are there some log files or system messages that could be read to identify periods of time where someone was connected via RDP to a Windows 7 machine?
I'm building a watchdog script for a computer which will be deployed in a remote place and would like to add this metric to a daily status update.
I'm developing a site which monitors user's date.
It uses the cURL over PHP.
It first gets authorized using cookie and then parses the required data.
My problem is that it needs to fire multiple requests to the server (for all registered users) and this may
Get me banned by the remote server.
I would like to know if there is something I could do to prevent being banned.
(This activity is legal - the users have provided their login information)
Thanks
i need the source code of an application that can upload and download automatically from the remote computer (FTP) using java langauge. if any body gey help or the code, kindly contact me through my mail address [email protected]. thanks
Hi all,
How can I use WMIUserID, WMIPassword, WMIAlternateCredentials using C#?
Also, is it possible to get remote computer's Administrator-password?
Please try to explain with examples.
Thanks.
In CVS, we could programatically create a new branch of existing source using the "rtag" command, which did not require a copy of the repository.
Does git support functionality of this kind, making a branch of existing files in a remote git repository without having a local copy of it? Or does the distributed nature of git preclude this?
(I'm trying to save the 20+ minutes it would take to make a freestanding copy of the repository, just to run a 'git branch' command.)
Hi there,
I'm looking for a fast SSL socket client basically talks SSL with remote service and I need features like connection pooling/limiting so that my other client calling this ssl socket can basically issue as many as requests and it will handle it peacefully.
I looked into openssl s_client, but it says it's only for testing purpose, is there a handy tool avaiable? STunnel seems to be okay, but don't have that connection limiting option I need.
Cheers.
I have a small script to install on my remote machine an update.
I would like to reboot the machine remotely and if it is rebooted, continue with some more commands.
What I currently do is:
ssh root@myMachine << COMMANDS_ISSUED
###... Tasks
init 6
COMMANDS_ISSUED
sleep 180s
ssh root@myMachine << POST_REBOOT_COMMANDS
###.... More stuff
POST_REBOOT_COMMANDS
Is there a more elegant way to do it? Like pinging the machine all 5 seconds up to a maximum of 4 minutes?
I play with a few linux machines which have different boot up times and if my script would continue immediately after reboot, this could safe quite some time for me. (Note: I don't want to parallelize execution over all machines as I want to see for each machine if everything worked fine)
I have a fairly large SQL Server database; I'd like to pull 4 tables out and dump them directly into an sqlite.db for remote querying (via nightly batch).
I was about to write a script to step through(most likely on a unix host kicked off via cron); but there should be a simpler method to export the tables directly (SQLite not an option in the included DTS Import/Export wizard)
What would the most efficient method of dumping the SQL Server tables to SQLite via batch be?
The command
hg outgoing
compares the local repo to the default push location; it accesses the push location to do it.
I'd like to ask the question "have I checked in changes in my local repo since my last hg push?" without having to access the remote repo.
It seems like there might be enough info in the local repo to figure that out; if so, is there a command to determine that?