Skip to content

Instantly share code, notes, and snippets.


Yusuf Al Majid ajid2

View GitHub Profile
mikeschinkel /
Last active Oct 17, 2021
Examples for how a __toArray() magic method could be useful in PHP.

Examples for how a __toArray() magic method could be useful in PHP.

In a nutshell, __toArray() would not be as useful when you have full control over the entire codebase.

But where __toArray() would be extremely useful is in interfacing with existing code that expects arrays and wants those arrays to be a specific format. Using classes and type-hinted methods allow to encapsulate the intelligence into the class, and using __toArray() makes for a nature use-case.

malwareslayer / magazinesre0x0.markdown
Last active Apr 14, 2020
Indoxploit Magazines 0x0: Cepat Memahami Instruksi Assembly
View magazinesre0x0.markdown


Reverse Engineering Enhanced Edition | Refixes: 0x1

Apa Itu Assembly ?

Assembly adalah bahasa pemrograman CPU yang dibuat berdasarkan Native Processor Language atau biasa disebut Instructions Set Architecture (ISA).

JohannesDeml /
Last active Jan 5, 2022
Batch converter for windows using inkscape and the command line

Batch convert svg|pdf|eps|emf|wmf to eps|pdf|png|svg

Screenshot Batch converter for Windows using Inkscape with the command line
InkscapeBatchConvert is an easy to use solution to quickly convert all files of a folder to another type without the need to open Inkscape. The program uses Windows Batch scripting and will only work on Windows.
Tested with Inkscape 0.9.x - 1.0.x


  1. Download _InkscapeBatchConvert.bat
  2. Put it in the folder where you have files you wish to convert.
  3. Then double click the file to start it.
simonw /
Created Dec 9, 2016
Recursive wget ignoring robots
$ wget -e robots=off -r -np ''
  • -e robots=off causes it to ignore robots.txt for that domain
  • -r makes it recursive
  • -np = no parents, so it doesn't follow links up to the parent folder
Ocramius /
Last active Dec 21, 2021
`__invoke` vs `function` vs `Closure`
tomasinouk /
Last active Jan 20, 2022
examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot).

Some examples of SNAT, DNAT with iptables with comments

mainly used in start-up script

How to test 'safely'

When we play with iptables aka firewall we might end up in situation, where we execute rule, which has unforseen impact - lock yourself out. Recovering from this situation is necessity.

How to:

  • Enable reboot via SMS.
  • Test all commands in shell first before putting them into Start-up script. This way the command will be wiped out, when unit is rebooted.

masquarade all outgoing packets to be WLAN0 IP

denji /
Last active Jan 20, 2022
NGINX tuning for best performance

Moved to git repository:

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

lastguest / Chainable.class.php
Last active Jul 13, 2021
PHP Class Chainable.Wrapper for convenient chaining methods.
View Chainable.class.php
* Class Chainable
* Wrapper for convenient chaining methods
* @author Stefano Azzolini <>
class Chainable {
private $instance = null;
KartikTalwar /
Last active Jan 18, 2022
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
MrDys / gist:3512455
Created Aug 29, 2012
Link directly to an open modal window in Bootstrap
View gist:3512455
/* If you've ever had the need to link directly to an open modal window with Bootstrap, here's a quick and easy way to do it:
Make sure your modal has an id:
<div class="modal" id="myModal" ... >
Then stick this bit of Javascript at at the end of your document:
$(document).ready(function() {