- 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
To stop all the gitlab-related processes (e.g. for moving gitlab to another node while running it on top of HA-cluster) run the following two commands as root (strictly in that sequence):
gitlab-ctl stop
/sbin/stop gitlab-runsvdir
After such a full stopping gitlab couldn't be run again by conventional gitlab-ctl start
. Although gitlab-ctl reconfigure
would
work fine in such a case,
import javax.naming.directory.* | |
MYDOM = 'example.com' | |
// convert DNS domain to a LDAP notation | |
dns2ldap = {dom -> | |
'DC=' + dom.split(/\./).join(',DC=') | |
} | |
// base OU for our search |
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', |
# Get a list of hosts whose names matches to a regexp from a spacewalk server | |
import re | |
import xmlrpclib | |
def find_hosts(rgx): | |
spw = xmlrpclib.Server('https://spacewalk.example.com/rpc/api', verbose = 0) | |
ky = spw.auth.login('admin', 'aVeryS3cretWord') | |
return [n.lower() for n in [h['name'] for h in spw.system.list_systems(ky)] if re.search(rgx, n)] |