Skip to content

Instantly share code, notes, and snippets.

View canberkaslan's full-sized avatar
🏠
Working from home

Canberk Aslan canberkaslan

🏠
Working from home
  • Istanbul, Turkey
View GitHub Profile
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1579618265" LAST_MODIFIED="1582022136" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Bar</H3>
<DL><p>
Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
Import-module PSWriteHTML
#Import server list
$Servers = Import-Csv -Path "C:\Couchbase\ServerList.csv"
#Get Couchbase informations json
$Result = $Servers | ForEach-Object -Parallel {
#Import main function for threads.
(. "C:\Couchbase\Get-CbServer.ps1")
$Credential = Import-CliXml -Path "C:\Couchbase\CbCred.xml"
@canberkaslan
canberkaslan / NexusArtifactCleanup.groovy
Created December 29, 2019 18:47 — forked from oliverdaff/NexusArtifactCleanup.groovy
Clean up nexus artifacts with API
import groovyx.net.http.*;
import static groovyx.net.http.ContentType.*;
import static groovyx.net.http.Method.*;
class NexusArtifactCleanup {
/**
* Settings in which to run script.
*/
import org.sonatype.nexus.repository.storage.StorageFacet;
import org.sonatype.nexus.repository.storage.Query;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
def fmt = DateTimeFormat.forPattern('yyyy-MM-dd HH:mm:ss');
// Get a repository
def repo = repository.repositoryManager.get('nuget-releases');
// Get a database transaction
def tx = repo.facet(StorageFacet).txSupplier().get();