Search Results

Search found 14591 results on 584 pages for 'scripting language'.

Page 81/584 | < Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >

  • Verify linux user passwords

    - by zero_r
    Hi there I got a linux server that has several dozen users. I also have the cleartext password for every user (i know - bad security). I would like to know if the passwords are correct. Since the users are all ftp users and have the nologin shell, I cannot just write a script to check if login works. How can I do a local check on passwords? Script output could look like this: $ check_userpw < user_pw_list.txt user1 ok user2 ok user3 mismatch! user4 ok Thanks

    Read the article

  • How Do I Parse a String?

    - by Russ
    I am new to bash, and I am creating a script that loops through the files in a directory and based on part of the filename, does something with the file, so far I have this: #!/bin/bash DIR="/Users/me/Documents/import/*" for f in "$DIR" do $t=?????? echo "Loading $f int $t..." done so $f will output something like this: /Users/me/Documents/import/time_dim-1272037430173 out of this, I want time_dim, the directory can be variable length and -1272037430173 is a fixed length (it's the unix timestamp btw). What is the best way to go about this?

    Read the article

  • Physical button to run scripts on a windows machine?

    - by NoCarrier
    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?

    Read the article

  • How can I check for a string match AND an empty file in the same if/then bash script statement?

    - by Mike B
    I'm writing a simple bash script to do the following: 1) Check two files (foo1 and foo2). 2) If foo1 is different from foo2 and foo1 NOT blank, send an email. 3) If foo1 is the same as foo2... or foo1 is blank... do nothing. The blank condition is what's confusing me. Here's what I've got to start with: diff --brief <(sort ./foo1) <(sort ./foo2) >/dev/null comp_value=$? if [ $comp_value -ne 0 ] then mail -s "Alert" [email protected] <./alertfoo fi Obviously this doesn't check for blank contents. Any thoughts on how to do that?

    Read the article

  • Hyper-V: determine the guest's name given the GUID

    - by syneticon-dj
    How would I go about determining the guest's name given its GUID or vice-versa, preferably with only the Hyper-V/Server Core stock install at hands? Rationale: I am in favor of having a repository of dirty tricks to revert to when in great need. To immediately quiesce all (storage) operations of a VM guest without losing the state, I used to run kill 17 <all VM's virtual processes> (signaling SIGSTOP) and resumed afterwards using kill 19 <all VM's virtual processes> (signaling SIGCONT) in ESXi/vSphere shell. I tried the same technique with Hyper-V using Process Explorer's "Suspend" functionality on the vmwp.exe processes and it seemed to work. I have yet to find a way for easily identifying the processes to suspend, though - the vmwp command line is only listing a GUID.

    Read the article

  • Programmatically reconnect to wifi network

    - by ya23
    Sometimes I work with frequently-dropping wifi connections. I can either reconnect manually or wait some time (varies from few seconds to few minutes) before windows attempts to reconnect. Is there a simple way to trigger reconnect immediately after the connection was dropped? Bonus question: In this particular case I'd blame hardware, but how can I diagnose the reason of dropping connection in general?

    Read the article

  • Kill child process when the parent exits

    - by kolypto
    I'm preparing a script for Docker, which allows only one top-level process, which should receive the signals so we can stop it. Therefore, I'm having a script like this: one application writes to syslog (bash script in this sample), and the other one just prints it. #! /usr/bin/env bash set -eu tail -f /var/log/syslog & exec bash -c 'while true ; do logger aaaaaaaaaaaaaaaaaaa ; sleep 1 ; done' Almost solved: when the top-level process bash gets SIGTERM -- it exists, but tail -f continues to run. How do I instruct tail -f to exit when the parent process exits? E.g. it should also get the signal. Note: Can't use bash traps since exec on the last line replaces the process completely.

    Read the article

  • Locate devices within a building

    - by ams0
    The situation: Our company is spread between two floors in a building. Every employee has a laptop (macbook Air or MacbookPro) and an iPhone. We have static DHCP mappings and DNS resolution so every mobile gets a name like employeeiphone.example.com, every macbook air gets a employeelaptop.example.com and every macbook pro gets a employeelaptop.example.com on the Ethernet interface (the wifi gets a dynamic IP from a small range dedicated for the purpose). We know each and every MAC address of phones and laptops, since we do DHCP static mapping (ISC DHCP server runs on linux). At each floor we have a Netgear stack of two switches, connected via 10GB fiber to each other. No VLANs so far. At every floor there are 4 Airport Extreme making a single SSID network with WPA2 authentication. The request: Our CTO wants to know who is present at which floor. My solution (so far): Every switch contains an table listing MAC address and originating port. On each switch stack, all the MAC addresses coming from the other floor are listed as coming on port 48 (the fiber link). So I came up with: 1) Get the table from each switch via SNMP 2) Filter out the ones associated with port 48 3) Grep dhcpd.conf, removing all entries not *laptop and not *iphone 4) Match the two lists for each switch, output in JSON or XML 5) present the results on a dashboard for all to see I wrote it in bash with a lot of awk and sed, it kinda works but I always have for some reason stale entries in the switch lookup tables, making it unreliable; some people may have put their laptop to sleep, their iphones drop connections after a while, if not woken up and so on..I searched left and right, we are prepared to spend a little on the project too (RFIDs?), does anybody do something similar? I can provide with the script if needed (although it's really specific to our switches and naming scheme). Thanks! p.s. perhaps is this a question for stackoverflow? please move if it so.

    Read the article

  • FTP script needs blank line

    - by Ones and Zeroes
    I am trying to determine the reason for some FTP servers requiring a blank line in the script as follows: open server.com username ftp_commands bye Refer to blank line required after username credentials. Example from: FTP from batch file another reference to the same: http://newsgroups.derkeiler.com/Archive/Comp/comp.sys.ibm.as400.misc/2008-05/msg00227.html Also discussed here: archive.midrange.com/midrange-l/200601/msg00048.html "The behavior I'm observing is the same as if I didn't specify the password to login." with an answer referring to our same fix... archive.midrange.com/midrange-l/200601/msg00053.html and archive.midrange.com/midrange-l/200601/msg00065.html Note: It is my experience that FTP questions attract uncouth responses. Admittedly FTP is outdated, but many clients still have legacy systems, which they cannot upgrade or replace. The reason thereof should not be discussed here. The intention of this question is to invite a positive response. Please do not respond if you disagree with the above. If you have never encountered this same issue, please do not respond. I suspect this may be limited to FTP scripts executed from Windows machines, but have been told that this happens often and with many different servers. My specific interest is to understand what may cause this as I have a real world example of a production system suddenly requiring this as a workaround fix, after running for many years without issue. The server belongs to a third party who claims no change on their end. Server details unknown and cannot be determined. Any help or encouragement from someone who has come across the same, would be appreciated. ps. Sorry for the many words and references to painful responses, but I have asked similar questions on serverfault and elsewhere and unfortunately got back kneejerk responses to FTP and respondents debating the validity of the question. I would truly not ask, or re-post this question online if I had a better understanding of the issue. I know of people who have seen this issue, but don't know what causes it. I am wary that this question would again turn into another irrelevant discussion. Please, I ask very nicely: Please do not respond if you have not encountered a similar issue. FURTHER EDIT: Please do not suggest changing the product. The problem is not the blank line requirement. We know this fixes the issue. The problem is not being able to explain the reason for the blank line in the first place. Slight difference, but a critical point to note wrt the answering of this question.

    Read the article

  • how to change the existing printed line in AWK

    - by manimaran
    Hi, when i execute the following line, its prints the words in newline. awk 'BEGIN { print "line one\nline two\nline three" }' like line one line two line three How can i print the info in the same line with flush the existing line. For example, while executing the loop, it should print 'one' then wipe out the line and prints 'two' then wipe out the line and prints 'three' etc. can you please assist me?

    Read the article

  • Updating shared files across computers

    - by murgatroid99
    I have a file server running Windows Server 2008 and a couple of laptops running Windows 7 on a network. There are a large number of files that all users will need access to. My plan is to have the files on both the server and the laptops because the users will need to access the files in places with no Internet access. I also want any changes made to the files on any of the laptops to propagate to the server and then propagate to the other laptops whenever they connect to the network. Should I do this with a scheduled batch script with a few xcopy commands or is there a better way to do it?

    Read the article

  • .bat file - Nagios v3.2 service check and start if stopped

    - by LbakerIT
    I'm just barely getting into programming so I do apologize for my ignorance. I'm trying to create a .bat file that will check if a service is running on XP Pro. If service is running it will exit 0. If the service is stopped start service wait 10 seconds (via ping i'm guessing) check if service is running if service is running exit 0 if service is stopped start service wait 10 seconds Do this check a total of 3 times. if service does not come up within that time: exit 2 Exit 0 = ok exit 1 = warning exit 3 = critical (and this will alert) I need to do this for 3 different services but i'm expecting that it would be better to create one per service. That way you get notified on the specific service that is not coming back up. The goal is that if the service stops it will start it. If after 30 seconds it is unable to start the service then it will send an alert. The reason I'm trying to do it with a .bat is this is consistent with all other scripts and I did not want to complicate it further by adding different kinds of code. Yay for consistency! Again I do apologize for my ignorance I've been thrown into this project last minute. Thank you for the help and reading my question!

    Read the article

  • Is there any script to do accounting for the proftpd's xferlog?

    - by Aseques
    I would like to convert from the xferlog format that proftpd uses into per user in/out bytes, to have a summary on how much traffic does each user use per month. The exact format is this: Thu Oct 17 12:47:05 2013 1 123.123.123.123 74852 /home/vftp/doc1.txt b _ i r user ftp 0 * c Thu Oct 17 12:47:06 2013 2 123.123.123.123 86321 /home/vftp/doc2.txt b _ i r user ftp 0 * c So far I only found a script that makes a nice report but not exactly what I needed, that one can be found here I might create a fork of this one and place it somewhere but it probably has been done a lot of times already. Just found a well hidden page in proftpd site with some more examples here

    Read the article

  • Different behaviour of script locally and over ssh

    - by neorg
    I have a script on a server-A Script-A #!/bin/bash -l echo "script-A.sh" | change-environment.sh When I ssh onto server-A and execute it, it works fine. However, when I ssh user@server-A ./script-A.sh Script-A executes, but throws an undefined variable error in change-environment.sh. change-environment.sh runs in the c shell(I have no control over the script so the method I have used is about the only way I can use it), but everything else is in bash. Had found a similar question at I can run a script locally, but cannot do "ssh HOSTNAME /path/to/script.sh". However, there was no solution to the issue and it was a year old.

    Read the article

  • Run shell script on Linux box from a shortcut/app in Android?

    - by melat0nin
    I have an Ubuntu box which runs XBMC, which crashes occasionally. Since I have no keyboard connected,I have to SSH in, kill xinit, then restart it. I was wondering if there's an elegant way of doing this from my Android tablet, so I don't have to go to my desktop PC. I've used ConnectBot and can log in, but typing is laborious, even using the edit keys to scroll back up through the buffer. It seems as though it should be possible to script this so that I can execute a shortcut, or at least select a predefined script to be executed. This would seem to have plenty of applications, and there could be a site of scripts - restart webserver, reboot, email logs etc

    Read the article

  • find directories in the current directory, older than 5 days and archive them

    - by user197284
    This is basic questions. I need to find folders in the current working directory(not recursively) and if they are older than 5 days archive them. zip or tar.gz is fine. I can find the folders with following commands find ./ -maxdepth 1 -type d -mtime +5 And i know i can pass this output of the find using xargs. But i do not know how to archive with folder name intact. That is the directory test1 should be archived to test1.zip and directory "test2" should be archived to "test2.zip". Any inputs are welcome. Regards

    Read the article

  • Dialog in linux

    - by user35319
    Hi everyone, I want to show the contents of file on Dialog box for which i have use the "--textbox" dialog and "--tailbox" dialog but it dont show the whole contents of file just show some data not the whole data of file...i searched alot but found nothing so if anyone have any idea plz let me know bcoz i have been trying so much to fix the problem...

    Read the article

  • Looking for a powershell script that can pull a file from a set of PC's and FTP

    - by DangeRuss
    I'm looking to write a script (preferably powershell) that will essentially copy a file from a bunch of PC's and FTP it to a server. So the structure of the environment is that we have a file on multiple PC's (around 50 or so) that need to placed on a server. Sometimes one of the PC's may be turned off so the script would first need to ensure the PC is up and running (maybe a ping result), then it would need to go into a directory on that PC, pull a file off of it, rename the file, place into a source directory, then remove the file. Naming convention doesn't matter, but date/time stamp would be easiest. Ideally, it would be best to first move all the files to a source directory to save on FTP bandwidth, but since the files will be named the same, the files must be renamed during the move process. Move not copy because the directory needs to be empty so the file can be re-created the next day. So once moved to the source directory, now all the files need to be FTP'd to a server for processing. After all of this, we need to know which PC's on the list did not respond so we can manually retrieve the file so the script should output a file (txt is fine) that will show which PC's were offline. Everything is one domain and script will be run from an server with admin creds. Thank you!

    Read the article

  • Programmatic, script-based, or command line method to change starting program for user on Windows Server 2000/2003?

    - by Joe Majsterski
    I have written an app that we want to distribute to a large number of customers to be used as the shell program when they log onto their server with a particular admin account. I have figured out how to change the starting program by going to Administrative Tools->Computer Management->System Tools->Local Users and Groups->Users, selecting the properties for the user, going to the Environment tab, and changing the program file name under "Starting program" to my new app. But is there a way I could do this with some code that could be sent out and run on all these servers?

    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

  • Remotely initiate windows updates

    - by TetraFlash
    I have a network with countless workstations on it and the windows updates are done through WSUS in push cycles to allow us to use a generic image and configuration and avoid network congestion. I have a number of workstations in storage that are connected once a month for a few days to recieve updates, however not all of them fall within their push cycle. I want to avoid going to each machine and clicking "check updates" as that would require me to connect a monitor, mouse and keyboard. Is there a way (preferably through powershell but im open minded) to initiate a check and install of updates on a remote system? Lets say for 1 system at a time right now, I can add a file reader and a look later. NOTE: the configuration of the WSUS server is above my pay grade, im simply being asked to ensure these machines are updated. Thanks for any help or hints

    Read the article

  • Shell script for daily disk usage report

    - by Master
    I am doing backups on my local drives. The drives are mounted in /media folder. Now i want to run cron job daily which will tell in table format how much disk is used by folder and how much free space is left on drive It would be good if i can insert that info in database and i can see that info use webpage on locahost ubuntu 10

    Read the article

  • Linux/Solaris replace hostnames in files according to hostname rule

    - by yael
    According to the following Perl command ( this command part of ksh script ) I can replaced old hostnames with new hostnames in Linux or Solaris previos_machine_name=linux1a new_machine_name=Red_Hat_linux1a export previos_machine_name export new_machine_name . perl -i -pe 'next if /^ *#/; s/(\b|[[:^alnum:]])$ENV{previos_machine_name}(\b|[[:^alnum:]])/$1$ENV{new_machine_name}$2/g' file EXPLAIN: according to perl command - we not replaces hostnames on the follwoing case: RULE: [NUMBERS]||[letter]HOSTNAME[NUMBERS]||[letter] my question after I used the Perl command in order to replace all old hostnames with new hostnames based on the "RULE" in the Perl command how to verify that the old hostnames not exist in file ? for example previos_machine_name=linux1a new_machine_name=Red_Hat_linux1a more file AAARed_Hat_linux1a verification should be ignore from this line @Red_Hat_linux1a$ verification should be match this line P=Red_Hat_linux1a verification should be match this line XXXRed_Hat_linux1aZZZ verification should be ignore from this line . . . .

    Read the article

< Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >