Skip to content

Instantly share code, notes, and snippets.

@erhaem
erhaem / combine-splitted-zip.php
Created December 11, 2023 08:03
Used when `upload_max_filesize = 1M`. lmao
<?php
function combineAndExtract($archiveName, $outputDirectory)
{
// Combine split parts into a single ZIP file
$combinedArchivePath = combineSplitZip($archiveName);
// Extract the combined ZIP archive
extractZip($combinedArchivePath, $outputDirectory);
// Optionally, you can delete the combined ZIP file
@erhaem
erhaem / ftp.php
Last active December 11, 2023 07:08
FTP File Upload
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FTP File Upload</title>
</head>
<body>
<h2>File Upload via FTP</h2>
<form action="" method="post" enctype="multipart/form-data">
@erhaem
erhaem / bypass_login_tplink_10_attempts.js
Last active December 6, 2023 10:58
Bypass Login TPLink Router: "You have exceeded ten attempts."
@erhaem
erhaem / settings.json
Created August 30, 2023 09:33
my vscode (vscodium btw) settings
{
"workbench.editor.showTabs": false,
"workbench.colorTheme": "One Dark Pro Flat",
"workbench.colorCustomizations": {
"[One Dark Pro Flat]": {
"tab.activeBackground": "#282c34",
"activityBar.background": "#282c34",
"sideBar.background": "#282c34",
"tab.activeBorder": "#282c34",
"sideBar.border": "#282c34"
@erhaem
erhaem / fb_view-full-size_image_bookmarklet.js
Last active August 16, 2023 13:02
Facebook Tool: View Full Size Image. Copy the bookmarklet version, paste it on the bookmark bar; then click it.
javascript:(function(a){var b=new URL(a.location);0>b.hostname.indexOf("facebook.com")?alert("Only works on Facebook's domains"):"/photo.php"!==b.pathname?alert("Only works at *.facebook.com/photo.php"):(b=b.searchParams.get("fbid"))?a.location.replace("https://m.facebook.com/photo/view_full_size/?fbid="+b):alert("`fbid` not found")})(window)
@erhaem
erhaem / anti_page-splitting.js
Last active August 7, 2023 06:10
Tired of shitty Indonesian News sites' page-splitting? This tool allows you to deal with it by redirecting you to the entire content page. You may use this tool with Greasemonkey or alike, or even putting it on bookmark bar (Bookmarklet) by putting "javascript:" before the whole script.
/**
* Indonesian News Sites' Page-splitting Deterrent Tool
* @author Rifqi Haidar
*/
(function () {
const averageParam = "?page=all";
// pattern: { domainName: endpoint??params }
const sites = {
"detik.com": "?single=1",
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
var CryptoJS=CryptoJS||function(c,t){var e={},r=e.lib={},i=function(){},n=r.Base={extend:function(t){i.prototype=this;var e=new i;return t&&e.mixIn(t),e.hasOwnProperty("init")||(e.init=function(){e.$super.init.apply(this,arguments)}),(e.init.prototype=e).$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=r.WordArray=n.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||o).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes;if(t=t.sigBytes,this.clamp(),i%4)for(var n=0;n<t;n++)e[i+n>>>2]|=(r[n>>>2]>>>24-n%4*8&255)<<24-(i+n)%4*8;else if(65535<r.leng
@erhaem
erhaem / aes.js
Last active February 6, 2019 12:21
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
var CryptoJS=CryptoJS||function(c,t){var e={},r=e.lib={},i=function(){},n=r.Base={extend:function(t){i.prototype=this;var e=new i;return t&&e.mixIn(t),e.hasOwnProperty("init")||(e.init=function(){e.$super.init.apply(this,arguments)}),(e.init.prototype=e).$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=r.WordArray=n.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||s).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes;if(t=t.sigBytes,this.clamp(),i%4)for(var n=0;n<t;n++)e[i+n>>>2]|=(r[n>>>2]>>>24-n%4*8&255)<<24-(i+n)%4*8;else if(65535<r.leng