Skip to content

Instantly share code, notes, and snippets.

View Artistan's full-sized avatar

Charles Peterson Artistan

View GitHub Profile
@Artistan
Artistan / composer.sh
Created July 19, 2018 16:24
Easiest Composer Install
#!/bin/bash
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin --filename=composer
@Artistan
Artistan / How to nav.md
Created July 9, 2018 19:06
Bootstrap 4.1 Navs

Bootstrap 4.1

Using data attributes

You can activate a tab or pill navigation without writing any JavaScript by simply specifying data-toggle="tab", data-toggle="pill", or data-toggle="list" on an element. Use these data attributes on .nav or .list-group.

Required data attributes

Toggle elements

/**
* css for the love of it.
**/
@Artistan
Artistan / install-php7.2-mcrypt.sh
Created June 29, 2018 19:21 — forked from arzzen/install-php7.2-mcrypt.sh
Install PHP 7.2 MCrypt extension
## How to install mcrypt in php7.2
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
##
#
# Check version php and pecl
#
php -v # if default php is not 7.2 then use /usr/bin/php7.2 instead php
@Artistan
Artistan / a configuration for mod_security.md
Created May 9, 2018 15:21
Mod_Security and JSON formatting.

Modsecurity

keys to json request logging.

  • use version 2.9.1+ (2.9.2 current)
  • SecRequestBodyAccess On
  • SecAuditLogType Concurrent tail logs with catail
  • SecAuditLog /var/log/httpd/modsec_audit.log
  • SecAuditLogFormat JSON
  • SecAction "id:1000,phase:2,ctl:auditEngine=On,nolog,pass"
@Artistan
Artistan / .aliase.catail.sh
Created May 9, 2018 15:08
catail.sh :: cat files found in a tails search....
# thanks to some help
# https://unix.stackexchange.com/questions/442672/how-to-continuously-tail-a-log-find-all-files-sed-and-display-cat-the-foun
# https://stackoverflow.com/a/26884607/372215
# catail \"/var/log/httpd/modsec_audit.log\" 's/[^\/]*/\./;s/].*$//g'
# parameter 1 is the file(s) to log
# parameter 2 is the sed regular expression (regex) to search for files within the tailed log
# notice the example modsec_audit, this will log file in the audit.log that it wroe if you are logging output in Concurrent mode.
catail() (
@Artistan
Artistan / .aliases.sh
Last active April 10, 2020 13:06
Bash/ZSH Aliases
source .zsh.ssh.autocomplete.sh
alias l='ls -lahG'
# safety net aliases
alias cp='cp -iv'
alias mv='mv -iv'
alias rm='rm -i'
alias ln='ln -i'
@Artistan
Artistan / gstreamer-build.sh
Last active August 12, 2018 01:05 — forked from sphaero/gstreamer-build.sh
Install & build gstreamer from git
#!/bin/bash --debugger
export MAKEFLAGS="-j2"
set -e
#########################################
#
# ./script.sh [optional version]
#
# NOTES:
# make --> https://github.com/Tes3awy/OpenCV-3.2.0-Compiling-on-Raspberry-Pi#step-12
@Artistan
Artistan / learning.awk
Last active June 19, 2021 02:25
Learn AWK
#!/usr/bin/awk -f
# Comments are like this
# AWK programs consist of a collection of patterns and actions. The most
# important pattern is called BEGIN. Actions go into brace blocks.
BEGIN {
# BEGIN will run at the beginning of the program. It's where you put all
# the preliminary set-up code, before you process any text files. If you
@Artistan
Artistan / .gitignore
Created February 12, 2018 13:12 — forked from salcode/.gitignore
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20160309
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.