Search Results

Search found 47712 results on 1909 pages for 'looking for a script'.

Page 17/1909 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Skipping a line and reading another line in shell script while loop

    - by parameswar
    i have a code which reads a file line by line using a while loop. Inside the while loop, i have certain conditions. Is there a way using which i can skip the current line and read the next line based upon the condition ? Let me be precise: while read Line do //some sample conditions a=$Line if [ "a" == "b" ] //i want to go to the next line from this point. done < **inputfile** Any help would be appreciated.

    Read the article

  • Java Script JQUery

    - by windi
    Hi I am extracting data from an xml file converting it into json and rendering the images which i am retriving to the html file via jtemplate.now i want to user scroller and scroll the images .i can call to the scroller plugin but it is not scrolling throuhg . can any one help me please.

    Read the article

  • Tasks API using Google Apps Script (complete task)

    - by Cartman
    I am trying to set the status of a task as completed using Tasks API. It shows that the code has completed successfully, but the task is not being marked as completed. Also, when I try to get the status of the task after update, it shows status as "needsAction". Here is my code function setTaskStatus(){ // Suppose a task with name "MyTaskListName" is contained //within task list with name "MyTaskName" var tasklist = Tasks.Tasklists.list().getItems(); var title = 'MyTaskListName'; var id; for(var i in tasklist){ if(title == tasklist[i].getTitle()){ id = tasklist[i].getId(); } } //Get the task list items var tasks = Tasks.Tasks.list(id).getItems(); for(var i in tasks){ if(tasks[i].getTitle() == 'MyTaskName'){ tasks[i].setStatus("completed");// set status completed Logger.log(tasks[i].getStatus());// this shows that the task has completed //But it does not reflect actually } } }

    Read the article

  • How To Avoid a Perl script calling an Another Perl Script

    - by rockyurock
    Hello, i am calling a perl script client.pl from a main script to capture the output of client.pl in @output. is there anyway to avoid the use of these two files so i can use the output of client.pl in main.pl itself here is my code.... main.pl ======= my @output = readpipe("client.pl"); client.pl ========= #! /usr/bin/perl -w #use strict; use Socket; #initialize host and port my $host = shift || $FTP_SERVER; my $port = shift || $CLIENT_PORT; my $proto = getprotobyname('tcp'); #get the port address my $iaddr = inet_aton($host); my $paddr = sockaddr_in($port, $iaddr); #create the socket, connect to the port socket(SOCKET, PF_INET, SOCK_STREAM, $proto)or die "socket: $!\n"; connect(SOCKET, $paddr) or die "connect: $!\n"; my $line; while ($line = ) { print "$line\n"; } close SOCKET or die "close: $!"; /rocky..

    Read the article

  • Run a startup script with lightdm

    - by cheshirekow
    I have a tablet PC and the graphics driver doesn't support xrandr, so in order to rotate the screen I run a script which changes the Xorg.conf file and then restarts lightdm. I also have a script which uses xsetwacom and xinput to change the rotation of the input devices so that the match the new orientation. I've learned how to get the script to run when I login, but I'd like it to run before I login, so that I don't have to enable auto-login with lightdm. I do need it to run though, or the input (touch and pen) is rotated with respect to the screen, so that when I touch the screen the input is in a completely different area, making it really difficult to use the onscreen keyboard. I've looked at other questions on this site. I've tried putting my script in /etc/Xsession.d but that didn't seem to work. I also tried putting it in /etc/rc.local but I think that is the wrong place, nothing seems to happen. I've also tried googling for lightm script hooks, and various other google terms. Any suggestions? Edit 1: After doing some research, it seems to me that it might not be that I want to run a script with lightdm, but rather with the lighdm greeter (in this case, I think the unity-greeter?). Are there any script-hooks for the unity-greeter?

    Read the article

  • Chrome "refusing to execute script"

    - by TestSubject528491
    In the head of my HTML page, I have: <script src="https://raw.github.com/cloudhead/less.js/master/dist/less-1.3.3.js"></script> When I load the page in my browser (Google Chrome v 27.0.1453.116) and enable the developer tools, it says Refused to execute script from 'https://raw.github.com/cloudhead/less.js/master/dist/less-1.3.3.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled. Indeed, the script won't run. Why does Chrome think this is a plaintext file? It clearly has a js file extension. Since I'm using HTML5, I omitted the type attribute, so I thought that might be causing the problem. So I added type="text/javascript" to the <script> tag, and got the same result. I even tried type="application/javascript" and still, same error. Then I tried changing it to type="text/plain" just out of curiosity. The browser did not return an error, but of course the JavaScript did not run. Finally I thought the periods in the filename might be throwing the browser off. So in my HTML, I changed all the periods to the URL escape character %2E: <script src="https://raw.github.com/cloudhead/less%2Ejs/master/dist/less-1%2E3%2E3.js"></script> This still did not work. The only thing that truly works (i.e. the browser does not give an error and the JS successfully runs) is if I download the file, upload it to a local directory, and then change the src value to the local file. I'd rather not do this since I'm trying to save space on my own website. How do I get the Chrome to recognize that the linked file is actually a javascript type?

    Read the article

  • How do I configure upstart to run a script on shutdown when the process takes longer than 10secs?

    - by Tiris
    I am running ubuntu 11.10 in a virtual machine (VirtualBox) to learn more about development in linux. I am using a git repository to save my work and have written a script to bundle my work up and save it to the shared folder for use while the virtual machine is not running. I would like to automatically run this script before shutdown so that my work is always available if the vm is off (currently I have to manually run the script). I don't know if upstart is the best way to accomplish this, but this is the config that I wrote as a test: description "test script to run at shutdown" start on runlevel [056] task script touch /media/sf_LinuxEducation/start sleep 15 touch /media/sf_LinuxEducation/start-long end script pre-start script touch /media/sf_LinuxEducation/pre-start sleep 15 touch /media/sf_LinuxEducation/pre-start-long end script post-start script touch /media/sf_LinuxEducation/post-start sleep 15 touch /media/sf_LinuxEducation/post-start-long end script pre-stop script touch /media/sf_LinuxEducation/pre-stop sleep 15 touch /media/sf_LinuxEducation/pre-stop-long end script post-stop script touch /media/sf_LinuxEducation/post-stop sleep 15 touch /media/sf_LinuxEducation/post-stop-long end script The result is that only one touch is accomplished (the first touch in pre-start). What do I need to change to see one of the touches after the sleep to work? Or Is there an easier way to get this accomplished? Thanks in advance.

    Read the article

  • Override variables while testing a standalone Perl script

    - by BrianH
    There is a Perl script in our environment that I now need to maintain. It is full of bad practices, including using (and re-using) global variables throughout the script. Before I start making changes to the script, I was going to try to write some test scripts so I can have a good regression base. To do this, I was going to use a method described on this page. I was starting by writing tests for a single subroutine. I put this line somewhat near the top of the script I am testing: return 1 if ( caller() ); That way, in my test script, I can require 'script_to_test.pl'; and it won't execute the whole script. The first subroutine I was going to test makes a lot of use of global variables that are set throughout the script. My thought was to try to override these variables in my test script, something like this: require_ok('script_to_test.pl'); $var_from_other_script = 'Override Value'; ok( sub_from_other_script() ); Unfortunately (for me), the script I am testing has a massive "my" block at the top, where it declares all variables used in the script. This prevents my test script from seeing/changing the variables in the script I'm running tests against. I've played with Exporter, Test::Mock..., and some other modules, but it looks like if I want to be able to change any variables I am going to have to modify the other script in some fashion. My goal is to not change the other script, but to get some good tests running so when I do start changing the other script, I can make sure I didn't break anything. The script is about 10,000 lines (3,000 of them in the main block), so I'm afraid that if I start changing things, I will affect other parts of the code, so having a good test suite would help. Is this possible? Can a calling script modify variables in another script declared with "my"? And please don't jump in with answers like, "Just re-write the script from scratch", etc. That may be the best solution, but it doesn't answer my question, and we don't have the time/resources for a re-write.

    Read the article

  • Error "window" is not defined when loading Protovis from javax.script?

    - by Shane
    I am loading Protovis using javax.script: ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName(scriptEngine); engine.eval(new java.io.FileReader("protovis-d3.1.js")); But I get the following exception: Exception in thread "main" javax.script.ScriptException: sun.org.mozilla.javascr ipt.internal.EcmaError: ReferenceError: "window" is not defined. (<Unknown sourc e>#5033) in <Unknown source> at line number 5033 at com.sun.script.javascript.RhinoScriptEngine.eval(Unknown Source) at javax.script.AbstractScriptEngine.eval(Unknown Source) at RJScript.EvalScript(RJScript.java:20) at RJScript.main(RJScript.java:26) This same script runs from a browser. Do I need to do something so that the "window" is defined?

    Read the article

  • Allow user to execute a shell script without seeing its contents?

    - by Autopulated
    I'd like to have an hg hook that sends email using a gmail account. Obviously I don't want anyone to be able read the email-sending script except me or root, since it has a password in, so here's what I've tried: -rwsr-xr-x 1 james james 58 Feb 18 12:05 incoming.email.sh -rwx--x--x 1 james james 262 Feb 18 12:04 send-incoming-email.sh where incoming.email.sh is the file executed as the hook: #! /bin/bash /path/to/send-incoming-email.sh However, when I try to run as another user I get the error: /bin/bash: /path/to/send-incoming-email.sh: Permission denied The send-incoming-email.sh file works fine when I run as myself. Is what I'm trying to do possible, or will setuid not propagate to commands executed from a shell script? System is Ubuntu 10.04.2 LTS.

    Read the article

  • How to enter a bash script at the command line, but not process the script until the entire script h

    - by MHGL
    I am performing some interactive testing using HP's QuickTest Professional and Linux. I am connecting via SSH and feeding the BASH script lines directly into the command line. The problem I'm having is that the script executes as it is entered. I'm attempting to find a way that I can feed the script to the command line, but save execution until the entire script is complete. Anyone have any experience around doing this? I'll admit, it isn't the ideal way to perform this, but it's what I'm faced with at the moment. Any other suggestions are welcome. Thanks!

    Read the article

  • mac osx script - find mounted disc with name, copy file from desktop to it, when copy complete, unmount disc

    - by Joshc
    Is there some kind of mac script which finds a newly mounted disc drive that has the name 'EXAMPLE', then copies a file/folder to it and safely ejects the disc when copy has finished? I don't mind if the script needs to be executed by a short cut. And will it work if there are multiple drives plugged in? The reason I am asking is becuase i have 5000 usb memory sticks that I need to copy about 20mb worth of data to it. Thanks in advance for any ideas.

    Read the article

  • Outlook 2007 Script that sends new form email when a message is dragged and dropped into a folder

    - by Mark
    Is it possible to write a script that will allow Outlook to automatically send out a new email to a distribution list when you drag and drop and previously opened email into a specified folder? The rules only let you apply them to received and sent messages. They do not allow you to apply it to anything that is dragged and dropped after being opened. It baffles me that Novell Groupwise had this functionality but Outlook 2007 does not. If someone can assist me in writing a script/macro to provided this functionality, it would be greatly appreciated. Thank you.

    Read the article

  • How can I logoff and go to stand-by via Win XP script?

    - by Peter
    I am looking for a way to write a script (of any sort) that would both log me off my local Windows account and also immediatedly put the computer to sleep / stand-by. I've found solutions that can do one or the other but not logoff and then sleep all in one script. The SHUTDOWN command doesn't offer this and I can't find any other options either. This is for Win XP, SP3 right now but someday soon I'll want a Windows 7 solution as well. Thanks for any ideas or an explanation as to why this isn't possible. :)

    Read the article

  • Script to sell php script?

    - by DR.GEWA
    Hi ppl. I am to finish my social network web-script which should be sold license based. I wonder such thing. There is a lot of shopping carts there. Is there a one, which is specialized on selling scripts and supportings them? Or should I part by part put a forum, make an order system, wiki, and so on?

    Read the article

  • Error while running bash script that moves files

    - by K.K Patel
    I am new to bash scripting and want to create bash script that moves some days old files between source and destination as per days defined in script. When I run this script I get error line 16: syntax error near unexpected token `do' #!/bin/bash echo "Enter Your Source Directory" read soure echo "Enter Your Destination Directory" read destination echo "Enter Days" read days do find $soure -mtime +$days mv $soure $destination {} \; echo "Files $days old moved from $soure to $destination" done please help me to create this script.

    Read the article

  • Looking for BIND web interface

    - by Olivier Lalonde
    I currently manage the domains of many clients and would like to setup a BIND server so I can all manage them from one place. Now, I'm looking for a web interface to BIND that would let my clients manage their domains by themselves in case they wanted to. What web apps would be well suited for this? I'm looking for something that will only do DNS management, not something more complete like Webmin.

    Read the article

  • Apps Script Office Hours - October 4, 2012

    Apps Script Office Hours - October 4, 2012 Eric and Arun host another episode of Apps Script Office Hours. In this week's installment: - Arun talks about presenting Apps Script at the Washington DC DevFest. - They discuss the upcoming hackathon in Los Angeles (goo.gl - They answer questions about geolocation, security, ScriptDb, and shared contact management in Apps Script. For a schedule of future episodes visit developers.google.com From: GoogleDevelopers Views: 61 0 ratings Time: 24:34 More in Science & Technology

    Read the article

  • Apps Script Office Hours - August 23, 2012

    Apps Script Office Hours - August 23, 2012 In this week's episode on Google Apps Script office hours, Jan and Ikai: - Cover the release notes (goo.gl - Highlight a blog post on Google Analytics in Apps Script (goo.gl - Discuss the upcoming Apps Script hackathon in Austin, Texas (goo.gl To find out when the next office hours will be held visit: developers.google.com From: GoogleDevelopers Views: 803 16 ratings Time: 25:00 More in Science & Technology

    Read the article

  • Help writing server script to ban IP's from a list

    - by Chev_603
    I have a VPS that I use as an openvpn and web server. For some reason, my apache log files are filled with thousands of these hack attempts: "POST /xmlrpc.php HTTP/1.0" 404 395 These attack attempts fill up 90% of my logs. I think it's a WordPress vulnerability they're looking for. Obviously they are not successful (I don't even have Wordpress on my server), but it's annoying and probably resource consuming as well. I am trying to write a bash script that will do the following: Search the apache logs and grab the offending IP's (even if they try it once), Sort them into a list with each unique IP on a seperate line, And then block them using the IP table rules. I am a bash newb, and so far my script does everything except Step 3. I can manually block the IP's, but that's tedious and besides, this is Linux and it's perfectly capable of doing it for me. I also want the script to be customizable so that I (or anyone else who wants to use it) can change the variables to suit whatever situation I/they may deal with in the future. Here is the script so far: #!/bin/bash ##IP LIST GENERATOR ##Author Chev Young ##Script to search Apache logs and list IP's based on custom filters ## ##Define our variables: DIRECT=~/Script ##Location of script&where to put results/temp files LOGFILE=/var/log/apache2/access.log ## Logfile to search for offenders TEMPLIST=xml_temp ## Temporary file name IP_LIST=ipstoban ## Name of results file FILTER1=xmlrpc ## What are we looking for? (Requests we want to ban) cd $DIRECT if [ ! -f $TEMPLIST ];then touch $TEMPLIST ##Create temp file fi cat $LOGFILE | grep $FILTER1 >> $DIRECT/$TEMPLIST ## Only interested in the IP's, so: sed -e 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*$/\1/' -e t -e d $DIRECT/$TEMPLIST | sort | uniq > $DIRECT/$IP_LIST rm $TEMPLIST ## Clean temp file echo "Done. Results located at $DIRECT/$IP_LIST" So I need help with the next part of the script, which should ban the IP's (incoming and perhaps outgoing too) from the resulting $IP_LIST file. I don't care if it utilizes UFW or IPTables directly, as long as it bans the IP's. I'd probably run it as a cron task. What I'm having trouble with is understanding how to use line of the result file as a seperate variable to do something like: ufw deny $IP1 $IP2 $IP3, ect Any ideas? Thanks.

    Read the article

  • Download Script# – C# to Javascript

    - by Editor
    Script# is a C# compiler that generates JavaScript (instead of MSIL) for use in Web applications and other script-based application types such as Windows Vista Sidebar Gadgets. The primary goal of Script# is to provide a productive script development methodology for developing and maintaining Ajax applications and frameworks by leveraging the [...]

    Read the article

  • Script for run script

    - by user280926
    Hello everybody I have a script on vbscript Dim WSHShell, WinDir, Value, wshProcEnv, fso, Spath Set WSHShell = CreateObject("WScript.Shell") Dim objFSO, objFileCopy Dim strFilePath, strDestination Const OverwriteExisting = True Set objFSO = CreateObject("Scripting.FileSystemObject") Set windir = objFSO.getspecialfolder(0) objFSO.CopyFile "\\dv.rt.ru\SYSVOL\DV.RT.RU\scripts\shutdown.vbs", windir&"\", OverwriteExisting strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2") JobID = "1" Set colScheduledJobs = objWMIService.ExecQuery _ ("Select * from Win32_ScheduledJob") For Each objJob in colScheduledJobs objJob.Delete Next Set objNewJob = objWMIService.Get("Win32_ScheduledJob") errJobCreate = objNewJob.Create _ (windir & "\shutdown.vbs", "********093000.000000+660", _ True, 1 OR 2 OR 4 OR 8 OR 16 OR 32 OR 64, ,True, JobId) How make that shutdown.vbs not run once at 9:30 but run for 9:30 to 12:00

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >