- stop gitlab:
gitlab-ctl stop
- move
/var/opt/gitlab
inside our prefix:
#!/bin/bash | |
# chkconfig: 345 98 02 | |
export CATALINA_BASE=/opt/tomcat | |
export CATALINA_HOME=/opt/apache-tomcat-8.0.22 | |
export CATALINA_OPTS="-server -Xms512m -Xmx512m -XX:MaxPermSize=128m -XX:PermSize=128m" | |
export CATALINA_PID=$CATALINA_BASE/work/tomcat.pid | |
export JAVA_HOME=/opt/jdk1.8.0_51 | |
PATH=/usr/bin:/bin:/usr/sbin:/sbin |
Put the following into your /etc/logrotate.d/httpd
:
# use the standard parameters for error log
/var/log/httpd/error_log {
missingok
notifempty
sharedscripts
postrotate
/sbin/service httpd graceful 2> /dev/null || true
The following command leaves only content of my/sub/dir
in a master
branch:
git filter-branch --subdirectory-filter my/sub/dir --prune-empty master
as a side effect, my/sub/dir
becomes a root directory of a repository.
Full documentation on git filter-branch
command could be found here: https://git-scm.com/docs/git-filter-branch
If your Jenkins server works with the git server via HTTPS and the latter uses a self-signed (or might be seeming incorect in some other sense) SSL certificate, you'll likely get an error like this:
hudson.plugins.git.GitException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
In order to get rid of it the steps bellow could be helpful (at least, they were helpful for me while setting up Jenkins build nodes on both Linux and Windows boxes):
In order to see a name of user starting a process with a given PID the command bellow could be helpful:
ps ho user -p `cat /some/pid/file`
Entering a dash before h
argument doesn't work on Linux with the following error message:
Warning: bad syntax, perhaps a bogus '-'?
# get a list of hosts with names matching a wildcard from AD | |
# on RedHat-based systems python-ldap package is required | |
import ldap | |
# get a field from ldap results | |
res_field = lambda r, n: r[1][n][0] | |
# send search query to ldap and get a result | |
ldap_search = lambda ldap_srv, wld_card: ldap_srv.search_s('ou=servers,dc=example,dc=com', |
USERNAME = 'testuser' | |
import hudson.model.Hudson | |
import hudson.security.AuthorizationMatrixProperty | |
println Hudson.instance.items.collect { | |
[name: it.name, matrix: it.getProperty(AuthorizationMatrixProperty.class)] | |
}.findAll { | |
it.matrix | |
}.collect { |
USERNAME = 'dummy' | |
import hudson.model.Hudson | |
println new XmlSlurper().parse( | |
new File(Hudson.instance.root, 'config.xml') | |
).authorizationStrategy.permission.collect { | |
it.text().split(':') | |
}.findAll { | |
it[1] == USERNAME |
#!/usr/bin/env ansible-playbook | |
--- | |
- name: Learn about some Pythonic ways to work with Ansible variables | |
hosts: all | |
vars: | |
env_name: prod | |
java_root: /opt | |
jdk_ver: 1.8.0_51 | |
rhel_major_version: 7 | |
linux_distros: |