Skip to content

Instantly share code, notes, and snippets.

@zdienos
zdienos / git-all.bash
Created March 23, 2022 06:38 — forked from henryiii/git-all.bash
Fast repository status for repos in git folder
#!/usr/bin/env bash
# This script should be named (or symbolically linked) as git-all so that
# it can be run as a git command (if it is in the path). The repo location should
# be set in REPOLOC. Can be relative if this script is also in a repo!
# Standard bash stuff to get the current directory
unset CDPATH
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
@zdienos
zdienos / boyer-moore.php
Created January 8, 2022 11:06 — forked from daredmayo/boyer-moore.php
Boyer-Moore string match algorithm
<?php
define('ALPHABET_SIZE',1);
function compute_prefix($str,$size,&$result=0)
{
$result = $result[$size + 1];
$q;
$k;
$result[0] = 0;

The process starts by creating the CSR and the private key:

openssl req -nodes -newkey rsa:2048 -nodes -keyout dotmarks.net.key -out dotmarks.net.csr -subj "/C=GB/ST=London/L=London/O=dotmarks/OU=IT/CN=dotmarks.net"

Generates

  • dotmarks.net.key
  • dotmarks.net.csr
@zdienos
zdienos / codeiginter-server-config.md
Created September 29, 2021 06:06 — forked from yidas/codeiginter-server-config.md
Codeigniter 3 server configuration for Nginx & Apache

Codeigniter 3 server configuration for Nginx & Apache

Web Server Site Configuration

Recommended Apache Configuration

Use the following configuration in Apache's httpd.conf file or within a virtual host configuration. Note that you should set DocumentRoot and ServerName fit to your environment:

@zdienos
zdienos / mail.php
Created August 21, 2021 10:32
send mail php
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Mailer
|--------------------------------------------------------------------------
|
| This option controls the default mailer that is used to send any email
@zdienos
zdienos / script.txt
Created August 17, 2021 14:33
limit bandwidth otomatis mikrotik
# ---------- AGAR TIDAK BINGUNG BUKA - EDIT DENGAN APLIKASI NOTEPAD++ ---------- ;
# ---------- Silahkan ganti sesuai dengan kondisi mikrotik dan jatah speed WAN ---------- ;
# ---------- Copy script dan jalankan dengan run scheduler ---------- ;
:local BridgeName "bridge-vlan" ; #IP Firewall Mangle Interface - Interface yang akan dilimit contoh Port2, Port3, Bridge1, Bridge2,... ;
:local ServerName "server-VLAN" ; #IP DHCP Server Leasess Server - Nama DHCP Server yang digunakan, untuk mencari perangkat yang aktif ;
:local IdentiName "vlan-200" ; #Nama sebagai Identitas pada Queuess Tree : Digunakan untuk hapus otomatis dan pembeda jika script lebih dari 1;
:local LimitParentDownload "30M" ; #Batas Maksimal Limit Download untuk parent global ;
@zdienos
zdienos / script.txt
Created August 17, 2021 14:21
automatic simple queue for mikrotik hotspot user
LOGIN
:global MaxLimitDown "4000"
:global MaxLimitUp "4000"
:local nama $user
/queue simple remove [/queue simple find name~"$nama"]
:local total [/ip hotspot active print count-only where user=$nama]
:if ($total =0) do={
:local LimitDOWN ($MaxLimitDown / $total)
:local LimitUP ($MaxLimitUp / $total)
/queue simple add name=$address target=$address max-limit=($LimitUP."k/".$LimitDOWN."k") comment=$nama place-before=0;
@zdienos
zdienos / anti-dhcp-flood.txt
Created July 21, 2021 06:45
anti dhcp flooding with mikrotik
/ip firewall filter add chain=syn-flood action=return tcp-flags=syn,!fin,!rst,!ack protocol=tcp limit=5,10
/ip firewall filter add chain=syn-flood action=return protocol=!tcp disabled=yes
/ip firewall filter add chain=syn-flood action=return tcp-flags=!,syn,!fin,!rst,!ack protocol=tcp disabled=yes
/ip firewall filter add chain=syn-flood action=log log-prefix=”SYN FLOOD:”
/ip firewall filter add chain=syn-flood action=drop disabled=yes
@zdienos
zdienos / conficker.txt
Created July 21, 2021 06:44
conficker bloker with mikrotik
*****************
konficker blocker
*****************
/ip firewall filter add chain=virus protocol= udp dst-port=135 action=drop comment=”Confiker” disabled=no
/ip firewall mangle
add chain=prerouting protocol=udp dst-port=445 action=mark-connection new-connection-mark=conn-conficker comment=”445-UDP” disabled=no passthrough=yes
add chain=prerouting protocol=tcp dst-port=445 action=mark-connection new-connection-mark=conn-conficker comment=”445-TCP” disabled=no passthrough=yes
add chain=prerouting protocol=tcp dst-port= 135,137,138,139 action=mark-connection new-connection-mark=conn-conficker comment=”135,137,138,139-TCP” disabled=no passthrough=yes
<?php
require __DIR__ . '/vendor/autoload.php';
use Mike42\Escpos\Printer;
//jika menggunakan koneksi printer usb sahre
use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
//jika menggunakan koneksi jaringan
use Mike42\Escpos\PrintConnectors\NetworkPrintConnector;
use Mike42\Escpos\CapabilityProfiles\StarCapabilityProfile;