This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo sqlite3 /data/grafana/grafana.db | |
update user set is_admin = 1 where login="blahblah"; | |
.exit | |
sudo systemctl restart grafana-server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -vkG 'https://<influxdb_url>/query?db=<DATABASE>&epoch=ns' \ | |
-u *****:******** \ | |
--data-urlencode "q=SELECT * FROM jenkins_data WHERE prefix='hero'" |\ | |
jq -r "(.results[0].series[0].values[][0])" > delete_timestamps.txt | |
for i in $(cat delete_timestamps.txt); do | |
echo $i; | |
curl -G 'https://<influxdb_url>/query?db=<DATABASE>=ns' \ | |
-u ****:******** \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hudson.model.* | |
import jenkins.model.Jenkins | |
def q = Jenkins.instance.queue | |
q.items.findAll { it.task.name }.each { q.cancel(it.task) } | |
for (aSlave in hudson.model.Hudson.instance.slaves) { | |
if (aSlave.getComputer().isOffline() /* || aSlave.getComputer().isOnline() */) { | |
aSlave.getComputer().setTemporarilyOffline(true,null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delete old artifacts that fills up the disk on the master node. | |
// Run this from the Jenkins console (Manage Jenkins, Manage Nodes, master, Script Console) | |
def project = Jenkins.get().getItemByFullName('your-project-id') | |
def jobs = project.getAllJobs() | |
def total_size = 0 | |
jobs.each{ job -> | |
def builds = job.getBuilds() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
title Restart Print Spooler | |
echo Stopping Spooler service | |
net stop Spooler | |
echo Starting Spooler service | |
net start Spooler | |
pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git remote prune origin | |
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\kumbasar>net group "test_adgroup" /domain | |
The request will be processed at a domain controller for domain test.net. | |
Group name test_adgroup | |
Comment test_adgroup_comment | |
Members | |
------------------------------------------------------------------------------- | |
kumbasar yildiz volkan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
echo "Rebooting after 5 sec.." | |
( sleep 5 ; reboot ) & | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
URL="http://localhost:8080" | |
repo="test-repo" | |
TO=`date -d "1 months ago" +%s000` | |
FROM=`date -d "3 months ago" +%s000` | |
curl -u${API_USER}:${API_PASSWORD} -o output.json "${URL}/artifactory/api/search/creation?from=${FROM}&to=${TO}&repos=${repo}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
image="test.img" | |
label="test" | |
mntdir=`mktemp -d` | |
sudo dd status=progress if=/dev/zero of=$image bs=6M count=1000 && sync | |
echo 'type=7' | sudo sfdisk $image |
NewerOlder