Scripting Languages

27K

Solutions

21K

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

hello,

i am on Active directory 2012 r2.
i need a help to export some information from a csv file user name, i need for every user:


every group user are member (security group or distribution list)
if mail enabled group i need the email of group
businessCategory
department
manager

my csv file are in this form:
john.smith
alexandra.jose
Manuel.perrera
.....

thanks for help
0
Learn Ruby Fundamentals
LVL 13
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Automate filter in Opencart default template.
<script type="text/javascript">
$(document).ready(function() {
    // hide the "submit" button
    $('#button-filter').hide();

    // bind onChange event to the checkboxes
    $('.click_checkbox_manufacturers-filter').live('change', function() {
        filter = [];

        $('.box-filter input[type=\'checkbox\']:checked').each(function(element) {
            filter.push(this.value);
        });

        window.location = '<?php echo $action; ?>&filter=' + filter.join(',');
    });
});
//--></script>

Open in new window


I replaced with this code but it hide the refine search button but it is not giving the right result.
Now the refine button is hidden but not getting the right result. I want to update the filter when I tick the tickbox.
Capture1.JPG
Is there anyone who can guide me to get the filter on check box event.
0
Need help writing a PowerShell loop.
I have the following code already, and it works except for the first item.  I end up with a "," (comma) to start, which I don't want.
Also there cannot be a "," (comma) at the end, the last path cannot have anything after it.

    ForEach ($tmp in $DependenciesList) {
		$Dependencies += "," + $tmp.FullName
        }

Open in new window


$DependenciesList is an array of file path objects obtained by code previously in my script that populates the array from what it finds.
$Dependencies becomes a string made up of these paths separated by a comma.

I need each path to be separated by a comma (no spacing) and no comma at the very end.
For example, I need the output to look something like this:
C:\Path1\SubPath1,C:\Path2\SubPath2,C:\Path3\SubPath3, ... ,C:\PathX\SubPathX

Open in new window


How can I modify this ForEach loop?
0
Hello!
I want to setup ssl free certificate that will also renew automatically. As I know the best option is letsencrypt.
Plz if anyone knows how to perform that task or maybe have really working manual - help me. Please!
0
Hey Experts!  The script below deletes out the user's profile on the computers in a text file.  However the script isn't deleting out the user's AppData folder.  It's staying on the computer and I'm hopeful we can tweak this script so the AppData dir is deleted when the profile is wiped out.

Get-ADComputer -Filter 'Name -like "TRN3*"' -SearchBase "OU=COMPUTERS,OU=TRAINING,OU=DEPTS,DC=LOCAL" -Property * | Select-Object -ExpandProperty name | out-file c:\tools\logs\testlog.csv


$computerList = Get-Content c:\tools\logs\testlog.csv
$logFile = "c:\tools\logs\testlog.csv_$([DateTime]::Now.ToString('yyyyMMdd')).csv"

