Skip to content

Instantly share code, notes, and snippets.

View JBlond's full-sized avatar

Mario JBlond

  • Germany
  • 06:26 (UTC +02:00)
View GitHub Profile
@JBlond
JBlond / bash-colors.md
Last active April 23, 2024 00:02 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@JBlond
JBlond / episoden.md
Last active April 2, 2024 10:32
Fragezeichen Episoden

Drei Fragezeichen Episoden

Nr. Titel Erscheinung Autor Rating
001 und der Super-Papagei 1979-10-12 Robert Arthur
002 und der Phantomsee 1979-10-13 William Arden
003 und der Karpatenhund 1979-10-14 M. V. Carey
004 und die schwarze Katze 1979-10-15 William Arden
005 und der Fluch des Rubins 1979-10-16 Robert Arthur
006 und der sprechende Totenkopf 1979-10-17 Robert Arthur
<?php
/**
* @param mixed $string The input string.
* @param mixed $replacement The replacement string.
* @param mixed $start If start is positive, the replacing will begin at the start'th offset into string. If start is negative, the replacing will begin at the start'th character from the end of string.
* @param mixed $length If given and is positive, it represents the length of the portion of string which is to be replaced. If it is negative, it represents the number of characters from the end of string at which to stop replacing. If it is not given, then it will default to strlen( string ); i.e. end the replacing at the end of string. Of course, if length is zero then this function will have the effect of inserting replacement into string at the given start offset.
* @return string The result string is returned. If string is an array then array is returned.
*/
function mb_substr_replace($string, $replacement, $start, $length=NULL) {
if (is_array($string)) {
@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 / .bashrc
Last active December 20, 2023 19:39
ssh host autocomplete
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
@JBlond
JBlond / index.html
Created June 10, 2016 15:41 — forked from josheinstein/index.html
A CodePen by Josh Einstein. Keyboard Navigation in Table Cells - Uses jQuery to enable arrow key functionality in tables. Pressing up/down/left/right in input fields will move focus to adjacent cells. Doesn't currently deal with column spans or custom input scenarios such as on-the-fly input fields.
<table id="people">
<thead>
<th>First Name</th>
<th>Last Name</th>
<th>Phone Number</th>
<th>Location</th>
</thead>
<tbody>
<tr>
<td><input /></td>
@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 / 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 / observe.sh
Created July 7, 2023 10:58
Update Observium CE
#!/bin/bash
cd /opt
mv observium observium_old
wget -Oobservium-community-latest.tar.gz https://www.observium.org/observium-community-latest.tar.gz
tar zxvf observium-community-latest.tar.gz
mv /opt/observium_old/rrd observium/
mv /opt/observium_old/logs observium/
mv /opt/observium_old/config.php observium/
/opt/observium/discovery.php -u
@JBlond
JBlond / install.bash
Created July 5, 2023 06:49
Truenas truecommand docker install
docker pull ixsystems/truecommand
docker run --detach -v "[hostdirectory]:/data" -p [portnumber]:80 -p [sslportnumber]:443 ixsystems/truecommand