Skip to content

Instantly share code, notes, and snippets.

View turkerali's full-sized avatar

Ali Erturk TURKER turkerali

View GitHub Profile
@turkerali
turkerali / extjs_grid_exporter.md
Created February 9, 2025 16:20 — forked from alex9311/extjs_grid_exporter.md
Sample function to download ExtJS grid data to CSV with filters, hidden columns

Exjts grids make it very easy to filter data, rearrange columns, hide/show columns, and many other things. The problem is that many grid download plugins go back to the store (database) to get the data. All the data modification that is happening on the client-side is not reflected in the download file.

Here is a hacked workaround that takes what is literally displayed on the grid and stuffs it in a CSV for the user. Probably not the most elegant or efficient implementation, but with my grid of ~800 rows and a dozen columns it still is instantaneous.

Credit to this gist and this SO post, which I combined and made a few modifications to to get this.

Further, some of the hardcoded values might need to be changed depending on your grid.

@turkerali
turkerali / samba.conf
Created August 27, 2023 08:33 — forked from livelace/samba.conf
Sample of Samba configuration for Windows ACL support.
[global]
workgroup = EXAMPLE
server string = "data exchange"
# Active Directroy authentication settings
security = ADS
realm = EXAMPLE.COM
password server = dc1.example.com, dc2.example.com *
# Map Active Directory users to these ranges of UID/GID.

Libuv and libev, two I/O libraries with similar names, recently had the privilege to use both libraries to write something. Now let's talk about my own subjective expression of common and different points.

The topic of high-performance network programming has been discussed. Asynchronous, asynchronous, or asynchronous. Whether it is epoll or kqueue, it is always indispensable to the asynchronous topic.

Libuv is asynchronous, and libev is synchronous multiplexing IO multiplexing.

Libev is a simple encapsulation of system I/O reuse. Basically, it solves the problem of different APIs between epoll and kqueuq. Ensure that programs written using livev's API can run on most *nix platforms. However, the disadvantages of libev are also obvious. Because it basically just encapsulates the Event Library, it is inconvenient to use. For example, accept(3) requires manual setnonblocking after connection. EAGAIN, EWOULDBLOCK, and EINTER need to be detected when reading from a socket. This is a

diff -ruN netqmail-1.06-sagredo-org/qmail-smtpd.c netqmail-1.06-sagredo/qmail-smtpd.c
--- netqmail-1.06-sagredo-org/qmail-smtpd.c 2023-03-18 20:21:39.713287500 +0400
+++ netqmail-1.06-sagredo/qmail-smtpd.c 2023-03-18 20:30:23.013991900 +0400
@@ -917,40 +917,6 @@
}
/* rbl: end */
-int sizelimit(arg)
-char *arg;
-{
--- netqmail-1.06-original/qmail-smtpd.c
+++ netqmail-1.06/qmail-smtpd.c
@@ -40,6 +40,7 @@
void tls_nogateway();
int ssl_rfd = -1, ssl_wfd = -1; /* SSL_get_Xfd() are broken */
int forcetls = 1;
+stralloc proto = {0};
#endif
/* start chkuser code */
diff -ruN netqmail-1.06-original/qmail-remote.c netqmail-1.06-sagredo/qmail-remote.c
--- netqmail-1.06-original/qmail-remote.c 2023-03-01 14:21:52.117666700 +0400
+++ netqmail-1.06-sagredo/qmail-remote.c 2023-03-01 14:33:18.689998100 +0400
@@ -331,33 +331,38 @@
void blast()
{
int r;
+ int i;
+ int o;
char ch;
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "sig.h"
#include "stralloc.h"
#include "substdio.h"
#include "subfd.h"
#include "scan.h"
#include "case.h"
diff -ruN netqmail-1.06-original/qmail-remote.c netqmail-1.06/qmail-remote.c
--- netqmail-1.06-original/qmail-remote.c 2023-02-27 13:43:50.904963397 +0400
+++ netqmail-1.06/qmail-remote.c 2023-02-27 20:33:59.409015456 +0400
@@ -560,8 +560,6 @@
X509_free(peercert);
}
- if (smtps) if (smtpcode() != 220)
- quit("ZTLS Connected to "," but greeting failed");
@turkerali
turkerali / aet_vqadmin_fixes_20230218_1256.patch
Created February 18, 2023 09:13
Bugfixes, adds mysql-limits support to vqadmin, various UI improvements.
diff -ruN vqadmin-2.3.7-original/cgi.c vqadmin-2.3.7/cgi.c
--- vqadmin-2.3.7-original/cgi.c 2003-01-27 20:25:59.000000000 +0200
+++ vqadmin-2.3.7/cgi.c 2023-02-13 13:23:52.000000000 +0300
@@ -164,7 +164,7 @@
*p = r;
- memcpy((char *)(p + 1), (char *)(p + 3), (len - 2));
+ memmove((char *)(p + 1), (char *)(p + 3), (len - 2));
@turkerali
turkerali / vpopmail_fixes_20230217_1524.patch
Created February 17, 2023 11:52
Various vpopmail fixes
diff -ruN vpopmail-5.4.33-original/vdelivermail.c vpopmail-5.4.33/vdelivermail.c
--- vpopmail-5.4.33-original/vdelivermail.c 2011-02-28 19:00:45.000000000 +0200
+++ vpopmail-5.4.33/vdelivermail.c 2023-02-17 14:10:02.573403715 +0300
@@ -644,7 +644,7 @@
parse_email(maildir_to_email(address), TheUser, TheDomain, AUTH_SIZE);
vpw=vauth_getpw(TheUser, TheDomain);
}
- if ( vpw!=NULL && (limits.disable_spamassassin==1 ||
+ if ( vpw!=NULL && (limits.disable_maildrop==1 ||
(vpw->pw_gid & NO_MAILDROP)) ) {