Tag Archives: Security

Bash tits and bits

Command Substitutions:

list=`ls`

list=$(ls)

# below will assign to an array, you can use ${list[1]} to access individual element.

list=( * )


Variable assignment before command in one line

foo=bar ls $foo


Run bash in debugging mode

#!/bin/bash –x

or you can do

set –x # to turn on debugging in the script

set  +x # to turn off debugging


if COMMANDS; then COMMANDS; else COMMANDS; fi;

This can help you understand that if, then, else, fi are all kewords.

 

Another form:

if [[ $a == “good” ]]

Here [[ is a command.

A note from http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_02.html


[] vs. [[]]

Contrary to [, [[ prevents word splitting of variable values. So, if VAR="var with spaces", you do not need to double quote $VAR in a test – even though using quotes remains a good habit. Also, [[ prevents pathname expansion, so literal strings with wildcards do not try to expand to filenames. Using[[, == and != interpret strings to the right as shell glob patterns to be matched against the value to the left, for instance: [[ "value" == val* ]].


Ryan@Foundation ~
$ [ 1 -eq 1 ];

Ryan@Foundation ~
$ echo $?
0

Ryan@Foundation ~
$ [ 1 -eq 0 ];

Ryan@Foundation ~
$ echo $?
1

Ryan@Foundation ~
$ [ 1 -eq 1 ]

Ryan@Foundation ~
$ echo $?
0

Ryan@Foundation ~
$ [ 1 -eq 0 ]

Ryan@Foundation ~
$ echo $?
1

Ryan@Foundation ~
$

Job NTSCRTY

This is an old post too.

After our roles were added, I was still not able to search job openings. When I queried:

clip_image002

I found that I have 1 entry there while W has 29 or something. So the roles were added but this table was not updated.

I then asked B to run security refresh jobs, but he had no idea what they are. In the end, T said to run the NTSCRTY job.

But I was not able to find it in the Process Definitions.

clip_image004

I suddenly saw this:

clip_image006

When I clicked on it:

image

Bingo, that’s it.

However, I realized that there is no place that defines those AEs:

clip_image010

It’s just not there. I saw on internet that there should be a job defined first. Go back to the menu:

clip_image011

See right above “Schedule JobSet” there is “Jobs”, go there and search for N:

clip_image013

Bingo again.

clip_image015

Perfect again.

clip_image017

image

clip_image021