Skip to content

Instantly share code, notes, and snippets.

View JBlond's full-sized avatar

Mario JBlond

  • Germany
  • 10:12 (UTC +02:00)
View GitHub Profile
@JBlond
JBlond / generateChangelog.php
Created January 26, 2021 10:47
generate Changelog
<?php
$output = "# changelog\n\n";
$previousTag = 0;
$gitTags = shell_exec("git tag --sort=-creatordate");
$gitTagsArray = explode("\n", $gitTags);
foreach ($gitTagsArray as $gitTag) {
@JBlond
JBlond / smb.conf
Created December 27, 2020 09:48
smb tuning Windows 10
[global]
read raw = Yes
write raw = Yes
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072
min receivefile size = 16384
use sendfile = true
aio read size = 16384
aio write size = 16384
protocol = SMB3
@JBlond
JBlond / uncide.php
Created July 31, 2020 11:41
PHP unicode
<?php
class 🤘 {
const 😁 = '👽';
public function 🤡()
{
return self::😁;
}
}
@JBlond
JBlond / leapyear.php
Created July 22, 2020 11:31
leap year
<?php
function isLeapYear(int $year): bool
{
return $year % 4 == 0 && $year % 100 != 0 || $year % 400 == 0;
}
@JBlond
JBlond / openssl_configure.md
Last active June 26, 2020 10:16
OpenSSL configure options

OpenSSL Configure Options (1.1.1g)

Standard party line

Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...]
                 [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw]
                 [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm]
                 [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR]
                 [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity]
@JBlond
JBlond / rebootlist.sh
Last active April 10, 2023 12:34
reboot
#!/bin/bash
who -b
last reboot | less
last reboot | head -1
last -x|grep shutdown | head -1
@JBlond
JBlond / tailf-with-colors.sh
Last active December 20, 2023 19:40
Tail logs with color for Monolog
tailf-with-colors () {
if [ -z "$1" ] ; then
echo "Please specify a file for monitoring"
return
fi
tail -f $1 | awk '
{matched=0}
/INFO:/ {matched=1; print "\033[0;37m" $0 "\033[0m"} # WHITE
/DEBUG:/ {matched=1; print "\033[0;37m" $0 "\033[0m"} # WHITE
@JBlond
JBlond / idea-monolog-pattern.md
Last active January 7, 2025 12:04
PHP Storm IDE monlog pattern
Message pattern: `^\[(.*)\] (.+?)\.([A-Z]+): (.*)`
Message start pattern: `^\[`
Time format: `yyyy-MM-dd HH:mm:ss`
Time capture group: `1`
Severity capture group: `3`
Category capture group: `2`
@JBlond
JBlond / 00-default.conf
Last active January 7, 2025 12:04
Apache example
<VirtualHost _default_:80>
DocumentRoot "C:/default"
<Directory "C:/default">
Options Indexes FollowSymLinks
AllowOverride All
Require local
</Directory>
CustomLog "C:\nul" common
@JBlond
JBlond / svn_create_package.cmd
Created May 21, 2019 14:31
create svn package
@echo off
mkdir __PACKAGE__
cd __PACKAGE__
set SVN_PACKAGE_PATH=%cd%
mkdir bin
mkdir doc
mkdir modules
mkdir tools
cd ..
xcopy /E tools %SVN_PACKAGE_PATH%\tools\