I'd like Apache to terminate my perl script after 1 minute if it doesn't complete naturally. Is there a setting in Apache (or other server software) to do this?
Its possible to rename files all at once. But its not possible to change the extension of selected files all at once.
If windows doesn't support this facility .. then is there any batch script or something to work out with ???
I have ssh access to many servers where I have no root privileges. Do you know of any version control utility that can work with remote ssh repositories whichout installing anything on the remote server?
I have tried a bare git repository folder, but it seems to demand some script/binary/installation on the server. I also dont like git because it is not very portable. The portable versions are made of too many files
Is there a way to get DVD region code from command line (linux/ubuntu 9.10)?
I want to script this action and store the region code (and other data about DVD) in a log.
We have an old VB6 application, written in the UK, which we want to run on a client's server in Canada. The application must have some hard-coded date formats in it somewhere, as it's misinterpreting dates, eg, 6th April is getting recorded as 4th June. I know I could change the user's date format, but this would affect all applications. Is it possible, perhaps with some sort of wrapper script, to set specific regional settings for this single application?
Consider we hosting. Thousands of sites hosted, pile of pages, domains, servers etc etc..
Now one evil page makes curl request to external site.
How to find out which script that was.
I have some autohotkey settings for my joystick that are set to work everywhere.
However, there are twp programs where I don't want autohotkeys to remap the joystick.
How can I disable autohotkeys remapping for these programs in the script, so that I don't have to manually do it?
I'm running apache2/passenger2.0.3 (ubuntu 9.10 packages).
I can start up Webrick in the rails folder and run the app perfectly as I do on my development box with
script/server
Why then does apache/passenger fail to open the database, throwing a 500 and putting the following in the log?
Status: 500 Internal Server Error
could not open database: unable to open database file
/usr/lib/ruby/1.8/sqlite3/errors.rb:62:in `check'...
I was listening to some older mp3s today and I released that some of my songs have pops and cracks in them. I assume this means that the file has some bad blocks.
Is there software/script/etc that I can run on my entire library and find the music with these artifacts?
Thanks!
I have a bunch of ghost image files to edit. These are Windows OS images, and I need to add a few files into the them.
I could have used Ghost Explorer (GhostExp.exe) to modify them one by one, but it would be nicer to have a command line utility to do the trick, so that I can write a script to do this automatically for me.
Any suggestions?
It seems that Cron doesn't support a seconds interval. What is the easiest way to run a cli script (php) every 15 seconds? Is there a cron tool that works specifically with seconds (then I could use Cron to call it every minute)?
I'm looking for architectural advice. I have a client who I've built a website for which essentially allows users to view their web cameras remotely.
The current flow of data is as follows:
User opens page to view web camera image.
Javascript script polls url on server ( appended with unique timestamp ) every 1000ms
Ftp connection is enabled for the cameras ftp user.
Web camera opens ftp connection to server.
Web camera begins taking photos.
Web camera sends photo to ftp server.
On image url request:
Server reads latest image on hard drive uploaded via ftp for camera.
Server deleted any older images from the server.
This is working okay at the moment for a small amount of users/cameras ( about 10 users and around the same amount of cameras), but we're starting to worrying about the scalability of this approach.
My original plan was instead of having the files read from the server, the web server would open up an ftp connection to the web server and read the latest images directly from there meaning we should have been able to scale horizontally fairly easily. But ftp connection establishment times were too slow ( mainly due to the fact that PHP out of the ox is unable to persist ftp connections ) and so we abandoned this approach and went straight for reading from the hard drive.
The firmware provider for the cameras state they're able to build a http client which instead of using ftp to upload the image could post the image to a web server. This seems plausible enough to me, but I'm looking for some architectural advice.
My current thought is a simple Nginx/PHP/Redis stack.
Web camera issues post requests of latest image to Nginx/PHP and the latest image for that camera is stored in Redis.
The clients can then pull the latest image from Redis which should be extremely quick as the images will always be stored in memory.
The data flow would then become:
User opens page to view web camera image.
Javascript script polls url on server ( appended with unique timestamp ) every 1000ms
Camera is sent an http request to start posting images to a provided url
Web camera begins taking photos.
Web camera sends post requests to server as fast as it can
On image url request:
Server reads latest image from redis
Server tells redis to delete later image
My questions are:
Are there any greater overheads of transferring images via HTTP instead of FTP?
Is there a simple way to calculate how many potential cameras we could have streaming at once?
Is there any way to prevent potentially DOS'ing our own servers due to web camera requests?
Is Redis a good solution to this problem?
Should I abandon PHP/Ngix combination and go for something else?
Is this proposed solution actually any good?
Will adding HTTPs to the mix cause posting the image to become too slow?
Thanks in advance
Alan
Hi,
Im relatively new to Ubuntu, Im wondering how easy it is to write what I think is called a shell script to make tasks a little easier.
For example I frequently connect to a server - ssh -p 123 [email protected]
Can and how could I shorten this to a shorter command like "mysite" or "connect mysite"
Thanks.
We always try to be clever and script everything that we find repetitive but not everything can be automated - what have you found in your career to be just a massive pain?
I'll give you mine - building Netware version 2.xx on 5.25" disks with multiple NICs - this often took HOURS of swapping disks, pacing around, swapping disks, more pacing etc. Then finally it would hopefully work - if you'd not set the IRQs/DMAs right you had to start again, wow I loved version 3 which didn't need all that.
What about you?
I have 2 printers.
HP Deskjet F2235 - designated scanner (has printing issues)
Brother HL-2040 - designated printer (doesn't have a scanner)
Just by using those two both connected to the same computer, is there a way to perform a photocopy operation by scanning via the designated scanner then immediately it being printed from the designated printer?
Obviously you could save the scanned files then print them, but short of making a script or manually doing this, is there a faster automatic way through settings or third-party software?
Hi all,
currently my logrotate configuration adds a single number after the rotated log file:
mylogfile.log is rotated to mylogfile.log.1
I would like to change the extension to mylogfile.log.Current date
does anyone know a way to do this?
my log rotate code is :-
/usr/local/jboss/jboss-3.2.7-ND1/server/default/log/consolelog.log {
copytruncate
rotate 1
missingok
notifempty
}
Currently am renaming the rotated file with script.is there any option to change the extension of log rotate default configuration. Please help me
I'm setting up a custom 403.4 handler so that non-SSL requests to my site are redirected to a different URL - and what I'd like to do is to include the script path and query string in the redirect, so that a user who requests http://www.site.com/foo?bar=1 will be redirected to https://www.site.com/foo?bar=1
I know something similar is possible when configuring a top-level site redirect, using the $S, $Q, %v tokens referred to in this IIS reference page - but this syntax doesn't seem to work when configuring a custom error redirect.
I have one domain on my VPS which I wanted to run a script a few hundred times on to simulate users, so I put a few Firefox tab on refresh every 1 second.
Now that domain is dead, it just gives me a 504 every time I try to go to it, even though I restarted NGINX, PHP and I even shut the server on and off.
All of my other sites on that VPS are Ok and running perfectly, just this one where I tried the reloading on.
What can I do from here?
I'd like to read small text file, located at: /sys/kernel/debug/vgaswitcheroo/switch without root permissions. It contains information about graphic cards (dedicated ATI Radeon and integrated Intel HD3000).
I wrote a simple script displaying infomation I need, but it works only with root privileges. I already tried changing file & folder permissions, but when I restart my computer, the problem remains. Is it possible to permanently change that file permissions or owner?
A question about upstart.
I understand the restart command does a stop and restart of the process.
What happens if the process will not stop and check for the signals for a long time (20min or 2h)?
Will it still restart after such a long time ?
Example my-process:
until stop_signal_received
work for 2h
end
So the script will check for stop signals every 2 hours.
$sudo restart my-process
Will the process restart after 2 hours or not?
welcome,
I have problem with .bat script on windows.
I use wget to download html stats page, now i have to find (in html source) url like this
http://www.example.com/stats/367895.jpeg
The 367895 is a random generated number.
and download chart jpeg.
I think i can't do this in .bat, Do You know any external command line application what i could trigger from .bat and show in output finded url ?
Regards
Hi,
I'm trying to add interfaces to a DomU (either on the fly or after reboot) and the attach-interface script works just fine.
The problem is that when I reboot the DomU the interfaces added are "lost"....
Is there a way to save the interface configuration?
I tried adding vif=[''] line to the *.cfg file but with no success.
Can somebody give me a hint on what to do?
I'm using Ubuntu 10.04 beta 1. When I try to update & upgrade I get the following error:
Setting up install-info (4.13a.dfsg.1-5ubuntu1) ...
/etc/environment: line 4: LC-ALL=en_US.UTF-8: command not found
dpkg: error processing install-info (--configure):
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
install-info
Does anyone know how to fix this?
Thanks
I have to perform various task such as restarting process, monitor process state check disk space, log monitoring on Window server 2003 machine. For this i am using remote desktop access which is very slow. Is there any alternate (Tool or Framework) for windows server where i can execute my script on my machine and the required task will be performed on the remote machine in somewhat interactive manner (like putty in linux)
My question is:
why if I run some file with name aliases for example with content such as:
alias lsa="ls -a"
directly:
$ ./aliases
it don't create the alias (may be only in script context).
But if I run it with command "source":
$ source aliases
it do the work? I mean after execution the alias "lsa" existing in context of command shell?
"man source" give: "No manual entry for source", and in google I just found that it runs Tcl, but why Tcl influence shell context and bush not?