Skip to content

Instantly share code, notes, and snippets.

View unique1984's full-sized avatar
💭
I may be slow to respond.

Yasin KARABULAK unique1984

💭
I may be slow to respond.
View GitHub Profile
@unique1984
unique1984 / installer.sh
Last active November 24, 2023 21:00
OpenZFS - ZFS as a Root File System on Debian Bullseye
#!/usr/bin/env bash
###########################################################################################################
# Bash Script of this Documentation :
# https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bullseye%20Root%20on%20ZFS.html#debian-bullseye-root-on-zfs
#
# Copyright © 2022 - installer.sh
# Yasin Karabulak
# info@yasinkarabulak.com
# https://github.com/unique1984
#
@CanNuhlar
CanNuhlar / TDK_Scraper.py
Created August 2, 2018 19:57
Created from terminal
# -*- coding: utf-8 -*-
import requests
from HTMLParser import HTMLParser
import re
class PageNumParser(HTMLParser):
def handle_data(self, data):
if "sayfanın" in data:
getContent(int(re.search(r'\d+', data).group()))
class wordParser(HTMLParser):
@mrothNET
mrothNET / LetsEncrypt+certbot+UFW+postfix+dovecot.md
Last active October 27, 2023 00:36
Let's Encrypt / Dovecot / Postfix / UFW firewall / Certbot

Let's Encrypt / Dovecot / Postfix / UFW firewall / Certbot

This tutorial describes how to install TLS to a mail server consisting of Postfix and/or Dovecot by using Let's Encrypt certificates with automatic renewing and firewall management.

The system used for this tutorial was:

$ lsb_release -idrc
Distributor ID: Ubuntu
@asimmittal
asimmittal / scrapeUsingJQuery.js
Created October 4, 2017 16:01
JqueryScraper
console.log("---> Running");
const curl = require("curl");
const jsdom = require("jsdom");
const url = "http://www.imdb.com/list/ls004489992/";
curl.get(url, null, (err,resp,body)=>{
if(resp.statusCode == 200){
parseData(body);
}
@tlhunter
tlhunter / average-geolocation.js
Created May 17, 2017 18:00
Calculate the center/average of multiple GeoLocation coordinates
/**
* Calculate the center/average of multiple GeoLocation coordinates
* Expects an array of objects with .latitude and .longitude properties
*
* @url http://stackoverflow.com/a/14231286/538646
*/
function averageGeolocation(coords) {
if (coords.length === 1) {
return coords[0];
}
@mustafaturan
mustafaturan / network-tweak.md
Last active June 16, 2024 21:58
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@ilkermanap
ilkermanap / real_distance.py
Last active January 19, 2019 22:09
Distance between two points with earth curve
def distance(lt1,ln1, lt2,ln2, in_meters = True):
"""
distance between two coordinates in meters
or in
"""
R = 6371000 # earth radius
theta1 = lt1 * PI / 180
theta2 = lt2 * PI / 180
delta_theta = (lt2 -lt1) * PI / 180
delta_fi = (ln2 - ln1) * PI / 180
# This xorg configuration file will start a dummy X11 server.
# move it to /etc/X11/xorg.conf
# don't forget apt install xserver-xorg-video-dummy;
# based on https://xpra.org/Xdummy.html
Section "ServerFlags"
Option "DontVTSwitch" "true"
Option "AllowMouseOpenFail" "true"
Option "PciForceNone" "true"
Option "AutoEnableDevices" "false"
@RomainMarecat
RomainMarecat / .gitlab-ci.sh
Last active April 25, 2022 03:56
Simple gitlab-ci configuration symfony
#!/bin/bash
# Install dependencies only for Docker.
[[ ! -e /.dockerinit ]] && exit 0
set -xe
# Update packages and install composer and PHP dependencies.
apt-get update -yqq
apt-get install git libcurl4-gnutls-dev libicu-dev libmcrypt-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libpq-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev phpunit -yqq
@sarpdorukaslan
sarpdorukaslan / phpstorm.protokol.md
Last active February 24, 2019 06:03
phpstorm için protokol (URI) işleyici ekler [Ubuntu \ xFCE]

mimeapps.list içine [Added Associations] altında bir satıra
aşağıdaki satırı ekle

x-scheme-handler/phpstorm=phpstorm-php.desktop

phpstorm-php.desktop içeriği

[Desktop Entry]
Type=Application
Name=PHPStorm IDE