Skip to content

Instantly share code, notes, and snippets.

@Norcoen
Norcoen / gitlab_lxc.txt
Last active January 15, 2022 19:59
gitlab on LXC Container (proxmox)
Um gitlab auf ubuntu 16.04 oder debian 8.5 zu installieren
(und wohl auch auf anderen ubuntus, debian hat noch zusätliche Probleme, dafür funktioniert aber z.B. top, htop, usw...)
müssen folgende Einstellungen in /etc/gitlab/gitlab.rb gesetzt sein:
postgresql['shared_buffers'] = "512MB" # recommend value is 1/4 of total RAM, up to 14GB.
postgresql['effective_cache_size'] = "128MB"
Beim ersten wird in der Config zum Start 256MB angeboten, reicht ggf. auch
Beim zweiten ist in der Config nur 1MB eingetragen, das kommt mir ggü. dem Standardwert von postgresql (128MB) zu wenig vor.
@Norcoen
Norcoen / php-full-depth-case-insensitive-file-exists.php
Created July 27, 2018 00:39 — forked from jrsinclair/php-full-depth-case-insensitive-file-exists.php
PHP Full-depth Case Insensitive file_exists() Function
<?php
/**
* Single level, Case Insensitive File Exists.
*
* Only searches one level deep. Based on
* https://gist.github.com/hubgit/456028
*
* @param string $file The file path to search for.
*
* @return string The path if found, FALSE otherwise.
@Norcoen
Norcoen / Instructions.md
Created September 18, 2018 13:53 — forked from mohakshah/Instructions.md
Builing ZFS on Raspberry Pi 3 running Rasbpian

Introduction

This is a tutorial for building and installing the latest release version (0.7.3 as of writing) of "ZFS on Linux" on a Raspberry Pi 3 running Raspbian Stretch. Specifically, we'll be building the dkms version of ZoL, which saves you the hassle of re-compiling the kernel modules after every kernel update. Even though ZoL added support for building dkms packages for debian in version 0.7.3, the build process on a Raspberry Pi 3 is not quite straight-forward. Hopefully, these instructions will make it easier.

Steps

  1. Install the build dependencies.
$ sudo apt-get update
$ sudo apt-get install build-essential autoconf libtool gawk alien fakeroot
$ sudo apt-get install dkms zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev parted lsscsi wget ksh
@Norcoen
Norcoen / PartialExistsViewHelper.php
Created October 14, 2018 01:38 — forked from arnekolja/PartialExistsViewHelper.php
TYPO3 Fluid ViewHelper to check if a partial name exists ("My/Partial")
<?php
namespace Krbu\Utility\ViewHelpers;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
/**
* Copyright note: Some parts are copied from the Fluid package.
* Usage example:
* <f:if condition="{krbu:PartialExists(partial: 'Category/{item.category.id}/DetailCol1')}">
@Norcoen
Norcoen / SolrTYPO3.md
Created November 26, 2018 18:03 — forked from fedir/SolrTYPO3.md
TYPO3 Solr extension configuraiton sample

Constants

plugin.tx_solr {
	solr {
	scheme = http

	host = YY.YY.YY.YY
	port = 8080

path = /solr/core_XXXX/

@Norcoen
Norcoen / debian-stretch-fde.md
Created January 12, 2019 20:17 — forked from ppmathis/debian-stretch-fde.md
Guide which explains an installation of Debian Stretch with full disk encryption (including "/boot" partition, containing initramfs+kernel) by using Debian Jessie Live.

Debian Stretch - Full Disk Encryption

This documents guides you through the process to install Debian Stretch with Full Disk Encryption. The following requirements exist:

  • Mainboard with UEFI-Support
  • Debian Stretch Live CD booted from UEFI
  • Two unformatted, unpartitioned HDDs/SSDs for Software RAID1 with mdmadm

After following this guide, you will end up with a setup like this:

  • Redundant GRUB Standalone EFI installation on both disks
@Norcoen
Norcoen / realurl_conf.php
Created January 28, 2019 14:44 — forked from lorenzulrich/realurl_conf.php
TYPO3 RealURL: Two sites in an installation, both with one domain per language
<?php
$realUrlSiteConfigurations = [
'site1' => [
'rootPageUid' => 1,
'schema' => 'https',
'languageDomainMap' => [
0 => 'www.site1.ch',
1 => 'www.site1.fr',
2 => 'www.site1.it',
]
@Norcoen
Norcoen / SoapClientCurl.php
Created March 19, 2019 12:12 — forked from stefanvangastel/SoapClientCurl.php
PHP 5.3 SoapClient with cURL request
/**
* Class SoapClientCurl extends SoapClient __doRequest method with curl powered method
*/
class SoapClientCurl extends SoapClient{
//Required variables
public $url = null;
public $certfile = null;
public $keyfile = null;
public $passphrase = null;

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

@Norcoen
Norcoen / gitlab-webhook-push.php
Created November 12, 2020 16:40 — forked from pitchart/gitlab-webhook-push.php
A simple php script to manage gitlab push webhook
<?php
/**
* GitLab Web Hook
* See https://gitlab.com/kpobococ/gitlab-webhook
*
* This script should be placed within the web root of your desired deploy
* location. The GitLab repository should then be configured to call it for the
* "Push events" trigger via the Web Hooks settings page.
*
* Each time this script is called, it executes a hook shell script and logs all