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.
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 need to find a program to convert a Windows-1250 encoded file to utf8. It needs to be a standalone program (not a python script) and it needs to run on windows (without install). If I can make the conversion using the commandline that would be perfect.
Yes I know notepad can do that but this is meant to be automated.
What I'm trying to do is set up a udev rule for my HP headphones (usb) with the aid of several tutorials out there.
Created a file ( 90-local.rules ) in /etc/udev/rules.d and added the following:
ACTION="add",SUBSYSTEM="usb", ATTR{vendor}=="Hewlett-Packard", RUN+="sh /home/alex/Scripts/usb.sh"
The problem is nothing happens when I connect the headphones! What am I doing wrong?
note: I did restart udev and the script works also, so it's not that
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?
Hey, I'm trying to make a script run every time NetworkManager (or whatever, but that's what I'm talking to right now) connects to a network (or changes networks).
What I really want is, metaphorically, an init directory that fires everything inside of it whenever my wifi interface changes state/essid. Or a "network status changed" runlevel. Or something.
I'd like to write a simple script that alerts me if a log changes. For this I'm using grep to find the lines I'm interested in. Right now it works like this:
grep line /var/log/file | mail -s Log [email protected]
Problem is that this sends a mail even if no matching lines are found. The mail utility from mailutils seems to have no switch telling it to drop mails that have an empty body.
Is there a quick and easy way to do so?
Is it possible to change the default terminal emulator on Windows (7 and 8 in particular) from cmd to, for example, Console2 or ConEmu? In essence, I want all command line tools, whether launched by double clicking, from "Run" or by other processes to use the custom terminal.
This is a trivial matter on Linux, is it even possible on Windows?
It would be especially helpful if this could be done via a script.
I'm unable to find the directory listing of all PHP packages. I'm basically looking for the latest stable version of 5.3 utilizing some sort of script that will go out and check PHP's website.
If I can get a directory listing (can't seem to find one), I can do the rest.
Figured it out but seeing that someone else posted something similar but for Apache, he got blasted for puttig it on Stackoverflow. I figure I would save myself the trouble and post it here.
I am developing a script which should run under 64 and 32Bit Powershell. Unfortunately it seems that Test-Path return different results in 64 and 32 Environment. Both sessions are running under same user, this user has full access on specific registry key.
64Bit Powershell
>test-path HKLM:\SOFTWARE\Citrix\ProvisioningServices
True
32Bit Powershell(x86)
>test-path HKLM:\SOFTWARE\Citrix\ProvisioningServices
False
Any Idea?
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'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?
I'm trying to create a install script for some FreeBSD machines.
I want to install a few ports but change several configurations before installing, and without the dialog popup.
I've tried almost everything but no success.
I.E:
I'm trying to install nginx with HTTP_SSL module but i can't seem to pass the correct parameter to the make install clean command. I also want to use all other default settings, and only change this one.
Any help will be appreciated.
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
I have a 128x128 image of a cube (projection) like this one:
http://www.math.cornell.edu/~mec/Winter2009/Lipa/Puzzles/pics/rubiks-cube.jpg
I need to make a rotating gif out of a static image.
I am looking for a free (or trial) utility or a script that can do that.
Os in the order of preference: Windows, Mac Leopard, Ubuntu Linux.
Thanks!
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 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)
I have a Mint install (Fantastic stats, if you were wondering) and I would like to move over to Lighttpd for my server needs. Unfortunatly, this means that php_auto_prepend is no longer easily available. I understand that PHP can do this in the php.ini file, but I have areas that can't have this value prepended so that's out of the question. Is there a lighttpd way to prepend my script for my mint install in some files, and have it disabled for others?
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
I'm running on the localhost under admin login. And get forbidden everytime:
[Mon Jun 07 19:17:40 2010] [error]
[client 127.0.0.1] client denied by
server configuration: C:/WebPages/
<Directory "C:/WebPages/*">
Order allow,deny
Allow from all
AddHandler wsgi-script .wsgi
Options ExecCGI
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /cms66.wsgi/$1 [QSA,PT,L]
</Directory>
Hi, I'm running ubuntu on my notebook and I need a way to check (from the command line) if the power cable is connected. Is there any system file that keeps log of this? or is there a bash command that will help me?
I need this for a script that will behave differently depending on whether the power cord is plugged in or not.
Using powershell, I plan to run many functions on a remote host to gather information.
Here is an example to retrieve the content of file remotely just by running a function called getcontentfile with the parameter as the name of the remote host:
function getcontentfile
{
[CmdletBinding()]
param($hostname)
$info = Get-Content "C:\fileinfo.xml"
write-host $info
}
This function should return information about the remote host to the local instance of PowerShell. How can I modify this script to do that?
ive got a printer in my Active directory but its standard set to double sided printing but the problem is the printer doesnt support that so you have to switch it manualy
Ive found the setting for the user but it is automatically set to the original value if you reboot Where can i find the setting in the active directory ? the printer is a :HP Color LaserJet CP1510 Series PCL 6
(its possible that there is a script for this but i dont know where to look)
i have a script that uploads images, creates a hash for it, creates 3 directories, and stores the image to
imgs/f3s/v5g/234/536_f3sv5g2344270fd093ee8a9bf8de3de32dad.jpg
(the “536_” is the user id)
so im trying to turn
imgs/f3s/v5g/234/536_f3sv5g2344270fd093ee8a9bf8de3de32dad.jpg
into
user_pics/536/536_f3sv5g2344270fd093ee8a9bf8de3de32dad.jpg
how can i do that? i want that if someone wants to view the photo, they see the new directory in the url, not the one with 3 sub directories.
I frequently come in contact with people who absolutely cannot operate a PC, no matter how you train them.
I need some sort of programmable physical button or remote control, where when they click it, it will execute a script on a windows machine. (and no, wiseguys, a mouse won't do)
Does such a thing exist?