This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# kick function | |
# kicks other users out of their sessions with a message | |
# would kick root which comes from a defined destination | |
function kick() { | |
if [ -z "$1" ] | |
then | |
echo "need user" | |
return | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# loop function | |
# run any command in a while loop with 1 second sleep | |
function loop() { | |
if [ -z "$1" ] | |
then | |
return | |
fi | |
cmd="$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# function | |
# scroll below for the bash script | |
mailcheck () { | |
# abort if no argument | |
if [ -z "$1" ] | |
then | |
echo "I need a SASL user name" | |
return | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test mail delivery | |
# scripted by github.com/thonixx | |
function maildelivery { | |
domain=$(echo "$1" | awk -F@ '{print $2}') | |
mailserver=$(dig mx $domain +short | awk {'print $2'} | head -n 1) | |
# test if something is in the output | |
if [ -z "$mailserver" ] | |
then | |
echo "There was no mailserver or no MX record. :(" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pre> | |
<?php | |
$megabyte = 1528; // define the max megabytes which should be tested | |
function tryAlloc($megabyte){ | |
echo "try allocating {$megabyte} megabyte..."; | |
$mb = $megabyte; | |
$dummy = str_repeat("-",1048576*$mb); | |
echo "pass."; | |
echo "Usage: " . memory_get_usage(true)/1048576; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ⣏⡉ ⡀⢀ ⣀⡀ ⡇ ⢀⣀ ⣀⡀ ⢀⣀ ⣰⡀ ⠄ ⢀⡀ ⣀⡀ | |
# ⠧⠤ ⠜⠣ ⡧⠜ ⠣ ⠣⠼ ⠇⠸ ⠣⠼ ⠘⠤ ⠇ ⠣⠜ ⠇⠸ | |
# | |
# Due to the complexity of parsing anothers output (and because everything | |
# is different on other linux versions) I decided to revamp the code. | |
# | |
# What's better: | |
# - multiple A record parsing (also with multiple PTR records now) | |
# - multiple PTR record parsing (now working w/o bugs) | |
# - better error handling based on empty result check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test smtp login | |
# scripted by github.com/thonixx | |
function smtplogin { | |
echo -n "Server: " | |
read server | |
echo "" | |
echo -n "Username: " | |
read user |
NewerOlder