Skip to content

Instantly share code, notes, and snippets.

View turkerali's full-sized avatar

Ali Erturk TURKER turkerali

View GitHub Profile
@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

@turkerali
turkerali / README.md
Created July 15, 2022 05:21 — forked from zoilomora/README.md
How to disable cloud-init in Ubuntu

How to disable cloud-init in Ubuntu

Prevent start

  • Create an empty file to prevent the service from starting

      sudo touch /etc/cloud/cloud-init.disabled
    

Uninstall

@turkerali
turkerali / ReadMe.md
Created June 15, 2022 04:19 — forked from Fabricio20/ReadMe.md
Docker - Nginx + PHP FPM + MariaDB + PhpMyAdmin

Docker

This is a docker-compose template for a lemp stack.

Make sure to change both the root password under the mysql service, and the absolute URI on the phpmyadmin container.
You can also expose phpMyAdmin locally instead of remotely by properly configuring the ports.

Default locations:
(Original) -> (Your server)
/var/www/html -> ./webroot
/etc/nginx -> ./nginx

@turkerali
turkerali / Firewall.js
Created April 18, 2022 07:02 — forked from havvg/Firewall.js
ExtJS 6: JSON Web Token API Login with Promises
Ext.define('App.security.Firewall', {
singleton: true,
requires: [
'App.security.TokenStorage'
],
isLoggedIn: function() {
return null !== App.security.TokenStorage.retrieve();
},
@turkerali
turkerali / libfcgi-example.c
Created April 10, 2022 11:23 — forked from dermesser/libfcgi-example.c
In case anyone wants to see a multi-threaded FastCGI application written with the fcgiapp library.
# include <stdlib.h>
# include <stdio.h>
# include <sys/stat.h>
# include <pthread.h>
# include <fcgiapp.h>
const char* const sockpath = "/tmp/fcgicpp.sock";
@turkerali
turkerali / linuxsocket.c
Created April 9, 2022 07:10 — forked from richiejp/linuxsocket.c
POSIX/Linux socket example I wrote years ago for my blog
/*POSIX/Linux multithreaded socket test
Copyright (c) 2006-2007 Richard Palethorpe
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following
conditions:
@turkerali
turkerali / Raspberry Pi 4 Arm64 Kernel Cross-Compile.md
Created January 31, 2022 03:41 — forked from G-UK/Raspberry Pi 4 Arm64 Kernel Cross-Compile.md
Building the Raspberry Pi 4 Arm64 Linux Kernel

The Raspberry Pi foundation have now released a beta version of an official 64-bit Kernel which can be installed using the rpi-update script. The rpi-update script can be found at https://github.com/Hexxeh/rpi-update/blob/master/rpi-update or through the Raspbian repositories

Introduction

The objective of these instructions is to build a stock 64bit Linux Kernel for use on the Raspberry Pi 4B on a Debian x64 machine (Windows Subsystem for Linux in my case), and deploy on the Raspberry Pi.

Notes:

  • Transfer to Pi is using my NAS in this example, replace with shared drive/memory stick etc. as required.
    • (N: drive on Windows and /mnt/NAS on Linux in this example).
  • For a specific Kernel version replace the 4.19 with the wanted version in the git clone command.
  • Greater than 3GB RAM only currently available on Kernel 4.19
@turkerali
turkerali / install-vbox-guest-additions.sh
Created January 28, 2022 12:45 — forked from parshap/install-vbox-guest-additions.sh
Install VirtualBox Guest Additions on a headless server
wget http://download.virtualbox.org/virtualbox/4.3.12/VBoxGuestAdditions_4.3.12.iso
sudo mkdir /media/iso
sudo mount -o loop ./VBoxGuestAdditions_4.3.12.iso /media/iso
sudo bash /media/iso/VBoxLinuxAdditions.run --nox11
sudo umount /media/iso
@turkerali
turkerali / deb-package-checker.sh
Created January 21, 2022 04:34 — forked from IsaacChapman/deb-package-checker.sh
Check if installed packages satisfy .deb file dependencies
#!/bin/bash
# Determine if .deb package dependencies are met
if [[ -z "$1" || "$1" == '--help' || "$1" == "-h" ]]; then
echo "Usage $0 file.deb"
exit 0
fi
if [[ ! -f "$1" ]]; then