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.* | |
// get all running jobs | |
Jenkins.instance.getAllItems(AbstractItem.class).each { item -> | |
if (item instanceof org.jenkinsci.plugins.workflow.job.WorkflowJob && item.fullName.contains("your-job")) { | |
item.builds.each { build -> | |
if (build.isBuilding()) { | |
println "Stopping build: ${build.fullDisplayName}" | |
build.doStop() // stop running job | |
} |
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
2024/05/10 14:37:37 ...ices/task/migrate.go:61:func1() [E] runMigrateTask[19] by DoerID[2] to RepoID[40] for OwnerID[2] failed: authentication failed: Clone: exit status 128 - remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://gitlab.my-itclub.ru/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied | |
fatal: Authentication failed for 'http://gitlab.my-itclub.ru/devops/shedding.git/' | |
2024/05/10 14:37:37 ...ervices/task/task.go:53:handler() [E] Run task failed: authentication failed: Clone: exit status 128 - remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://gitlab.my-itclub.ru/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied | |
fatal: Authentication failed for 'http://gitlab.my-itclub.ru/devo |
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
package main | |
import ( | |
"fmt" | |
"net/http" | |
"github.com/prometheus/client_golang/prometheus" | |
"github.com/prometheus/client_golang/prometheus/promhttp" | |
) |
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
package main | |
import ( | |
"flag" | |
"io" | |
"log" | |
"net" | |
"net/http" | |
"strings" | |
) |
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
default: | |
before_script: | |
- apt-get update -qq && apt-get install -y -qq sqlite3 libsqlite3-dev nodejs | |
- gem install bundler --no-document | |
- bundle install --jobs $(nproc) "${FLAGS[@]}" |
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
container_scanning: | |
stage: test | |
image: | |
name: docker.io/aquasec/trivy:latest | |
entrypoint: [""] | |
variables: | |
# No need to clone the repo, we exclusively work on artifacts. See | |
# https://docs.gitlab.com/ee/ci/runners/README.html#git-strategy | |
GIT_STRATEGY: none | |
TRIVY_USERNAME: "$CI_REGISTRY_USER" |
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
package main | |
import ( | |
"embed" | |
"log" | |
"net/http" | |
) | |
//go:embed static/* | |
var content embed.FS |
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
# Adjust screen brightness according to power state | |
# 1st rule for when on AC | |
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/YOUR_USERNAME/.Xauthority", RUN+="/usr/bin/brightlight -w 1200" | |
# 2nd rule for when on battery | |
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/YOUR_USERNAME/.Xauthority", RUN+="/usr/bin/brightlight -w 350" |
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
$ docker run -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix <image> | |
# sound | |
$ docker run --device=/dev/snd/controlC0 --device=/dev/snd/pcmC0D0p --device=/dev/snd/seq --device=/dev/snd/timer <image> | |
#on host machine | |
$ xhost +local: |
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/sh | |
set -ue | |
mkdir -p ~/.githook | |
echo '#!/bin/bash | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) |
NewerOlder