This file contains 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
#!/bin/bash | |
EXAMPLE="example default" | |
# Plugin variable description | |
PROGNAME=$(basename $0) | |
RELEASE="Revision 1.0.0" | |
AUTHOR="(c) 2020 Warlord0" | |
# Functions plugin usage |
This file contains 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
<VirtualHost *:443> | |
ServerName app.host.local | |
ServerAdmin root@localhost | |
DocumentRoot "/srv/http/" | |
<Directory "/srv/http/"> | |
Options -Indexes -FollowSymLinks -MultiViews | |
AllowOverride All |
This file contains 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
#!/bin/bash | |
## Slack Alert Helper | |
function send_slack_message() { | |
action="$1" | |
status=$2 | |
message="$3" | |
case "$status" in | |
success ) color="#44d058";; |
This file contains 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
diff --git a/php-mysqlnd-fix.patch b/php-mysqlnd-fix.patch | |
new file mode 100644 | |
index 0000000..1cadcb3 | |
--- /dev/null | |
+++ b/php-mysqlnd-fix.patch | |
@@ -0,0 +1,22 @@ | |
+--- a/ext/mysqlnd/mysqlnd_ps_codec.c 2019-01-09 09:54:13.000000000 +0000 | |
++++ b/ext/mysqlnd/mysqlnd_ps_codec.c 2020-11-05 15:21:00.238585270 +0000 | |
+@@ -911,7 +911,7 @@ | |
+ zend_uchar *p = stmt->execute_cmd_buffer.buffer, |
This file contains 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
#!/bin/sh | |
#Set to specific monitor name, based on the output from command: xrandr | |
MONITOR="DP-1" | |
PAD_NAME='HUION Huion Tablet Pad pad' | |
STYLUS_NAME='HUION Huion Tablet Pen stylus' | |
# Get all device IDs for the PAD_NAME - in case multiples are present for wired and wireless connections | |
padIDs=$(xinput --list | awk -v search="$PAD_NAME" \ | |
'$0 ~ search {match($0, /id=[0-9]+/);\ |
This file contains 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
#!/usr/bin/env python | |
from PIL import Image | |
image = Image.open("image.jpg") | |
bg = image.getpixel((0,0)) | |
width, height = image.size | |
bg_count = next(n for n,c in image.getcolors(width*height) if c==bg) | |
img_count = width*height - bg_count | |
img_percent = img_count*100.0/width/height | |
print(img_percent) |
This file contains 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
<?php | |
use Illuminate\Console\Command; | |
use Illuminate\Filesystem\Filesystem as File; | |
/** | |
* Modify Generated IDE Helper Files for compatibility with NetBeans | |
*/ | |
class ComposerIdeHelperNetbeans extends Command | |
{ |
This file contains 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
<?php | |
class TestController extends Controller | |
{ | |
public function __construct() | |
{ | |
$this->beforeFilter('csrf', ['only' => ['postTest']]); | |
} | |
This file contains 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
## Email Alert - make sure xmail is installed and replace email address below | |
echo 'ALERT - $HOSTNAME - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access at $HOSTNAME from `who | awk '{print $6}'`" [email protected] & disown > /dev/null 2>&1 | |
## Register a webhook on slack "Incoming WebHooks" in the services section and replace hook url below | |
curl -X POST --silent --output /dev/null \ | |
-H 'Content-type: application/json' \ | |
-H "Accept: application/json" \ | |
--data @<(cat <<EOF | |
{ | |
"text": "ALERT - $HOSTNAME - $USER Shell Access on:' `date` `who`", |
This file contains 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
select index_schema, | |
index_name, | |
group_concat(column_name order by seq_in_index) as index_columns, | |
index_type, | |
case non_unique | |
when 1 then 'Not Unique' | |
else 'Unique' | |
end as is_unique, | |
table_name | |
from information_schema.statistics |
NewerOlder