Skip to content

Instantly share code, notes, and snippets.

View JBlond's full-sized avatar

Mario JBlond

  • Germany
  • 18:37 (UTC +02:00)
View GitHub Profile
@JBlond
JBlond / change-wallpaper.bat
Created September 1, 2021 06:43 — forked from eliashussary/change-wallpaper.bat
A simple batch script to change your windows wallpaper. It takes a single argument, the path of your desired wallpaper.
echo off
:: Handle CLI Args
IF [%1]==[] (
echo No wallpaper path provided, please provide a full qualified path. Ex: C:\dir1\dir2\wallpaper.jpg
exit /b 1
)
:: Commands
echo Changing wallpaper to: %1
@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 / install.bash
Created August 19, 2020 11:15
wordpress fast installation WP CLI
#!/bin/bash
wp core download
wp core config --dbhost=localhost --dbname=press --dbuser=press --dbpass=asasaasasasa --dbprefix=wp_
wp core install --url=example.com --title="Test Site" --admin_user=admin --admin_password=admin --admin_email=admin@example.com
wp core update
wp core update -db
wp plugin uninstall hello
wp theme install micro
wp theme activate micro
wp theme uninstall twentynineteen twentyseventeen twentytwenty
@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]
#!/bin/bash
#Ensure we have the quantity specified on the CLI
if [ -z "$3" ]; then ARG_ERR=ERR; fi
if [ -z "$2" ]; then ARG_ERR=ERR; fi
if [ -z "$1" ]; then ARG_ERR=ERR; fi
if [ -n "$ARG_ERR" ];
then
echo "Usage: <filecount> <filenamebase> <filenameextension>"
exit
@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