Skip to content

Instantly share code, notes, and snippets.

View hlorand's full-sized avatar
👾

Lorand Horvath 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 / xm_mod_it_TO_mp3.sh
Last active April 19, 2022 00:08
.xm .mod .it TO .mp3 converter bash script using VLC Media Player
#!/bin/bash
###########
# KEYGENMUSIC CONVERTER
###########
# This bash script converts every .xm .mod .it files to mp3 using VLC Media player
# Basically it supports every media format that VLC supports, and converts it to mp3
# if you comment out the file type checking line below.
# Usage:
#
@hlorand
hlorand / foldercompare.sh
Created August 9, 2017 15:40
Compares two folder contents based on MD5 file hashes.
#/bin/bash
#########################
# RECURSIVE FOLDER COMPARE - FILE CONTENT COMPARE
#########################
# Compares two folder contents: Calculates every file's MD5 hash in SEARCH_FOLDER1
# and search for the same exact filehash in SEARCH_FOLDER2. If you renamed the file
# or copied to another location it is not a problem, because MD5 hash remains the same.
# Usage:
#
@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
########################################