Skip to content

Instantly share code, notes, and snippets.

View linuxoid69's full-sized avatar

Rustam linuxoid69

View GitHub Profile
@linuxoid69
linuxoid69 / gist:e2bc37d6f1fa8002a81ac934bfbb7db0
Created February 10, 2025 09:58
[Jenkins] stop all running jobs in multibranch
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
}
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
@linuxoid69
linuxoid69 / main.go
Last active June 29, 2023 22:11
simple prometheus exporter
package main
import (
"fmt"
"net/http"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
@linuxoid69
linuxoid69 / HttpProxy.go
Created January 18, 2023 18:38 — forked from yowu/HttpProxy.go
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)
@linuxoid69
linuxoid69 / test2.yaml
Last active October 28, 2022 21:53
test2.yaml
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[@]}"
@linuxoid69
linuxoid69 / test.yaml
Last active October 28, 2022 21:54
test.yaml
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"
@linuxoid69
linuxoid69 / main.go
Created December 28, 2021 20:22
web server with embed content
package main
import (
"embed"
"log"
"net/http"
)
//go:embed static/*
var content embed.FS
@linuxoid69
linuxoid69 / 81-backlight.rules
Created May 19, 2019 08:48
81-backlight.rules
# 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"
@linuxoid69
linuxoid69 / docker_gui
Last active December 22, 2022 13:25
how run gui application in docker
$ 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:
@linuxoid69
linuxoid69 / githook_message
Last active April 26, 2024 10:24
githook_message
#!/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)