Search Results

Search found 24208 results on 969 pages for 'cmd script'.

Page 10/969 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Setting the Timezone with an automated script

    - by Tom
    I'm writing scripts to automate setting up new slicehost installations. In a perfect world, after I started the script, it would just run, with no attention from me. I have succeeded, with one exception. How do I set the timezone, in a permanent (survive reboot) and sane (adjust for standard and daylight savings time, so no just forcing the date) ... manner that doesn't require input from me? Currently, I'm using dpkg-reconfigure tzdata This doesn't seem to have any way to force parameters into it. It demands user input. EDIT: I'm editing here, rather than commenting, since comments don't seem to allow code blocks. Here's the actual code I ended up with, based on Rudedog's comment below. I also noticed that this doesn't update /etc/timezone. I'm not certain who uses that, but in case anybody does, I'm setting that too. TIMEZONE="America/Los_Angeles" echo $TIMEZONE > /etc/timezone cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime # This sets the time

    Read the article

  • dialup connection script

    - by BParker
    I've just started working for a company who produce a specialist modem. In the test department they simulate actual use with a bunch of pc's acting as clients connecting over this modem. As such each needs to dial a set of dial-up connections. Each of these has to be created manually, and currently takes quite a while on each machine, so i was hoping to be able to automate the creation process. Back in the early days of the internet i remember getting CD's from ISP's where the dial-up connection was configured automatically, and i was wondering if anyone lknew how to do this, or if they could point me in the direction of a tutorial about it. To be clear, i don't want to automate actually dialing the connection, but i do want to run a script which creates the icons in the networking applet that allows us to dial these connection. Thanks in advance!!!

    Read the article

  • Need leading zero for batch script using %time% variable

    - by Ira
    Hi, I came across a bug in my DOS script that uses date and time data for file naming. The problem was I ended up with a gap because the time variable didn't automatically provide leading zero for hour < 10. So running echo %time% gives back: ' 9:29:17.88'. Does anyone know of a way to conditionally pad leading zeros to fix this? More info: My filename set command is: set logfile=C:\Temp\robolog_%date:~-4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.log which ends up being: C:\Temp\robolog_20100602_ 93208.log (for 9:23 in the morning). This question is related to this one. Thanks

    Read the article

  • Automatic Excel Script

    - by Thomas
    I am a 6th year medical student and I'm working on my thesis. I have no experience with programming whatsoever, a friend recommended me to post my question here. I am strugling with the following problem: I have data of 400 patients, stored in 400 different excel files. Each file contains 34 columns in a specific order, let's say A to Z. The order is the same in each of these 400 files. Now I need to a make a new excel document that contains the first column of each patient. So I need all the first columns of my 400 different excel files, lined up next to each other in a new document. Preferebally in the form of a automatic script. After that I want to do the exact same thing but for the second column, then the third and so on. This is probably a problem that has already been solved. Otherwise could someone help me out? You have my thanks!

    Read the article

  • Script to restart BlackBerry services

    - by ICTdesk.net
    Can somebody give me a script advice/example of how to restart services? I have to restart 17 services, but the first 4 services have to be in the right order and after the restart command is given to one of the services, the next one should be started when the previous one is finished. I know I can restart a service by net command, and I can build a delay by for example a ping command that repeats for an x amount of times, but I never know in advance how long it is going to take for a service to restart. Thanks, Kindest regards, Marcel

    Read the article

  • Refining an AutoHotkey script

    - by roy2012
    The purpose of this script is: The first two rows of hotkeys always effective. The remaining hotkeys work at NO TEXT INPUT Status only. In other words, when the small vertical lines are flashing anywhere on the screen and waiting for input text / digital, press zxasq, the effect is equal to the normal original letters. How can I do that? Rwin::^space AppsKey::^w CapsLock::MButton z::PgUp x::PgDn *a up::send {shift up}{ctrl up}{LButton up} *a:: GetKeyState, LButtonState, LButton ; if LButtonState = U ; send {shift down}{ctrl down}{LButton down} ; return *s up::send {shift up}{ctrl up}{RButton up} *s:: GetKeyState, RButtonState, RButton ; if RButtonState = U ; send {shift down}{ctrl down}{RButton down} ; return *q up::send {shift up}{ctrl up}{MButton up} *q:: GetKeyState, MButtonState, MButton ; if MButtonState = U ; send {shift down}{ctrl down}{MButton down} ; return

    Read the article

  • bash shell script which adds output of commands

    - by John Kube
    Let's say I have a command called foo which prints a number to the screen when called: $foo 3 Let's also say I have another command called bar which prints another number to the screen when called: $bar 5 I'm looking to write a shell script which will add together the output of foo and bar. How would I do that? (The outputs from the commands are not known ahead of time. They just so happen to have been 3 and 5 the last time they were run. They could have been something else.) Thanks!

    Read the article

  • Postgresql starup script for second instance?

    - by Andrius
    I need to run my second postgresql instance when linux boots. I added this command (like in postgresql documentation) in rc.local: /usr/lib/postgresql/9.1/bin/pg_ctl start -l logfile -D /var/lib/postgresql/9.1/main2 But if I try to run pg_ctl: cannot be run as root Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process. t, it gives me this error: How can I specify to run that command as postgres, but actually execute it with root (because root owns it). Or is there some better way to make second init script for postgresql? P.S. (I'm using Ubuntu)

    Read the article

  • Can not understand this script

    - by Jim
    Can someone help me understand this script? It is from sysconf_add and I am new to scripting. I need to do something similar. function add_word() { local word=$1 local word_quoted=$2 if ! word_present; then $debug && cp $file $tmpf sed -i -e "${lineno} { s/^[[:space:]]*\($var=\".*\)\(\".*\)/\1 $word_quoted\2/; s/=\" /=\"/ }" $file $debug && diff -u $tmpf $file else echo \"$word\" already present fi # some balancing for vim"s syntax highlighting }

    Read the article

  • script to automatically test if a web site is available

    - by Xoundboy
    I'm a lone web developer with my own Centos VPS hosting a few small web sites for my clients. Today I discovered my httpd service had stopped (for no apparent reason - but that's another thread). I restarted it but now I need to find a way that I can be notified by email and/or SMS if it happens again - I don't like it when my client rings me to tell me their web site doesn't work! I know there are probably many different possibilities, including server monitoring software. I think all I really need is a script that I can run as a cron job from my dev host (which is permanently running in my office) that attempts to load a page from my production server and if it doesn't load within say 30 seconds then it sends me an email or SMS. I'm pretty rubbish at shell scripting, hence this question. Any suggestions would be gratefully appreciated, thanks to all you clever sysadmin guys and girls out there :)

    Read the article

  • Start Daemonised GNU Screen from script a allow calling script to end

    - by tez
    I have a script on an embedded device that calls screen to start if a user logs in via a ssh session... #!/bin/sh SCREENRUNNING=`pgrep SCREEN` if [ -z "$SCREENRUNNING" ]; then echo "Screen not running so let's start the Master session sleep 2 screen -dmS Master sleep 2 screen -x root/Master else echo "Screen is already running let's connect to existing session" sleep 2 screen -x root/Master fi However this keeps the calling script active till the screen session exits,even if it's detached. What I want to do is have the calling script finish and exit while the screen session stays active. I've tried daemonising the screen -x lines and adding an & to the end of the screen -x lines neither of which work properly. Ideas?

    Read the article

  • Windows script to create directories of 3,000 files

    - by uhpl1
    We have some email archiving that is dumping all the emails into a directory. Because of some performance reasons with the server, I want to setup an automated task that will run a script once a day and if there is more than 3,000 (or whatever number) of files in the main directory, create a new directory with the date and move all the main directory files into it. I'm sure someone has already written something similar, so if anyone could point me at it that would be great. Batch file or Powershell would both be fine.

    Read the article

  • Start ELEVATED script from within script

    - by Ulrich
    Hallo, I'm playing around with Powershell (relative NewBie) and I'm looking for the easiest way to call a Powershell script with elevated rights from within another script. I know of the runas verb for start-process which allows me to start a new script with a different account. My problem is, however, that under Vista (UAC active) every admin account has two access tokens, a normal privilege one and an elevated one. If I use the runas method, the second scripts gets started under the right account but with the non-elevated access token. Is there an easy way to control this? Thanks a lot for your help! Ulrich

    Read the article

  • Launching multiple applications with a single command/script/shortcut

    - by Bill
    I realized a few days ago that every time I sit down at work, I do a few things after unlocking my computer. First, I open up Firefox, then I open up Chrome, then I log in to Digsby. I realized I could probably save repeating this daily by writing a small batch script to open up Firefox and Chrome , but I couldn't figure out how to make it work.. and since the whole effort is to save time I don't want to bash my head around in the windows command prompt to do it. I also tired this in powershell but ran in to a bunch of security nonsense. Is there a way to do this that I am missing? Bonus points if somebody has figured out how to manipulate Digsby via COM , scripting, or python =)

    Read the article

  • Shell script to read value from a file and compare it to another one

    - by maneeshshetty
    I have a C program which puts one unique value inside a test file (it would be a two digit number). Now I want to run a shell script to read that number and then compare with my required number (e.g. 40). The comparison should deliver "equal to" or "greater". For example: The output of the C program is written into the file called c.txt with the value 36, and I want to compare it with the number 40. So I want that comparison to be "equal to" or "greater" and then echo the value "equal" or "greater".

    Read the article

  • Tool to launch a script driven by modem activity

    - by Will M
    Can anyone suggest a software tool (preferably under Windows XP or later) that would launch an application or script in response to a phone call being received on a landline phone line connected to a data modem on the same PC? or, better, in response to a sequence of touch-tones being played over such a phone line. This would allow, for example, using the telephone to manipulate firewall settings so as to create another layer of security in connection with remote internet access to that computer. I seem to recall seeing tools to do this sort of thing in the days before broadband internet access, when there was more attention to various tips and tricks for the dial-up modem, but a few attempts at Google hasn't turned anything up.

    Read the article

  • Launching multiple applications with a single command/script/shortcut

    - by Bill
    I realized a few days ago that every time I sit down at work, I do a few things after unlocking my computer. First, I open up Firefox, then I open up Chrome, then I log in to Digsby. I realized I could probably save repeating this daily by writing a small batch script to open up Firefox and Chrome , but I couldn't figure out how to make it work.. and since the whole effort is to save time I don't want to bash my head around in the windows command prompt to do it. I also tired this in powershell but ran in to a bunch of security nonsense. Is there a way to do this that I am missing? Bonus points if somebody has figured out how to manipulate Digsby via COM , scripting, or python =)

    Read the article

  • A script so that you don't forget your usb drive on a public computer

    - by Ava Gailliot
    So I have a problem because I'm an idiot. I seem to always leave my usb drives in public computers at school and the like. I unmount them and log off leaving them still in the pc, and of course I then lose my information and my drive which can be costly. Is there a small script somewhere that I can install to my drive that prompts me to take out my usb stick when I log off of a computer? Since this is mostly for use with public computers I can't put anything on my drive that will later need some sort of admin permissions. I guess if all else fails I'll probably put my drive on a lanyard and keep it around my wrist. lol. Does anyone else have this problem?

    Read the article

  • (date) script for freenas

    - by malgaboy
    My webserver is running freenas 8.0.4. Currently in /etc/crontab there is this task (daily) find /mnt/vol1/1 -type f -mtime +16 -exec rm -R {} \; This allow me to delete files older than 16 days.. infact every night a new file is added in /mnt/vol1/1 folder.. but now I wanna make a script that check the folder and keeps only the youngest 2 file.. whitout taking in consideration the days.. Thanks in advance. (sorry for my bad english).

    Read the article

  • Enjoy How-To Geek User Style Script Goodness

    - by Asian Angel
    Most people may not be aware of it but there are two user style scripts that have been created just for use with the How-To Geek website. If you are curious then join us as we look at these two scripts at work. Note: User Style Scripts & User Scripts can be added to most browsers but we are using Firefox for our examples here. The How-to Geek Wide User Style Script The first of the two scripts affects the viewing width of the website’s news content. Here you can see everything set at the normal width. When you visit the UserStyles website you will be able to view basic information about the script and see the code itself if desired. On the right side of the page is the good part though. Since we are using Firefox with Greasemonkey installed we chose the the “install as a user script option”. Notice that the script is available for other browsers as well (very nice!) Within a few moments of clicking on the “install as a user script button” you will see the following window asking confirmation for installing the script. After installing the user style script and refreshing the page it has now stretched out to fill 90% of the browser window’s area. Definitely nice! The How-To Geek – News and Comments (600px) User Style Script The second script can be very useful for anyone with the limited screen real-estate of a netbook. You can see another of the articles from here at the site viewed in a  “normal mode”. Once again you can view basic information about this particular user style script and view the code if desired. As above we have the Firefox/Greasemonkey combination at work so we installed as a user script. This is one of the great things about using Greasemonkey…it always checks with you to make certain that no unauthorized scripts are added. Once the script was installed and we refreshed the page things looked very very different. All the focus has been placed on the article itself and any comments attached to the article. For those who may be curious this is what the homepage looks like using this script. Conclusion If you have been wanting to add a little bit of “viewing spice” to your browser for the How-To Geek website then definitely pop over to the User Styles website and give these two scripts a try. Using Opera Browser? See our how-to for adding user scripts to Opera here. Links Install the How-to Geek Wide User Style Script Install the How-To Geek – News and Comments (600px) User Style Script Download the Greasemonkey extension for Firefox (Mozilla Add-ons) Download the Stylish extension for Firefox (Mozilla Add-ons) Similar Articles Productive Geek Tips Set Up User Scripts in Opera BrowserSet Gmail as Default Mail Client in UbuntuHide Flash Animations in Google ChromeShell Script to Upload a File to the Same Subdirectory on a Remote ServerAutomate Adding Bookmarks to del.icio.us TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Quickly Schedule Meetings With NeedtoMeet Share Flickr Photos On Facebook Automatically Are You Blocked On Gtalk? Find out Discover Latest Android Apps On AppBrain The Ultimate Guide For YouTube Lovers Will it Blend? iPad Edition

    Read the article

  • How to do proper Unicode and ANSI output redirection on cmd.exe?

    - by Sorin Sbarnea
    If you are doing automation on windows and you are redirecting the output of different commands (internal cmd.exe or external, you'll discover that your log files contains combined Unicode and ANSI output (meaning that they are invalid and will not load well in viewers/editors). Is it is possible to make cmd.exe work with UTF-8? This question is not about display, s about stdin/stdout/stderr redirection and Unicode. I am looking for a solution that would allow you to: redirect the output of the internal commands to a file using UTF-8 redirect output of external commands supporting Unicode to the files but encoded as UTF-8. If it is impossible to obtain this kind of consistence using batch files, is there another way of solving this problem, like using python scripting for this? In this case, I would like to know if it is possible to do the Unicode detection alone (user using the scripting should not remember if the called tools will output Unicode or not, it will just expect to convert the output to UTF-8. For simplicity we'll assume that if the tool output is not-Unicode it will be considered as UTF-8 (no codepage conversion).

    Read the article

  • What is wrong with this recursive Windows CMD script? It won't do Ackermann properly

    - by boost
    I've got this code that I'm trying to get to calculate the Ackermann function so that I can post it up on RosettaCode. It almost works. I thought maybe there'd be a few batch file wizards on StackOverflow. ::echo off set depth=0 :ack if %1==0 goto m0 if %2==0 goto n0 :else set /a n=%2-1 set /a depth+=1 call :ack %1 %n% set t=%errorlevel% set /a depth-=1 set /a m=%1-1 set /a depth+=1 call :ack %m% %t% set t=%errorlevel% set /a depth-=1 if %depth%==0 ( exit %t% ) else ( exit /b %t% ) :m0 set/a n=%2+1 if %depth%==0 ( exit %n% ) else ( exit /b %n% ) :n0 set /a m=%1-1 set /a depth+=1 call :ack %m% %2 set t=%errorlevel% set /a depth-=1 if %depth%==0 ( exit %t% ) else ( exit /b %t% ) I use this script to test it @echo off cmd/c ackermann.cmd %1 %2 echo Ackermann of %1 %2 is %errorlevel% A sample output, for Test 1 1, gives: >test 1 1 >set depth=0 >if 1 == 0 goto m0 >if 1 == 0 goto n0 >set /a n=1-1 >set /a depth+=1 >call :ack 1 0 >if 1 == 0 goto m0 >if 0 == 0 goto n0 >set /a m=1-1 >set /a depth+=1 >call :ack 0 0 >if 0 == 0 goto m0 >set/a n=0+1 >if 2 == 0 (exit 1 ) else (exit /b 1 ) >set t=1 >set /a depth-=1 >if 1 == 0 (exit 1 ) else (exit /b 1 ) >set t=1 >set /a depth-=1 >set /a m=1-1 >set /a depth+=1 >call :ack 0 1 >if 0 == 0 goto m0 >set/a n=1+1 >if 1 == 0 (exit 2 ) else (exit /b 2 ) >set t=2 >set /a depth-=1 >if 0 == 0 (exit 2 ) else (exit /b 2 ) Ackermann of 1 1 is 2

    Read the article

  • capturing CMD batch file parameter list; write to file for later processing

    - by BobB
    I have written a batch file that is launched as a post processing utility by a program. The batch file reads ~24 parameters supplied by the calling program, stores them into variables, and then writes them to various text files. Since the max input variable in CMD is %9, it's necessary to use the 'shift' command to repeatedly read and store these individually to named variables. Because the program outputs several similar batch files, the result is opening several CMD windows sequentially, assigning variables and writing data files. This ties up the calling program for too long. It occurs to me that I could free up the calling program much faster if maybe there's a way to write a very simple batch file that can write all the command parameters to a text file, where I can process them later. Basically, just grab the parameter list, write it and done. Q: Is there some way to treat an entire series of parameter data as one big text string and write it to one big variable... and then echo the whole big thing to one text file? Then later read the string into %n variables when there's no program waiting to resume? Parameter list is something like 25 - 30 words, less than 200 characters. Sample parameter list: "First Name" "Lastname" "123 Steet Name Way" "Cityname" ST 12345 1004968 06/01/2010 "Firstname+Lastname" 101738 "On Account" 20.67 xy-1z 1 8.95 3.00 1.39 0 0 239 8.95 Items in quotes are processed as string variables. List is space delimited. Any suggestions?

    Read the article

  • Python script as a service on Ubuntu 11.10

    - by bugs99
    I am facing the following problem. I want to run a python script as a service on Ubuntu 11.10 system (already mentioned in the following link: Python service using Upstart on Ubuntu) I followed the steps mentioned in the above mentioned link, but i got the following error message in syslog: init: script main process (21826) terminated with status 1 Jun 8 16:59:55 bilbo kernel: [263012.984531] init: script main process ended, respawning Jun 8 16:59:55 bilbo kernel: [263013.044099] init: script main process (21827) terminated with status 1 The above two lines are getting repeated all the time. On saying sudo start script, I get the following: $ sudo start script script start/running, process 21826 Following is the content of my script.conf placed in /etc/init: description "Used to start python script as a service" author "bilbo" start on runlevel [2] stop on runlevel [06] exec python /home/bilbo/scripts/webserver.py respawn Please tell me what I am doing wrong? Do I have to change my python code as well?

    Read the article

  • script to run sox to combine multiple mono tracks to stereo

    - by Ze'ev
    I have a folder full of .wav audio files. Some are stereo, most are mono splits. The mono split pairs are all named foo bar track.L.wav and foo bar track.R.wav I can use the command line tool sox to combine a mono pair into 1 stereo track like this: sox -M track1.L.wav track1.R.wav track1.Stereo.wav where the first 2 files are the mono pairs, and the third is the output stereo file. This is great, but I'd like to have a script that will automatically find all the mono pairs and combine them into stereo files. I.e., I need it to find all files which have the same name except for the .L. and .R. before the extension, and run sox on them, outputting to a new file with the same name without the L/R suffix. For example, if my folder contains these files: track1.L.wav track2.L.wav track3.L.wav track4.L.wav track1.R.wav track2.R.wav track3.R.wav track4.R.wav track6.wav track7.wav I need to run these commands: sox -M track1.L.wav track1.R.wav track1.Stereo.wav sox -M track2.L.wav track2.R.wav track2.Stereo.wav sox -M track3.L.wav track3.R.wav track3.Stereo.wav sox -M track4.L.wav track4.R.wav track4.Stereo.wav Here's where I am so far: for file in ./*.L.wav; do file2=`echo $file | sed 's_\(.*\).L.wav_\1.R.wav_'`; out=`echo $file | sed 's_\(.*\).L.wav_\1.STEREO.wav_'`; echo $file - $file2 - $out; done That works, but when I replace the echo line with sox -M $file $file2 $out; it doesn't work; spaces in the filenames cause it to fail.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >