Scripting Languages

26K

Solutions

72

Articles & Videos

20K

Contributors

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.

Share tech news, updates, or what's on your mind.

Sign up to Post

Need assistance with a powershell/vbs script to do the following:

We need to monitor the following path \\SERVER\folder.  When a new folder is created that's an indication of a failure of a background process. Once the new folder is detected we need to send an email alert. We are looking to received the alert only when newly created folders (now-15 minutes or so)or just the last date (compare with the most recent folder date creation) if newer then sent alert.

We do have SCOM and so we might run the script from there otherwise from the server itself (windows server)

Can you someone please assist
0
Major Incident Management Communications
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Hi
We send over a hundred invoices out at each two week billing cycle.  Currently the process is manual, and takes two accountants the better part of a day to send invoices out.

Invoices always follow the same naming convention, where the file name starts with the project code (example:  COS1012141 - client abc - invoice 24792.pdf"

We have a lookup table, that includes columns with project #, receipient email address, recipient name, etc.

What we're hoping to be able to do is point some application at a folder that has the 100+ PDF invoices, and somehow generate an email addressed to the receipient email address (from the lookup file), a greeting to the receipient name, and the respective attachment.  Then do that for each attachment.

I'm hoping there's an application out there somewhere, but worst case, is this something that can be built?

Open to suggestions.
0
I have linux server and i want to count pdf pages is colored or bw.

i have used imagemagic but it takes serverd down so can you help me with alternative way?
0
Im using script to get the uptime of list of servers.. How to add 3 more columns to show Avg CPU, Memory utilization and C disk utilization using powershell


CLS
Write-Host "One moment please... Setting up..."


$ServerNameOption = "File"
$ServerNameFile = "C:\ttt.txt"
$BGColorColumn = "#BFC3C4"
$BGColorOnline = "#6DC046"
$BGColorOffline = "#D43235"
$BGColorReportTotal = "#4AA7E1"
$SendEmail = "True"
$ShowOnScreen = "False"
$ShowHTMLOnScreen = "False"
$ReportOutFile = "D:\test.html"

  
<#==============================
SMTP Settings
Edit with your email settings:
================================#>
$smtpsettings = @{
	To =  "receiver"
	From =  "Sender"
	Subject = "Server Report for $(Get-Date -Format D)"
	SmtpServer = "smtp"
	}

<#========
Counters
==========#>
$ServerCount = 0
$SuccessCount = 0
$UnreachableCount = 0


<#====================
HTML Report Settings
======================#>
$Report = "
	<html>
	<head>
		<title> ServerReport </title>
	</head>
	<body {background-color:#D7D8D8;}>
		<H1 Align=`"Center`"> <B>Report </B></H1>
		<H3 Align=`"Center`"> $(Get-Date -Format D) </H3>
		<H3 Align=`"Center`"> $(Get-Date -Format T) </H3>
		<table Border=`"1`" CellPadding=`"3`" Align=`"Center`">
			<tr>
				<td BGColor=$BGColorColumn Align=center><b> SERVER NAME </b></td>
				<td BGColor=$BGColorColumn Align=center><b> STATUS </b></td>
				<td BGColor=$BGColorColumn Align=center><b> UPTIME </b></td>
<td BGColor=$BGColorColumn Align=center><b> Avrg.CPU Utilization 

Open in new window

0
We have a script ( a batch file ) sett up on a computer that allows us to send mail from a command line to an email address.

My goal is to setup a webpage, so that from any computer I can go to this page, enter an email address, hit submit, and have the web server process the script and send out the email.

I know how to setup IIS on Windows server.  I can most likely figure out how to create a simple web page that accepts input.  

How do I pass along the input to the script and make it execute ?

Is there a ready made template that can be purchased ?
0
I'm building a form to do a quick search for real estate listings. There is something wrong with the formatting with the very last set of 'select options' however and i can't figure it out. I use WordPress so i'm new to forms anyway. I do know that the city values and property type values are correct. MLS ids are correct.

It's got to be something simple i just can't fix it.
works.txt
breaks-the-site.txt
codes-put-together.txt
0
We are migrating 100 users from Exchange 2010 to O365. I need to run a script that will export to CSV individual permissions there mau be assigned to user calendars, contacts, tasks or mailboxes. I do have a script that runs a high level permission report but not on the granular level to know that user X has read only access to user Y calendar or user A has full access to user B inbox

Thanks
1
Hello,
I have in a shell script, a variable that uses xmllint like this:

Xpath_querry = $ (xmllint --shell $ {xmlfile} << EOF
    Setrootns << EOF
    Xpath count (// defaultns: $ {parse_tag /} / defaultns: $ {tag}))

This worked but now, I have an EOF error in the console at run time.
Would anyone know another way to rewrite this variable (that the variable is used later in the script)?
0
I am attaching the converted script. Please help me in updating the ?PROBLEM? parts in the entire script. Its quire urgent.

Thank you.
installapps90.py
0
I installed php 7.1.5. Does it come with fast cgi or do I need to install that myself ?

Thanks,

Michael
0
Free Tool: ZipGrep
LVL 8
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

I currently login to the time from website using the following script.


browser = webdriver.Chrome('E:/Shared Folders/Users/runnerjp/chromedriver/chromedriver.exe')
browser.get("https://www.timeform.com/horse-racing/account/sign-in?returnUrl=%2Fhorse-racing%2F") 
time.sleep(3)
username = browser.find_element_by_id("EmailAddress")
password = browser.find_element_by_id("Password")
username.send_keys("usr")
password.send_keys("pass")
login_attempt = browser.find_element_by_xpath("//input[@type='submit']")
time.sleep(3)
login_attempt.submit()

Open in new window


it works but I find using Chrome web driver is hammering my CPU. Is there an alternative code I could use that does not mean I need to physically load the page to sign in?
0
I'm wanting to have a neat and tidy package for multiple images (preferably png, or jpg if I must) that are used in an AutoIt GUI.  I'll be sharing it uncompiled, and don't want the mess of a boatload of individual image files.
They will all be the same size (probably 512x512) that will be used at some smaller resolution.

I'm not aware of any way around an icon (.ico) file displaying only the different sizes.  (use freeware Real World Icon Editor & Photoshop is avail)
If the best way is to create a .dll then I'll learn.  Please give me a bit o guidance (ie visual studio and learn about it (here))
Are there other good approaches?

What is the best way to store a bunch of images?
0
I want to use a MacOS script on OS Scierra, so that when I double click on an icon, it automatically sends an email to specific recipients every time, and it also includes an attachment named, for example 1.pdf.
This is using a network using Exchange 2010 on site.
Thanks to anyone that may help with this script, or program.
0
Im using python and paramiko. Im trying to backup a network device router using python. Below is my script. However im getting error

import paramiko
import sys
import time

HOST = "10.11.214.143"
USER = "admin"
PASS = "passwd"


client1=paramiko.SSHClient()
client1.set_missing_host_key_policy(paramiko.AutoAddPolicy())

client1.connect(HOST,username=USER,password=PASS)
  print "SSH connection to %s established" %HOST

#copying config to tftp
stdin, stdout, stderr = client1.exec_command('copy nvram:startup-config tftp: 10.11.214.144')
print stdout.read()


Traceback (most recent call last):
  File "<pyshell#12>", line 1, in <module>
    client1.exec_command('copy nvram:startup-config tftp:')
  File "C:\Python27\lib\site-packages\paramiko\client.py", line 436, in exec_command
    chan = self._transport.open_session(timeout=timeout)
  File "C:\Python27\lib\site-packages\paramiko\transport.py", line 716, in open_session
    timeout=timeout)
  File "C:\Python27\lib\site-packages\paramiko\transport.py", line 800, in open_channel
    raise SSHException('SSH session not active')
SSHException: SSH session not active

Open in new window

0
I am looking at permissions and the code part below works fine, I would however like to not see some results, like "builtin".
I was trying where-object, but that's not helping, and/or I can't get the syntax right. Is there a simple way to not display, or filter out findings such as builtin and administrators, etc?
get-Acl | Format-List -property AccessToString | Out-File -append "C:\somepathorother\shares.txt"

Open in new window


Thanks!!
0
Hi Everyone, I have the following script:

#!/bin/bash
TMPFILE=/home/david/testwp/temp.txt
touch $TMPFILE
curl https://api.wordpress.org/secret-key/1.1/salt/ > $TMPFILE
AUTHKEY=$(grep AUTH_KEY $TMPFILE | grep -v SECURE)
sed -i "s/define\(\'AUTH_KEY\'\,         \'put your unique phrase here\'\)\;/$AUTHKEY/" /home/david/testwp/wp-config-sample.php
echo $AUTHKEY
rm $TMPFILE

Open in new window


While the curl and the grep pull out the correct output (verified by the echo, it doesn't seem to change the value in the sample file.
Ideas?
0
I am having a very complex string that I need to tokenize and also create name pair values when possible. Here is a sample of the strings I have

Recod Style 1
Search Result Queries;SomeHotel.com;PT\=89030726\;PA\=-1119567914\;PS\=1547518063;2017-05-13 01:43:36.719;Search Results Query BT SPLIT=checkInDate\=5-13-2017&checkOutDate\=5-14-2017&numberOfAdults\=1&propertyIds\=MS140|MS741|MS1290|MS1334|MS1349|MS4557|MS4568|MS4783|MS4854|SS6029,Web Requests - Client IP=50.251.11.233;Execution Time Informix=2404.003662109375,DB Count=2.0,DB Time=2404.0037887319922;false;;2424.760498046875;2424.760498046875;8.655830353498459;2424.7605440989137;;;;SomeHotel_PROD;dyntrc-mgmt.SomeHotel.com


Recod Style 2
Search Result Queries;Mobile App;PT\=89031695\;PA\=-1119567914\;PS\=1547518063;2017-05-13 01:44:17.772;Search Results Query BT SPLIT=checkInDate\=5-13-2017&checkOutDate\=5-14-2017&corporatePlusNumber\=&numberOfAdults\=1&propertyIds\=MS1173%7CMS4961%7CMS4376%7CMS4281,Web Requests - Client IP=66.115.209.42;Execution Time Informix=1762.662109375,DB Count=5.0,DB Time=1759.847623437643;false;;1781.0732421875;1781.0732421875;10.074070394039154;1781.0732627734542;;;;SomeHotel_PROD;dyntrc-mgmt.SomeHotel.com

Both record styles happen in the same file.

Main delimiter above is;
some values are name-value pairs delimited on \= or =
Some fields contain other fields and delimited by &

Any ideas on how to parse this so I can convert it to some CSV or json
0
Hi - I have downloaded the tcl curl solution to my windows 7 machine.  The directory is located in c:\tcl\lib\tcl8.6\tclcurl.  I am trying to run the https test case. When I run the https.tcl script, I am receiving the following error:

Could not init a curl session: invalid command name "::curl::init"

I have the curl exec downloaded and installed in my PATH environment directory.

Any thoughts?

Thanks for the assistance.
0
Hello,

My following script is successfully working. But it is not reading the Tags fields with case-insensitive.

$resources = Get-AzureRmResource | Where-Object {($_.ResourceType -eq "Microsoft.Compute/virtualMachines") -or ($_.ResourceType -eq "Microsoft.Sql/servers/databases")} |
 foreach {

   new-object -TypeName psobject -Property @{
                                    ResourceName       =       $_.ResourceName;
                                    ResourceType       =       $_.ResourceType;
                                    OperatingHours  =  
                                                        if ( ($_ | select -expand Tags).OperatingHours -ieq $null )
                                                        {"TAG NOT PRESENT"}
                                                        elseif ( ($_ | select -expand Tags).OperatingHours -ieq '')
                                                        {"NULL/EMPTY"}
                                                        else
                                                        {($_ | select -expand Tags).OperatingHours} ;
                                             }
          }
$resources | Format-Table


The Output of above script is :
ResourceType                                               ResourceName                 OperatingHours            
------------------------                                           ------------------------              ------------------            
0
Stressed Out?
Stressed Out?

Watch some penguins on the livecam!

Hi all,

I wanted to backup few tables from RDS to my remote mysql server on daily basis.
Using Mysqldump on cron would work but issue is that its too huge and updating whole records again is not feasible .
Wanted script or some method to update or add only newly added or updated records on my remote DB Server so that server don't gets loaded or consumes too much time.

OS: ubuntu
db : mysql
0
Having an issue starting startX. it cannot find the connected monitor, here is the log:
   898.610] 
X.Org X Server 1.16.4
Release Date: 2014-12-20
[   898.611] X Protocol Version 11, Revision 0
[   898.611] Build Operating System: Linux 3.16.0-4-amd64 x86_64 Debian
[   898.611] Current Operating System: Linux Concept5 6.1.1-1#1 SMP Mon NOV5 18:23:31 EST 2016 x86_64
[   898.611] Kernel command line: BOOT_IMAGE=/boot/linux26 ro ramdisk_size=16777216 rw quiet splash=silent
[   898.612] Build Date: 11 February 2015  12:32:02AM
[   898.612] xorg-server 2:1.16.4-1 (http://www.debian.org/support) 
[   898.612] Current version of pixman: 0.32.6
[   898.612] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[   898.612] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   898.614] (==) Log file: "/var/log/Xorg.0.log", Time: Thu May 11 08:22:30 2017
[   898.614] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   898.614] (==) No Layout section.  Using the first Screen section.
[   898.614] (==) No screen section available. Using defaults.
[   898.614] (**) |-->Screen "Default Screen Section" (0)
[   898.614] (**) |   |-->Monitor "<default monitor>"
[   898.615] (==) No monitor specified for screen "Default Screen Section".
	Using a default monitor configuration.
[   898.615] 

Open in new window

0
Hi All,

Can anyone here assist me in how to modify the below Powershell code to export just one single CSV file ?

Basically what this script do is to show you what the Windows drive letter and its corresponding VMware Hard Disk number then export it to .CSV:

Connect-VIServer -Server PRODVC01-VM

$vm = "PRODSQL01-VM"
Function get-match($vm){
$VM = get-vm $vm 
$VMSummaries = @()
$DiskMatches = @()
$VMView = $VM | Get-View
    ForEach ($VirtualSCSIController in ($VMView.Config.Hardware.Device | Where {$_.DeviceInfo.Label -match "SCSI Controller"}))
        {
        ForEach ($VirtualDiskDevice  in ($VMView.Config.Hardware.Device | Where {$_.ControllerKey -eq $VirtualSCSIController.Key}))
            {
	            $VMSummary = "" | Select VM, HostName, PowerState, DiskFile, DiskName, DiskSize, SCSIController, SCSITarget
	            $VMSummary.VM = $VM.Name
	            $VMSummary.HostName = $VMView.Guest.HostName
	            $VMSummary.PowerState = $VM.PowerState
	            $VMSummary.DiskFile = $VirtualDiskDevice.Backing.FileName
	            $VMSummary.DiskName = $VirtualDiskDevice.DeviceInfo.Label
	            $VMSummary.DiskSize = $VirtualDiskDevice.CapacityInKB * 1KB
	            $VMSummary.SCSIController = $VirtualSCSIController.BusNumber
	            $VMSummary.SCSITarget = $VirtualDiskDevice.UnitNumber
	            $VMSummaries += $VMSummary
            }
        }

$Disks = Get-WmiObject -Class Win32_DiskDrive -ComputerName $VM.Name -Credential 

Open in new window

0
Hello experts,
I have a perl script that does the following::
-get log files from a directory;
-zip them
-send them over smtp to a given mailbox
-redownload them from the mailbox
-crypt them using pgp
-crypted files gets pushed on ftp
-delete the original file

What i would like to do is:
-Delete the ftp sending part, instead move the files in a local given directory

Attached you will find the script.

Thank you in advance!!!!
export.pl.txt
0
Hello,

Please what is the way to Convert" PowerShell (.ps1) Scripts to EXE Files (.exe) with GUI?

Thx
0
I need to write a script to have a PC dump certain log files.  I have to use DameWare to get to these PC's, so i am remoted in.  After the files are dumped into (preferably) a .zip file, i would be set.  However, the dates change daily, as does the number of files.  Some days here may be 3 logs, some there may be 9 (or more).  I need help writing this script, as well as t-shooting the firewall problem.


Thoughts ..........?
0

Scripting Languages

26K

Solutions

72

Articles & Videos

20K

Contributors

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.