Tag Info

New answers tagged

0

First of all I encountered 2 errors trying to recreate your problem date: extra operand 11:34:14' Trydate --help' for more information. ./script.sh: line 15: 1408448098: No such file or directory From what I understand you isolated the dates which interest you into file.txt according to user input and you want to count occurrences in there. I coded ...


1

This means that I create AD Group, enable mail, and put users I want, in. Then, the replication will synchronize AD Group with O365 (with DirSync if I'm right). That's pretty much it, yes. There's plenty of resources out there covering the installation and setup of DirSync, and you may refer to this table of attributes that are synced from ...


0

I re-wrote the script a bit and got it working without using the FTP protocol. I changed it to use the move command instead: $down = "C:\Script\log\down-hosts.log" $computers = Get-Content "C:\Script\list\Computers.txt" $TargetPath = "\\ServerName\ShareName\Path" $SourceFileName = "source_file.csv" foreach ($computer in $computers) { if ( Test-Connection ...


0

Use the following to calculate the lines between two time variables. Put the following code in a file called countOcurrences. #!/bin/bash awk "/$1/,/$2/"'{count++} END{ printf "There are %s lines\n", count}' con/scripts_server/file.txt Run it as follow. ./countOcurrences "2014-08-19 11:30:07" "2014-08-19 11:34:07" If file.txt is filled with a new ...


0

There are solutions to this problem all over the forum and blog sites @MonkeyMagix. What you need to do is restore the msdb backup as msdb_old (or something similar), then run code against the _old DB to 1) build the code that creates the Agent jobs from the _old DB; http://www.sqlservercentral.com/scripts/generate+jobs+scipts/68105/ or 2) insert the ...


0

You are getting a misleading error since it is probably trying to execute a POST request on the sftp backend you have specified. The UploadFile method sends a local file to a resource. This method uses the STOR command to upload an FTP resource. For an HTTP resource, the POST method is used. Reference: ...


1

This is exactly what Ansible is used for. There is no agent, you just have to create a text file called: /etc/ansible/hosts with content that looks something like: [webhosts] web[1-8] This would specify that machines "web1, web2...web8" are in the group "webhosts". Then you can do things like: ansible webhosts -m service -a "name=apache2 ...


0

I just ran into this issue on Ubuntu, and I fixed it a little differently. I am using the isc-dhcp-server service but it was attempting to start before the required interface was up, crashing, and then exhausting the respawn limit. I made a small edit to the start on line in the upstart config file in /etc/init: start on runlevel [2345] and net-device-up ...


0

Check this script. it's checking against a list of websites and sends email (to list of emails) whenever something wrong (http response different from 200). The script creates a .temp file to "remember" which website(s) failed at last check so you won't get multiple emails. the .temp file is deleted when the website is working again. #!/bin/bash # list of ...


0

Use the -n flag, combined with the -c checksum flag and the -i flag: # rsync -naic test/ test-clone/ >fcst...... a.txt >fcst...... abcde.txt >fcst...... b.txt In this example, only one file has changed, based on the contents of the file itself. However, no file syncing is done because of the -n flag Bonus If you want to run chown on the changed ...


1

You can use rsync's --itemize-changes (-i) option to generate a parsable output that looks like this: ~ $ rsync src/ dest/ -ai .d..t.... ./ >f+++++++ newfile >f..t.... oldfile ~ $ echo 'new stuff' > src/newfile ~ $ !rsync rsync src/ dest/ -ai >f.st.... newfile The > character in the first position indicates a file was updated, the ...


0

Notepad++ installer uses NSIS installer system. You can leverage its default switches to accomplish that. http://nsis.sourceforge.net/Which_command_line_parameters_can_be_used_to_configure_installers eg.: npp.6.6.8.Installer.exe /S /D=d:\software\npp Note:/D option does not support quotes


3

You could do this: $fileName = (Get-Date -Format ddMMyyyy) + ".txt" $location = "C:\All_Local_Admins\" New-Item -ItemType file -Name $fileName -Path $location And replace your out-file with this: out-file -append -FilePath (Join-Path $location $fileName)


0

If you are using chpasswd from with in a fabric, then make sure not to use the plain text password from the command line. It is not just the stdout where the password will be displayed, it will also be written to /var/log/secure. In Fabric you can use with hide('running', 'output', 'error'): <your task here> And make sure you use hash string ...


0

Did you append your code directly into the 0anacron file?? That's what's wrong here; don't do that. check the man page for anacron: Anacron can be used to execute commands periodically, with a frequency specified in days. Unlike cron(8), it does not assume that the machine is running continuously. Clearly, this is not related to what you are ...


0

While I'm not exactly sure of the AppPool name, you should be able to recycle an app pool with appcmd. For example: appcmd recycle apppool /apppool.name: DefaultAppPool You can also use PowerShell, by adding WebAdministration and executing Restart-WebAppPool. For example: Restart-WebAppPool DefaultAppPool How you execute this would be up to you. Maybe ...


0

Use "netdom move" to rejoin the remote machine to the domain, effectively repairing the relationship. You'll use local credentials to connect and your domain admin account to rejoin. If the computer object still exists in the domain, you'll need to use an account that has full control of the object (like Domain Admin). Here is the command: netdom move ...


3

Create a wrapper script like so: #!/bin/sh echo "`date` `whoami` $0 $*" >> /tmp/bash3_use.log /bin/bash3.bin "$@" Then rename bash3 to bash3.bin and name this script "/bin/bash3" You may need to log more information, e.g., the working directory.


6

Lets ignore that periodically rebooting server a DC is generally a bad idea, and shouldn't be required. Lets just focus on the part of your question about schedule tasks, and managing password for the account you use. The answer to your core question is that in recent versions of Windows you are supposed to use Managed Service Accounts. Of course if your ...


-1

You need to grep /etc/shadow syntax is username:password:... you need password = * So something like this: sudo cat /etc/shadow | grep '^[^:]*:.\?:' | cut -d: -f1



Top 50 recent answers are included