Skip to content

Instantly share code, notes, and snippets.

View dragolabs's full-sized avatar

Vitaly Shishlyannikov dragolabs

View GitHub Profile
@dragolabs
dragolabs / Установка Jenkins на RHEL CentOS 7.md
Created October 12, 2015 11:36
Установка Jenkins на RHEL/CentOS 7
  • Ставим Jenkins
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
  • Ставим Oracle JDK
wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.rpm
Random sleep period:
$((${RANDOM} % 600))
@dragolabs
dragolabs / shmsetup.sh
Created March 25, 2016 05:27 — forked from jodell/shmsetup.sh
kernel shared memory calculator
#!/bin/bash
# http://archives.postgresql.org/pgsql-admin/2010-05/msg00285.php
# Output lines suitable for sysctl configuration based
# on total amount of RAM on the system. The output
# will allow up to 50% of physical memory to be allocated
# into shared memory.
# On Linux, you can use it as follows (as root):
#
# ./shmsetup >> /etc/sysctl.conf
log_format elk '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$host" "$uri" "$args" "$sent_http_location" '
'"$proxy_host" "$upstream_addr" "$upstream_cache_status" '
'[$request_time] [$upstream_response_time]';
@dragolabs
dragolabs / find.md
Last active July 22, 2016 07:09
Как найти и показать только файлы без путей

Не работает в OS X, т.к. в маковском find нет printf

find $DIR -mindepth 1 -maxdepth 1 -printf "%f\n"

Работает везде, но заморочно

find $DIR -mindepth 1 -maxdepth 1 | rev | cut -d'/' -f1 | rev
import jenkins.model.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import hudson.plugins.sshslaves.*;
global_domain = Domain.global()
credentials_store =
Jenkins.instance.getExtensionList(
@dragolabs
dragolabs / -
Created August 29, 2016 16:19
Get root console in VM on Docker for Mac
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

OS X, iTerm2, Tmux и прокрутка

TL;DR

  • ~/.tmux.conf
set-option -g mouse on
  • Iterm2 Preferences
@dragolabs
dragolabs / bash-version-compare.sh
Last active July 17, 2024 13:42
Compare two versions in bash script
#!/bin/bash
#
# Compare two versions in bash script
# Originally get from http://stackoverflow.com/a/4025065
#
vercomp() {
if [[ $1 == $2 ]]; then
return 0