Skip to content

Instantly share code, notes, and snippets.

View bes-internal's full-sized avatar
.

Vladimir Varlamov bes-internal

.
View GitHub Profile
@mbaersch
mbaersch / bot-detection-variable-gtm.js
Last active August 21, 2023 10:33
JavaScript Variable für Google Tag Manager zur Ermittlung eines Bot Markers (zur Verwendung als Benutzerdefinierte Dimension)
function(){
//----------------------------------------------------------------
// Erkennung von Crawlern anhand User-Agent oder Feature-Detection
//----------------------------------------------------------------
//Soll ein einmal bestandender Test innerhalb der Session reichen? Dann hier einschalten
var cache2Session = true;
// --- Ende Setup ---
@i3v
i3v / cdm_fio.sh
Last active May 15, 2024 13:10
Reproducing CrystalDiskMark tests with fio - fixes for https://unix.stackexchange.com/revisions/480191/9
#!/bin/bash
# This script is based on https://unix.stackexchange.com/revisions/480191/9 .
# The following changes proved to be necessary to make it work on CentOS 7:
# * removed disk info (model, size) - not very useful, might not work in many cases.
# * using "bw" instead of "bw_bytes" to support fio version 3.1 (those availible through yum @base)
# * escaping exclamation mark in sed command
# * the ".fiomark.txt" is not auto-removed
LOOPS=5 #How many times to run each test
@dallaylaen
dallaylaen / nyt.pm
Last active February 5, 2023 11:13
Nytprof for PSGI code
package nyt;
use strict;
use warnings;
=head1 NAME
nyt - Decorate existing code with Devel::NYTProf (for PSGI)
=head1 SYNOPSIS
@mwalczak
mwalczak / zabbix_migration.md
Last active May 3, 2024 11:18
Migrating Zabbix with MySQL backend to a new machine

Today I've solved the problem of one server being to slow to handle the growth of my zabbix configuration. I'm using zabbix-server 2.2.2 with MySQL/Debian backend and around 20 zabbix-agents with Debian installed.

Let's say old Zabbix server IP is: A.B.C.D and new is: U.X.Y.Z. The domain name for the instalation will be: http://zbx.newmachine.com

Below you will find all steps to migrate your configuration:

Ensure all agents will accept connections from the new IP Modify each agent configuration file (in debian: /etc/zabbix/zabbix_agentd.conf) and add new IP

@joyrexus
joyrexus / README.md
Last active May 15, 2024 07:30
Perl one-liners

Hi:

perl -e 'print "hello world!\n"'

A simple filter:

perl -ne 'print if /REGEX/'

Filter out blank lines (in place):

@sowelie
sowelie / marker-rollover.js
Last active May 9, 2018 09:11
Custom marker implementation for leaflet with rollover popup functionality.
var MyCustomMarker = L.Marker.extend({
bindPopup: function(htmlContent, options) {
if (options && options.showOnMouseOver) {
// call the super method
L.Marker.prototype.bindPopup.apply(this, [htmlContent, options]);
// unbind the click event