View listusercronjobs.sh
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 | |
# System-wide crontab file and cron job directory. Change these for your system. | |
CRONTAB='/etc/crontab' | |
CRONDIR='/etc/cron.d' | |
# Single tab character. Annoyingly necessary. | |
tab=$(echo -en "\t") | |
# Given a stream of crontab lines, exclude non-cron job lines, replace |
View debian_upgradable_ansible
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
- hosts: servers | |
tasks: | |
- name: | |
apt: | |
update_cache: yes | |
- name: | |
command: apt list --upgradable | |
register: updates | |
- debug: var=updates.stdout_lines |
View psn-account-id.py
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 python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
import requests | |
from urllib.parse import urlparse, parse_qs, quote, urljoin | |
import pprint | |
import base64 |
View .htaccess
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
######################################################################## | |
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2020 | |
# ---------------------------------------------------------------------- | |
# @Author: Andreas Hecht | |
# @Author URI: https://seoagentur-hamburg.com | |
# License: GNU General Public License v2 or later | |
# License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
######################################################################## | |
View mycli-ssh
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 | |
# -*- coding: utf-8 -*- | |
""" | |
Use mycli (http://mycli.net/) through ssh | |
Usage: | |
$ mycli-ssh yourhost [extra args passed to mycli] | |
""" |
View createuserdb
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 | |
PASS=`pwgen -s 40 1` | |
USER=`pwgen -B 10 1` | |
mysql -uroot <<MYSQL_SCRIPT | |
CREATE DATABASE $USER; | |
CREATE USER '$USER'@'localhost' IDENTIFIED BY '$PASS'; | |
GRANT ALL PRIVILEGES ON $USER.* TO '$USER'@'localhost'; | |
FLUSH PRIVILEGES; | |
MYSQL_SCRIPT |
View update_bl.sh
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 | |
echo "Removing old files..." | |
[ -f /tmp/hosts.working ] && rm -f /tmp/hosts.working | |
whitelist='/(api.solvemedia.com)/' | |
blacklist='https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts http://sysctl.org/cameleon/hosts https://adaway.org/hosts.txt http://hosts-file.net/ad_servers.txt http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext ' | |
for url in $blacklist; do | |
curl --silent $url >> "/tmp/hosts.working" |
View cfg_dock.lua
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
de.substyle("active-unselected", { | |
background_colour = "#ffffff", | |
-- | |
-- Ion dock module configuration | |
-- | |
-- Create a dock | |
mod_dock.create{ | |
-- Dock mode: embedded|floating | |
mode="floating", |
View block_china_ufw.sh
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 | |
# UFW blocks for China, Korea, Malaysia, Phillipines, Singapore, Thailand and Vietnam netblocks | |
# Based on http://www.wizcrafts.net/chinese-iptables-blocklist.html | |
# Cambodia (KH) | |
ufw deny from 114.134.184.0/21 to any port 22 | |
# Chinese (CN) IP addresses follow: | |
ufw deny from 1.192.0.0/13 to any port 22 | |
ufw deny from 1.202.0.0/15 to any port 22 |
View wp-cron-mu.php
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 | |
if( php_sapi_name() !== 'cli' ) { | |
die("Meant to be run from command line.\n"); | |
} | |
// Modify this based on site domain | |
$_SERVER['HTTP_HOST'] = 'yoursite.com'; | |
define( 'WP_USE_THEMES', false ); | |
global $wp, $wp_query, $wp_the_query, $wp_rewrite, $wp_did_header; |
NewerOlder