Tags » Script

Find Currently Executing Jobs Running Longer Than 30 Day Average

–By Lori Brown   @SQLSupahStah

I needed to update some of our long running job monitoring code to improve it from the version that we have right now. 476 more words

SQL Server

first drafts are meant to be written on

It’s 40 pages high. The printer ink is sharp against the new paper. There’s a title, a character list. It’s pristine, and I’m fooling myself, but it looks finished. 152 more words

Writing

Harry Potter and the Cursed Child - Book Review

Finished reading

Harry Potter and the Cursed Child (Harry Potter #8)

by John Tiffany (Adaptation), Jack Thorne, J.K. Rowling

★★

Expectation

I was afraid of not liking this book a lot. 563 more words

Thing Of The Moment

Check syntax of shell script

$ bash -n <script>

Does not execute the script, checks the syntax.

Bash

Server Live status

echo "Host`tState" >> results.csv
$names = Get-Content "hostlist.txt"
foreach ($name in $names) {
    $count = 0
    $count2 = 13490

    if ( Test-Connection -ComputerName $name -Count 1 -ErrorAction SilentlyContinue ) {
        echo "$name`tUp" >> results.csv
    }
    else {
        echo "$name`tDown" >> results.csv
    }

    $count++
    Write-Progress -Activity "Gathering Information" -status "Pinging Hosts..." -percentComplete ($count / $count2 *100)

}
Script

Downloading transposon regions

mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg38 -e 'select chrom,chromStart,chromEnd,name from nestedRepeats where repClass="LINE" ' > tmpfile
sed '1d' tmpfile > hg38_LINE.bed; rm tmpfile
mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg38 -e 'select chrom,chromStart,chromEnd,name from nestedRepeats where repClass="SINE" ' > tmpfile
sed '1d' tmpfile > hg38_SINE.bed; rm tmpfile
mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg38 -e 'select chrom,chromStart,chromEnd,name from nestedRepeats where repClass="LTR" ' > tmpfile
sed '1d' tmpfile > hg38_LTR.bed; rm tmpfile
mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg38 -e 'select chrom,chromStart,chromEnd,name from nestedRepeats where repClass="Simple_repeat" ' > tmpfile
sed '1d' tmpfile > hg38_Simple_repeat.bed; rm tmpfile
mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg38 -e 'select chrom,chromStart,chromEnd,name from nestedRepeats where repClass="Low_complexity" ' > tmpfile
sed '1d' tmpfile > hg38_Low_complexity.bed; rm tmpfile
mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg38 -e 'select chrom,chromStart,chromEnd,name from nestedRepeats where repClass="Satellite" ' > tmpfile
sed '1d' tmpfile > hg38_Satellite.bed; rm tmpfile
mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg38 -e 'select chrom,chromStart,chromEnd,name from nestedRepeats where repClass="Retroposon" ' > tmpfile
sed '1d' tmpfile > hg38_Retroposon.bed; rm tmpfile
Bioinformatics