Skip to content

Instantly share code, notes, and snippets.

View asciitohex's full-sized avatar

0x640x610x670x6f asciitohex

View GitHub Profile
@asciitohex
asciitohex / google-dorks
Created September 3, 2019 18:36 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@asciitohex
asciitohex / delete-all-woocommerce-products.php
Created September 3, 2019 14:05 — forked from pejantantangguh/delete-all-woocommerce-products.php
Remove all WooCommerce products from database via SQL
<?php
require dirname(__FILE__).'/wp-blog-header.php';
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')");
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'");
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)");
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')");
@asciitohex
asciitohex / 2018-https-localhost.md
Created August 27, 2019 12:38 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@asciitohex
asciitohex / letsencrypt_2019.md
Created August 27, 2019 12:37 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

<?php
function pan_price(){
$pan_price_old = 0;
$first_loop_done = 0;
$str = file_get_contents('https://kg7jyq8yn3nzcwzxnl7r.bitpanda.com/v1/ticker');
$json = json_decode($str, true);
$time_now = date('H:i:s');
$pan_price_new = $json['PAN']['EUR'];
#!/bin/sh
###############################################################################
#
# install-full-node.sh
#
# This is the earn.com install script for Bitcoin full node based on Bitcoin Core.
# Originally published by ayeowch@gmail.com! Thanks!
#
# This script attempts to make your node automatically reachable by other nodes
@asciitohex
asciitohex / zbalance.sh
Created April 7, 2018 08:33 — forked from lorepozo/zbalance.sh
zbalance: quickly get your zcash addresses (taddr and zaddr) and their balances
#!/bin/sh
# zbalance: quickly get your zcash addresses (taddr and zaddr) and their balances.
# REQUIRES zcash-cli (https://z.cash) AND jq (https://stedolan.github.io/jq)
zaddr_withbalance () {
while read a
do echo $(zcash-cli z_getbalance $a) $a
done
}
/var/ossec/bin/ossec-control stop && rm -rf /var/ossec && rm /etc/init.d/*ossec* && rm /etc/ossec-init.conf
@asciitohex
asciitohex / fail2ban-unban-ip.sh
Created February 15, 2018 09:30 — forked from yolabingo/fail2ban-unban-ip.sh
shell script to remove IPv4 addresses from all fail2ban jails
#!/usr/bin/env bash
function print_help {
echo "remove an ip address from all fail2ban jails"
echo "$(basename $0) ip_address [ip_address] [ip_address]"
}
if [[ -z "$@" ]]
then
print_help
fi
#!/usr/bin/env bash
# IMPORTANT: Run this script from /home/<USER>/ directory: bash -c "$(curl SCRIPT_URL)"
# (optional): Preparing the environment if you want to install zen from source:
# Once you get the VM up and running you need to login with your root account and run below commands.
# apt-get update && apt-get upgrade -y
# apt-get install -y build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libgtk2.0-dev && apt-get autoremove -y