Skip to content

Instantly share code, notes, and snippets.

@aursu
aursu / db-compat.php
Created April 23, 2018 12:59
MySQL to MySQLi compatibility wrapper
<?php
function mysql_escape_string($str)
{
return str_replace(["\n", "\r", "\x1a"], ["\\n", "\\r", "\\Z"], addslashes($str));
}
function mysql_query($query, $link){
return mysqli_query($link, $query);
}
function mysql_fetch_row($result){return mysqli_fetch_row($result);}
@aursu
aursu / docker-ipv6.md
Created May 22, 2018 08:39
IPv6 with Docker
@aursu
aursu / push-https.md
Created May 22, 2018 12:33
Push over HTTPS with 2FA
@aursu
aursu / check-ssl-exp.sh
Created June 6, 2018 10:49
Check SSL expiration
echo | openssl s_client -connect gitlab.dev2.gface.de:443 2>/dev/null | sed -n '/-----BEGIN CERTIFICATE-----/,/-----END CERTIFICATE-----/p' | openssl x509 -dates -noout
#!/bin/bash
unknown_os ()
{
echo "Unfortunately, your operating system distribution and version are not supported by this script."
echo
echo "You can override the OS detection by setting os= and dist= prior to running this script."
echo "You can find a list of supported OSes and distributions on our website: https://packages.gitlab.com/docs#os_distro_version"
echo
echo "For example, to force CentOS 6: os=el dist=6 ./script.sh"
[gitlab_gitlab-ee]
name=gitlab_gitlab-ee
baseurl=https://packages.gitlab.com/gitlab/gitlab-ee/el/7/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey
https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey/gitlab-gitlab-ee-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
@aursu
aursu / gitlab-pre.sh
Created June 7, 2018 11:40
GitLab preinstall scriptlet (using /bin/sh):
#!/bin/sh
# GitLab pre-install script
DEST_DIR=/opt/gitlab
NEW_MAJOR_VERSION=10
NEW_MINOR_VERSION=10.8
mkdir -p /var/log/gitlab/reconfigure
skip_migrations_file=/etc/gitlab/skip-auto-migrations
@aursu
aursu / gitlab-post.sh
Created June 7, 2018 11:46
GitLab postinstall scriptlet (using /bin/sh):
#!/bin/sh
#
# Perform necessary gitlab setup steps
# after package is installed.
#
DEST_DIR=/opt/gitlab
notify()
{
echo "gitlab: $1"
@aursu
aursu / gitlab-postun.sh
Created June 7, 2018 11:47
GitLab postuninstall scriptlet (using /bin/sh):
#!/bin/sh
# WARNING: REQUIRES /bin/sh
#
# - must run on /bin/sh on solaris 9
# - must run on /bin/sh on AIX 6.x
# - if you think you are a bash wizard, you probably do not understand
# this programming language. do not touch.
# - if you are under 40, get peer review from your elders.
is_smartos() {