Skip to content

Instantly share code, notes, and snippets.

View hlorand's full-sized avatar
👾

Loránd Horváth hlorand

👾
View GitHub Profile
@hlorand
hlorand / ponciusz.php
Created July 25, 2017 16:37
Ponciusz Pilatusz Conveltel
<?
if ( isset ($_POST['url']) || isset ($_GET['url']) )
{
$url = $_POST['url'];
if(isset($_GET['url'])) { $url = $_GET['url']; }
if ( filter_var($url, FILTER_VALIDATE_URL) === false ){
echo "Nem adtal meg webcimet vagy rossz formatumban van";
echo "<meta http-equiv=\"refresh\" content=\"3; url=./\">";
return false;
@hlorand
hlorand / set_opendns.sh
Last active August 9, 2017 14:28
Set OpenDNS servers as default dns servers on OSX
export PATH="/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin"
echo "yourpassword" | sudo -S networksetup -setdnsservers Wi-Fi 208.67.222.222 208.67.220.220
echo "yourpassword" | sudo -S networksetup -setdnsservers Ethernet 208.67.222.222 208.67.220.220
@hlorand
hlorand / server_memory.php
Created August 30, 2017 07:17
Server memory usage checker
<!doctype html>
<html>
<head>
<meta http-equiv="refresh" content="1">
</head>
<body>
Server memory usage:
<?php
$data = explode("\n", file_get_contents("/proc/meminfo"));
@hlorand
hlorand / website_copy_protection.htm
Last active April 18, 2024 02:44
Website copy protection solutions
<!--
Simple webpage copy protection by hlorand
- diables selection
- disables right click
- prevents PrintScreening the page
- if page saved offline, hides body (uncomment to use it, and specify a domain) or shuffles characters
This code achieves above things using JavaScript. The content you want to protect
is located in the source code and a qualified programmer can easily extract it.
To make his work harder, a better solution is to dynamically download content
@hlorand
hlorand / isup.sh
Created September 23, 2017 22:32
Website UP or DOWN checker
#!/bin/bash
# check every 10 seconds if a website is up or down
WEBSITE=$1
while true; do
#curl downloads only HTTP header in silent mode
#head gets the first line
#grep searches for HTTP 200 OK status code and outputs the number of lines found
@hlorand
hlorand / js_play_stop_youtube.htm
Created September 24, 2017 18:24
jQuery: Play Stop YouTube video
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
function stopvideo(id){
@hlorand
hlorand / get_facebook_reactions_count.php
Created December 29, 2017 22:32
PHP Facebook reactions(like,wow,sad,angry,love,haha,thankful) counter
<!DOCTYPE html>
<html>
<head>
<title>Facebook reactions counter</title>
<meta http-equiv="refresh" content="60">
<meta charset="UTF-8">
<base target="_blank">
</head>
<body>
#!/bin/bash
######################################
# REMOVES HUNGARIAN LETTER ACCENTS FROM FILENAMES IN CURRENT FOLDER
# Works with OSX special character representation
# ( https://stackoverflow.com/questions/6153345/different-utf8-encoding-in-filenames-os-x )
# Usage:
# chmod +x removeaccents.sh
# ./removeaccents.sh
########################################
@hlorand
hlorand / checksum_files.sh
Created January 29, 2018 18:27
Caclucates and prints the md5 hash, sha1 hash and file modification date to a .txt file, separated by commas
#!/bin/bash
######################################
# Caclucates and prints the following data to a .txt file separated by commas;
# - MD5 hash
# - SHA1 hash
# - file modification date
# - filename
########################################
@hlorand
hlorand / remove_wordpress_traces.md
Last active April 7, 2018 15:02
How To Hide The Fact That Your Website Runs On WordPress

Hide The Fact That Your Website Runs On WordPress

Place these lines above the "That's all, stop editing! Happy blogging." line in wp-config.php

Rename wp-content folder

Rename "wp-content" folder to "assets" or whatever you like. Modify https to http if you dont use secure connection.