Skip to content

Instantly share code, notes, and snippets.

View Sharaf5's full-sized avatar
🏠
Working from home

Abdelaziz Sharaf Sharaf5

🏠
Working from home
View GitHub Profile
@Sharaf5
Sharaf5 / Unhasher.js
Created May 26, 2018 16:03 — forked from xadim/Unhasher.js
Full functions Hashing and Unhashing in Javascript...
//Write JavaScript code to find a ten letter string of characters that contains only letters
//I've been tested with this and here is the solution for those it may interest
/*
Here is the given pseudo code that I changed to retrieve my company's name
It's in 10 words.
I call it a Hasher
*/
function hasher(hashedValue)
@Sharaf5
Sharaf5 / browser_detect.js
Created May 31, 2019 00:19 — forked from ideefixe/browser_detect.js
Detect Browsers, Versions, Mobile, Desktop, and OS with Javascript
var BrowserDetect = {
init: function() {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function(data) {
for (var i = 0; i < data.length; i++) {
var dataString = data[i].string;
var dataProp = data[i].prop;
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
@Sharaf5
Sharaf5 / php.ini
Created June 7, 2019 15:56 — forked from adrienne/php.ini
PHP .ini file
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@Sharaf5
Sharaf5 / a2manage.sh
Last active March 24, 2023 07:15 — forked from smuuf/a2manage.sh
a2enmod and a2dismod for Alpine
#!/bin/sh
# Usage:
# ./a2manage.sh e|d mod1 mod2 mod3
# e: enable
# d: disable
MODS_A_CONF_PATH="/etc/apache2/*.conf"
MODS_B_CONF_PATH="/etc/apache2/conf.d/*.conf"
@Sharaf5
Sharaf5 / freenom.com.ddns.sh
Created June 1, 2023 12:32 — forked from a-c-t-i-n-i-u-m/freenom.com.ddns.sh
Dynamic DNS support shell script for freenom.com
#!/bin/bash
# settings
# Login information of freenom.com
freenom_email="main@address"
freenom_passwd="pswd"
# Open DNS management page in your browser.
# URL vs settings:
# https://my.freenom.com/clientarea.php?managedns={freenom_domain_name}&domainid={freenom_domain_id}
freenom_domain_name="domain.name"
@Sharaf5
Sharaf5 / 01nginx-tls-sni.md
Created June 22, 2023 16:50 — forked from kekru/01nginx-tls-sni.md
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@Sharaf5
Sharaf5 / godot_mingw.sh
Created July 8, 2023 23:17 — forked from Calinou/godot_mingw.sh
Compile Godot using MinGW and generate Windows installers using InnoSetup (from Linux)
#!/bin/sh
set -euo pipefail
# Number of CPU threads to use for building
# Use `./godot_mingw.sh <number of threads>` to specify
THREADS=$1
# Godot Git clone path
GODOT_PATH="$HOME/Documents/Git/godotengine/godot"
@Sharaf5
Sharaf5 / godot_android.bat
Created July 8, 2023 23:21 — forked from Calinou/godot_android.bat
Compile Godot for Android (from Windows)
@ECHO OFF
set threads=%NUMBER_OF_PROCESSORS%
call scons platform=android tools=no target=release_debug verbose=no warnings=no progress=no -j%threads%
call scons platform=android tools=no target=release verbose=no warnings=no progress=no -j%threads%
cd platform\android\java\
call gradlew build
@Sharaf5
Sharaf5 / build_javascript.bat
Created July 8, 2023 23:22 — forked from Calinou/build_javascript.bat
Compile Godot for HTML5 easily (from Windows)
:: This script must be run from a Windows system with the Emscripten SDK
:: installed and configured. 7-Zip and MinGW also need to be installed.
:: Place this script at the root of your Godot Git clone.
:: CC0 1.0 Universal
set threads=%NUMBER_OF_PROCESSORS%
:: Set MinGW path
set PATH=%PROGRAMFILES%\mingw-w64\x86_64-6.2.0-posix-seh-rt_v5-rev0\mingw64\bin\;%PATH%