Skip to content

Instantly share code, notes, and snippets.

View stefanpejcic's full-sized avatar
:octocat:
Live long and may the source be with you

Stefan Pejcic stefanpejcic

:octocat:
Live long and may the source be with you
View GitHub Profile
@leandronsp
leandronsp / 001-server.bash
Last active February 28, 2024 19:44
A complete yet simple Web server (with login & logout system) written in Shell Script
#!/bin/bash
## Create the response FIFO
rm -f response
mkfifo response
function handle_GET_home() {
RESPONSE=$(cat home.html | \
sed "s/{{$COOKIE_NAME}}/$COOKIE_VALUE/")
}
@stefanpejcic
stefanpejcic / check-websites.py
Created January 8, 2020 09:01
check status codes from a list: http://whois.wporb.com/
from bs4 import BeautifulSoup,SoupStrainer
import urllib.request
import colorama,re,queue,threading
from colorama import Fore
from urllib.parse import *
class check_link():
def __init__(self,address):
self.address=address
def check(self,address):
@chris124567
chris124567 / WHOIS server by TLD List
Last active June 10, 2021 14:26
I used this python script to download whois information for all TLDs from IANA whois server, then used text manipulation and grep to get the data into the format below
MITSUBISHI:whois.nic.gmo
XN--3BST00M:whois.gtld.knet.cn
PW:whois.nic.pw
MUSEUM:whois.nic.museum
AMERICANFAMILY:whois.nic.americanfamily
RMIT:whois.nic.rmit
MOTORCYCLES:whois.afilias-srs.net
PROPERTIES:whois.nic.properties
STUDY:whois.nic.study
LY:whois.nic.ly
@stefanpejcic
stefanpejcic / readme.txt
Created July 21, 2019 10:57
Default readme file for wordpress.org plugin
=== Plugin Name ===
Contributors: (this should be a list of wordpress.org userid's)
Donate link: https://example.com/
Tags: comments, spam
Requires at least: 4.8
Tested up to: 5.3
Stable tag: 5.2
Requires PHP: 5.2.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
/*global self, document, DOMException */
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
// Full polyfill for browsers with no classList support
if (!("classList" in document.createElement("_"))) {
(function (view) {
"use strict";
@tzhenghao
tzhenghao / my.html
Created January 14, 2019 03:14
SQ Scammer html script
<!DOCTYPE html>
<head>
<meta property="og:image" content="https://www.airlineratings.com/wp-content/uploads/uploads/singapore_airlines_logo-200x.jpg" />
<meta property="og:title" content="Singapore Airlines is giving away Free tickets to celebrate its 70th Anniversary" />
<script type="text/javascript" language="javascript">
var areYouReallySure = false;
var internalLink = false;
if (typeof window.orientation == 'undefined' && screen.width >= 1000){window.location.href = 'http://google.com'; areYouReallySure=true;}
@Bluscream
Bluscream / cloudflare_failover.py
Last active January 5, 2021 09:13
Cloudflare Failover System for free
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Origin: https://gist.github.com/Bluscream/c0f794186d0236e072b1826987c9390e
from json import dumps, loads
from requests import request
from random import choice
from socket import socket, AF_INET, SOCK_STREAM
domain = "" # Your tld
zone_id = "" # Your zoneid
@countryroadgraphics
countryroadgraphics / Bash for cPanel
Created March 6, 2018 13:06
Bash commands for cPanel servers
<h4>Use at your own risk. Some of these commands remove data and/or terminate processes.</h4>
<h1><b>Load
</b></h1>
<strong>WordPress attacks</strong>
<code>egrep -c '(wp-comments-post.php|wp-login.php|xmlrpc.php)' /usr/local/apache/domlogs/* |grep -v "_log" |sort -t: -nr -k 2 |head -5 |tee /tmp/delete_check |cut -d'/' -f6; for domlog in $(cut -d':' -f1 /tmp/delete_check); do echo; echo $domlog; echo; echo wp-login.php :: $(grep -c wp-login.php $domlog); echo; grep wp-login.php $domlog | cut -d' ' -f1|egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' |sort |uniq -c |sort -nr | head; echo; echo xmlrpc.php :: $(grep -c xmlrpc.php $domlog); echo; grep xmlrpc.php $domlog |cut -d' ' -f1 |egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' |sort |uniq -c |sort -nr | head; echo; echo wp-comments-post.php :: $(grep -c wp-comments-post.php $domlog); echo; grep wp-comments-post.php $domlog |cut -d' ' -f1 |egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' |sort |uniq -c |sort -nr | head; echo; done
@EricBusch
EricBusch / deploy.sh
Last active April 15, 2023 13:10
Deploy your plugin to the WordPress.org SVN plugin repository from your GitHub Repository.
#! /bin/bash
#
# Script to deploy from Github to WordPress.org Plugin Repository
# A modification of a number of different sources:
# @link https://github.com/deanc/wordpress-plugin-git-svn
# @link https://github.com/GaryJones/wordpress-plugin-svn-deploy
# @link https://github.com/thenbrent/multisite-user-management/blob/master/deploy.sh
#
# Accompanying Tutorial Here:
# @link https://ericbusch.net/?p=106
@styblope
styblope / docker-api-port.md
Last active May 3, 2024 02:08
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}