$dateTime = {[DateTime]::Now.ToString('yyyy-MM-dd HH:mm:ss')}
$computerList | ForEach-Object {
	$computerName = $_
	Write-Host "Processing $($computerName) ..."
	[PSCustomObject]@{
		ComputerName = $computerName
		Date = & $dateTime
		Type = 'Cleanup Start'
		Result = "PROFILE CLEANUP OF TRAINING ACCOUNTS START: $([DateTime]::Now)"
	}
	If (Test-Connection -ComputerName $computerName -Count 2 -Quiet) {
		Try {
			$diskC = Get-WmiObject  Win32_LogicalDisk -Filter "DeviceID='C:'" -ComputerName $computerName -ErrorAction SilentlyContinue
			$diskSize = [math]::Round($diskC.Size / 1GB, 2)
			$freeSpaceBefore = [math]::Round($diskC.FreeSpace / 1GB, 2)
			$profiles = Get-WmiObject -Class Win32_UserProfile -Filter "(Special='False') And (Loaded='False') And (Not (SID Like '%500'))" -ComputerName $computerName -ErrorAction Stop
			If ($profiles) {
				$profiles | 

Open in new window

0
Need help to understand valid approach  with Best Practices to upgrade  vSPhere 4.1 to 6.5
What all are Kay Points to be observed here ?
Upgrade Path  so that I can get my Existing VC Config , DV Switch Config copied migrated to next valid version
How to set same config for my VC and dvSwitch  to be copied /replicated on next version of VC and dvSwicth?
What all are Benefits/drawbacks  to use VC as appliance/Windows @next level during upgrade
Can we Plan it with No downtime ? or if minimum outage if creating new infra then how to migrate existing to new one specially dv switch from 4.1 to next level

Thanks
0
Hello,
I have FreeBSD , I have file on /usr/local/ the is contain:
client_name:ex
type:azz
licence:as
expiration:2019-09-23

Open in new window

I want to do a script that change it to :
client_name:123
type:1234wqwq
licence:4vwqwq
expiration:2020-09-23

Open in new window

I try with sed but I get an error with file path
thanks.
0
Hello,  I have a perl script that I need it to look into a directory named mpl.  right now I run it but it does it for one file at a time. Sucks cause There are a few hundred. So If I can seek hellp to make my perl script open a whole directory and do what it does per one file but in a whole directory.

I need my script adjusted  to look into my directory mpl and read all the zonefiles and change the serial number using date with an extra number 2019011300 ; serial for example

I run the script like this on the below:

./zonechanges.pl db.apptoapp.net.new vipchange

Copy of the script:

#!/usr/bin/perl

open(ZONE,  $ARGV[0]) || die "Zone file error $!";
while ( $line = <ZONE> ) {
        chomp $line;
        push @fileLines, $line;
}
close ZONE;



# Assuming simple CSV of old_ip, new_ip
open(IPMAP, $ARGV[1]) || die "IP Map file error: $!";
while ( $line = <IPMAP> ) {
        chomp $line;
        ($old, $new) = split(/,/, $line);
        $old =~ s/\s+//;
        $new =~ s/\s+//;
        $ip{$old} = $new;
}
close IPMAP;


## For every line
for ($count=0; $count < @fileLines; $count++) {
#       print STDERR "OUTER FOR ($count)\n";
        $line = $fileLines[$count];
#       print STDERR "OUTER FOR have line $line\n";
        ## For every old address in the remap
        for $old (keys(%ip)) {
                #print STDERR "INNER FOR ($old)\n";
                ## If the line matches the old address
                if ( $line =~ /$old/ ) {
                       

Open in new window

0
Related to converting Oracle pl/SQL, would like to understand the libraries and functions that needs to be used?

In oracle there are so many advanced functions, in case of converting to python scripting accessing HIVE how to convert those functions in Python scripting? Appreciate your input.
0
what is a safe way to convert a .bat to an .exe file
Any freeware, or paid programs that will do this?
0
Learn SQL Server Core 2016
LVL 13
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

I would like to bind a custom tag helper to any tri-state value in my database.

There are many tri-state (bool?)s in my database.

On my edit pages, I would like a single control to handle all of these values.

Here is my custom taghelper

using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Razor.TagHelpers;
using System.Collections.Generic;

namespace TESCore.Web.TagHelpers
{
    [HtmlTargetElement("tristatelist")]
    
    public class TriStateListTagHelper : TagHelper
    {
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            output.TagName = null;

            output.Content.AppendHtml("<select class='tri-state list-box form-control'>");
            output.Content.AppendHtml("<option value=@null>Global</option>");
            output.Content.AppendHtml("<option value='true'>True</option>");
            output.Content.AppendHtml("<option value='false'>False</option>");
            output.Content.AppendHtml("</select>");
        }
    }
}

Open in new window


Below is an example of the an edit page. Notice I've hand-coded individual controls for the EmployeeType.ForceClockOut and EmployeeType.UseComptime.

Notice I'm trying to use my custom tristatelist taghelper on the EmployeeType.AllowClockOut bool? using the asp-for tag. The asp-for tag is not working to bind the data.

@page
@model TESTimeClock.Pages.Manager.EmployeeType.EditModel
@*@{
        ViewData["Title"] = "Edit";
    }*@

Open in new window

0
How to password protect an auto hot key file upon running it.
0
How to password protect a .ps1 file upon running it.
No one should be able to retrieve the password or the contents of the .ps1 file.
0
How to password protect an .exe file when running it.
Should a script be run in conjunction with the .exe and then convert the whole to a new .exe?
0
The following challenge is found using Auto Hot Key scripting.

The goal is to login to a specific website with the automatic filling of username and password.

The problem is that the website uses the same ID for both the username and password and therefore the script below does not enter the Password.

Is there a way to get around this or perhaps use another element so that a password can be entered automatically?
[code][/My_User_Name := "12345678"

My_Pass_Word := "Abcdefg"

web_browser := ComObjCreate("InternetExplorer.Application")

web_browser.Visible := true

web_browser.Navigate("http://www.website.com/cd/")

while web_browser.busy ; a while loop is a way to keep the script testing an IF like expression

sleep 100 ; IF web_browser.busy is true then sleep 100 milliseconds

sleep 1000

username_input := web_browser.document.getElementById("EditFormField1")

username_input.value := My_User_Name

password_input := web_browser.document.getElementById("EditFormField1")

password_input.value := My_Pass_Word

web_browser.document.getElementById("login").click()

Returncode]

The element for the Username looks similar to this:

<input type="text" id="EditFormField1" name="name" size="10" maxlength="10">

And the element for the Password looks similar to this:

<input id="EditFormField1" name="password" size="15" maxlength="15" type="password">

Any suggestions on how to modify the above script so that it enters the password?
0
Using a script or some other method, or shortcut, I would like to access a specific website, which then enters the username and password automatically, without having the need for a user to input the username and password.
This would be used for frequently visited sites....
Thank you.
0
Hi Folks,

I have an issue with a library in Groovy script. The issue is very strange, I don't see any direct reference to any of the classes of the library "org.apache.camel.Attachment" in my groovy script, but still I keep getting this error. PFA is the place where I get this error in my groovy script  and also find the code for my groovy script. Please give me suggestions on how to fix this. As I cant share the other jar files. I am giving the Base64Encoded strings for the libraries used in the script. and also the code which decodes the string and generates the corresponding jar files.

Tester.groovy is the script in which I have the issue.
Script1.groovy is the script which is called inside Tester.groovy
Base64Decode.groovy is the script for decoding the encoded string to generate the .jar file for the libraries.



Regards
Kalyan.
2019-03-18_15-38-46.png
Base64Decoder.txt
Script1.txt
Tester.txt
com.sap.gateway.ip.core.customdev.ut.txt
com.sap.gateway.ip.core.customdev.pr.txt
0
Hello Fellas.
I need your help with something that has been messing with my head for a while.

I have a CSV file filled 3 columns (Full name, user name and organization)

I also have a google-authenticator token generator server running on  Centos 7.6

if I run the command
su user1 -c 'google-authenticator --time-based --disallow-reuse --force --minimal-window --no-rate-limit'

Open in new window



I'll get a response like this from the server:

Warning: pasting the following URL into your browser exposes the OTP secret to Google:
  https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/user1@googleauth%3Fsecret%3D****%26issuer%3Dgoogleauth
Your new secret key is: *****
Your verification code is 529499
Your emergency scratch codes are:
  **
  **

(I obviously redacted the personal parts)

What I need is a bash script, the reads the csv file, the sends the username (2nd col) to the su command then adds the https link and the secret key as new columns.
(I don't mind of it creates a new file or adds them to the existing one)
0
Hi guys, we are using this feed here to be then imported by our mobile apps, https://nova.ie/feed however it is displaying two images within the body, is there anyway that it doesnt show the image within the body.

To get this working yesterday i put this code into functions.php on Wordpress

?php

function featuredtoRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content;
}
return $content;
}
 
add_filter('the_excerpt_rss', 'featuredtoRSS');
add_filter('the_content_feed', 'featuredtoRSS');

Open in new window

0
Why Diversity in Tech Matters
LVL 13
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

I need code that will take user choices (from checkboxes on a userform that correspond to the Reference Type dropdown in the Word cross reference interface function) and apply them so a macro (‘Apply_Cross_Ref_Style’) that is intended to format cross references formats only those checkbox controls whose names include the reference type (control.name.text). The purpose is to segregate the cross references,  so that I can apply formatting to specific cross references while leaving others of the same type alone.

Example: if I want to format only cross refs that point to captions with the labels of “Figure” and “Table” but leave all other cross references alone (such as headings and numbered items), this is the only way I can think of doing so, since they all have the same REF (or wdfieldref) field type,

I have a sub (‘lblApply_Click”) in the attached file that reads the controls and populates a variable (‘Reftype’) with the truncated names of the Reference Type list items (Numbered list, heading, bookmark, etc.). The idea is then for the ‘Apply_Cross_Ref_Style’ sub to format only those cross references of those types. I have the line ‘If Left(oFld.Result.Text, 6) = "Figure" Then…’ there now to test the concept, and it works, but I need to loop through the ‘Reftype’ variable, which carries the cross reference type names that are selected in the user-checked controls to tell the sub which cross references to format. I believe this requires an array but I don’t know how to …
0
I trying to familiarize myself with Powershell PnPOnline in particular

Get-PnPListItem -List Requests -Fields "Title", "GUID","RequestStatus","RequestStatusName"

Open in new window


I am running this script and it is getting results but it only showing the same 3 fields (ID, Title, GUID), no matter what other fields include in the parameters.

Any idea if I am doing something wrong? with the syntax?
0
require to setup robo copy to copy without overwrite option . Copy files and folder. Copy files according to date . for an example copy files from 1st April 2012 to 31 june 2012.
1
I am trying to create a login script that will map a network drive and add printers
below is the script i am using and every time it gets to the map drive it errors and says  the drive is already mapped.
so i thought about adding the removenetworkdrive prior so that helped a little but when it is a new user the remove error that there is no drive to delete.

any ideas and / or suggestions would be greatly appreciated

' VBScript.
Option Explicit
Dim oNet, sUser, cInitial, startTime
Set oNet = CreateObject("WScript.Network")
sUser = oNet.UserName
startTime = Now

   oNet.RemoveNetworkDrive "F:", True, True
   oNet.RemoveNetworkDrive "H:", True, True

   oNet.MapNetworkDrive "F:", "\\DataServer\Yeshiva", True
   oNet.MapNetworkDrive "H:", "\\DataServer\" & sUser & "$", True

   oNet.AddWindowsPrinterConnection "\\Printers\HP LaserJet M604 (OFFICE)", "HP LaserJet M604"
   oNet.AddWindowsPrinterConnection "\\Printers\Kyocera TASKalfa 6002i KX (Office)", "Kyocera TASKalfa 6002i KX"

   oNet.SetDefaultPrinter "\\Printers\Kyocera TASKalfa 6002i KX (Office)"
0
In UFT is there a way to copy contents of a GridView to a Datatable?

Looking at using the .SelectAll, but not sure how to get them into a given Datatable.  Any ideas?

SAPGuiSession("Session").SAPGuiWindow("List of Sales").SAPGuiGrid("GridViewCtrl").SelectAll
0
Anyone can help with this? Explain in detail how you would configure Apache in Debian to proxy requests for a website “www.test.com” from standard port “80” to an internal web server located at “192.168.1.3” who’s web server is running on port “8080”.  How would you then add proxying to a second website “www.test2.com” to “192.168.1.4” utilizing standard port “80” for both the proxy and the internal web server
0

Scripting Languages

27K

Solutions

21K

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.