Skip to content

Instantly share code, notes, and snippets.

View aidoskz's full-sized avatar

Aidos aidoskz

  • Kazakhstan, Astana
View GitHub Profile
@aidoskz
aidoskz / README.md
Created January 13, 2022 11:52 — forked from jamesbrink/README.md
DDOS Iptables rules

Aggresive IPTables Rules

echo "service iptables restart"| at now + 2 min

iptables --flush

### Drop invalid packets ### 
iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP
@aidoskz
aidoskz / sign.c
Created September 18, 2019 17:41 — forked from lattera/sign.c
Create a digital signature with an RSA private key and verify that signature against the RSA public key exported as an x509 cert. This is just a PoC and the code is pretty ugly.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
@aidoskz
aidoskz / ducks.sh
Created October 29, 2018 11:39 — forked from thebouv/ducks.sh
ducks: linux command for the 10 largest files in current directory
du -cks * | sort -rn | head -11
# Usually set this up in my bash profile as an alias:
# alias ducks='du -cks * | sort -rn | head -11'
# Because it is fun to type ducks on the command line. :)
This gives a overview:
List of Domain operators: ! (Not), | (Or), & (And)
List of Term operators: '=', '!=', '<=', '<', '>', '>=', '=?', '=like', '=ilike', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in', 'child_of'
Usage:
Input records:
@aidoskz
aidoskz / Multiple file text replace in VBScript
Created July 31, 2015 03:52
Multiple file text replace in VBScript. Example: In ExampleFolder have 3 files 1.txt , 2.csv 3.dat We can change | delimeter to TAB
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("D:\ExampleFolder")
Set colFiles = objFolder.Files
For Each objFile in colFiles
Set objFiles = objFSO.OpenTextFile("D:\ExampleFolder\" & objFile.Name, ForReading)
@aidoskz
aidoskz / converter.js
Created January 23, 2015 04:35
from FORM to JSON
JSON.parse(('{"' + $('form').serialize() + '"}').replace(/=+/gi,'":"').replace(/&+/gi,'","'));
@aidoskz
aidoskz / Util.list.pagination
Created November 13, 2014 03:31
Pagination of list table from Oracle SQL
public List<T> getList(long first, long last, String selectSql) throws SQLException {
List<T> list = new ArrayList<T>();
String query = "select * from (select rownum rn,sq1.* from " +
"("+selectSql+") sq1)" +
" sq2 where sq2.rn>=" + first + " and sq2.rn<=" + last;
Statement stmt = this.conn.createStatement();
ResultSet rs = stmt.executeQuery(query);
while (rs.next())
list.add(convert(conn, rs));
rs.close();
select * from
( select a.*, ROWNUM rnum from
( <your_query_goes_here, with order by> ) a
where ROWNUM <= :MAX_ROW_TO_FETCH )
where rnum >= :MIN_ROW_TO_FETCH;