Skip to content

Instantly share code, notes, and snippets.

View SkaTeMasTer's full-sized avatar

$hawn Reimerdes SkaTeMasTer

View GitHub Profile
@SkaTeMasTer
SkaTeMasTer / functions.php
Created January 23, 2018 19:48
Wordpress hacks...
// Redirect to Post If Search Results Return One Post
add_action('template_redirect', 'redirect_single_post');
function redirect_single_post() {
if (is_search()) {
global $wp_query;
if ($wp_query->post_count == 1 && $wp_query->max_num_pages == 1) {
wp_redirect( get_permalink( $wp_query->posts['0']->ID ) );
exit;
}
@SkaTeMasTer
SkaTeMasTer / config.php
Created January 23, 2018 19:45
Wordpress quickies for less trash and more security...
define ('EMPTY_TRASH_DAYS', 0);
define( 'WP_POST_REVISIONS', 3 );
@SkaTeMasTer
SkaTeMasTer / very-useful-RPI3-system-info.txt
Last active January 21, 2018 02:54
A great list of commands to extract very useful system information for your Raspberry Pi. Personally I like to put a lot in my .bashrc file to remind me which system I am SSHing to. Here is my running "bash config" -- https://gist.github.com/SkaTeMasTer/9954a8ffd6bfc552969d38f5562f187b
============================================================================
LIST OF LINUX COMMANDS FOR GATHERING PI SPECIFICATIONS
============================================================================
“cat /proc/meminfo” (Memory Info)
“cat /proc/cpuinfo” (CPU Info)
“cat /proc/partitions” (Disk Partition Info)
“cat /proc/version” (Linux Version Info)
“cat /boot/cmdline.txt” (Boot Parameters)
“cat /proc/filesystems” (File System Info)
@SkaTeMasTer
SkaTeMasTer / gist:82b8e228418dec879c477dcee12f4bae
Created January 19, 2018 08:41
Speed up pihole by dropping incoming https with 433
iptables -A INPUT -p tcp --destination-port 443 -j REJECT
@SkaTeMasTer
SkaTeMasTer / bypassSafeConnect.py
Created January 18, 2018 23:07 — forked from joubin/bypassSafeConnect.py
This is a small script to bypass SafeConnect. SaveConnect is a small tool some universities use to manage you system. It installs their third party tool to monitor your usage and to check to see if you are running a virus scanner. The system is pretty flawed both in code and implementation. You can bypass it all together by running this.
#!/usr/bin/python
#
# Version 1.0
# This script will pass a linux HTML header causing safe connect to ignor the host mac address as safeconnect is not developed for *nix machines
# For educational purposes only.
# Joubin Jabbari
import sys
import urllib2
import random
@SkaTeMasTer
SkaTeMasTer / deutschland-141-opvn.conf
Created January 14, 2018 23:21
Copy of deutschland-141-opvn for NordVPN + openvpn
# _ _ ___ ______ _ _
# | \ | | ___ _ __ __| \ \ / / _ \| \ | |
# | \| |/ _ \| '__/ _` |\ \ / /| |_) | \| |
# | |\ | (_) | | | (_| | \ V / | __/| |\ |
# |_| \_|\___/|_| \__,_| \_/ |_| |_| \_|
#
daemon
client
@SkaTeMasTer
SkaTeMasTer / gist:2d73fea624781657be3e3c7811df232b
Last active April 16, 2018 19:05
Check config of USB and other devices on boot descriptor 'lsb_release' for Raspberry Pi.
sudo lsb_release -a
@SkaTeMasTer
SkaTeMasTer / openvpn-stats.sh
Created January 14, 2018 20:00
Get the statistics of openvpn service.
# the format yourdotconffilename.status
sudo cat /var/run/openvpn/de141-germany.status
import requests
import json
def send_notification_via_pushbullet(title, body):
""" Sending notification via pushbullet.
Args:
title (str) : title of text.
body (str) : Body of text.
"""
data_send = {"type": "note", "title": title, "body": body}
@SkaTeMasTer
SkaTeMasTer / .bash_profile
Created January 10, 2018 06:28
ASCII Art Raspberry Pi 3 Logo to display on login.
MMMMMMMMMMMMMMMMMMMMMMMMMMMMOMIMMMMMMMMM
MMM$$IIIIIIIIIIMMMMMMMMMIIIIIIIIII7$MMMM
MMMMIIIIIIIIIIIII?MMMMIIIIIIIIIIIIIDMMMM
MMMMIIIII7MIIIIIIIMMMIIIIIIINZIIIIIMMMMM
MMMMIIIIIIIIMMIIIIMMMIIIIMMIIIIIIIIMMMMM
MMMMMIIIIIIIIIMMIIMMMMIMMIIIIIIIIIMMMMMM
MMMMMMIIIIIIIIIIMMMMMMMIIIIIIIIIIMMMMMMM
MMMMMMMMIIIIIIIMMMMMMMMMIIIIIIIMMMMMMMMM
MMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMM