Skip to content

Instantly share code, notes, and snippets.

View mertcangokgoz's full-sized avatar
👋
Hi

Mertcan GÖKGÖZ mertcangokgoz

👋
Hi
View GitHub Profile
#include <time.h>
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <time.h>
#include <arpa/inet.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
@mertcangokgoz
mertcangokgoz / TCRandom.c
Created February 16, 2016 13:04
Geçerli Random TC
/*
**
** derleme:
** gcc -O3 -DMAX_THREAD=2 tcnouretici.c -lpthread
**
** i7-4770k 8 thread
** ./a.out > /dev/null 0.02s user 0.01s system 473% cpu 0.008 total
** ./a.out > /dev/null 0.03s user 0.00s system 382% cpu 0.008 total
** ./a.out > /dev/null 0.03s user 0.00s system 484% cpu 0.007 total
** ./a.out > /dev/null 0.03s user 0.00s system 377% cpu 0.008 total
@mertcangokgoz
mertcangokgoz / ShortURL.sh
Last active August 10, 2016 15:39
Git.io: GitHub URL Shortener via console
#! /bin/bash
set -e
if [[ -z "$1" ]];
then
echo "Please enter a website url"
exit 1
else
if [[ -z "$2" ]];
@mertcangokgoz
mertcangokgoz / tftpServer.sh
Last active January 19, 2023 04:28
macOS Sierra and Missing TFTP Server Management Tool
#!/bin/bash
# macOS Sierra TFTP Server Creator
# Author Mertcan GÖKGÖZ - 07.05.2017 15:00 (GMT +3)
#
# Requirements
# - Macos Sierra 10.12.4 and later
# - 'homebrew' package manager
# - brew install dialog
#
# How to use
Final benchmark results, sorted by nameserver performance:
(average cached name retrieval speed, fastest to slowest)
192.168. 0. 15 | Min | Avg | Max |Std.Dev|Reliab%|
----------------+-------+-------+-------+-------+-------+
+ Cached Name | 0,001 | 0,003 | 0,062 | 0,009 | 100,0 |
+ Uncached Name | 0,060 | 0,117 | 0,305 | 0,077 | 100,0 |
+ DotCom Lookup | 0,062 | 0,070 | 0,085 | 0,005 | 100,0 |
---<-------->---+-------+-------+-------+-------+-------+
GatewayPi
shred —verbose —random-source=/dev/zero —iterations=5 /dev/sda
rewrite ^(.*).html$ https://xxxxx.com/$2(.*) permanent;
rewrite ^(/.+)\.html$ $1 permanent;
Telefon Numarası Regex // Phone Number
@"^(0[1-9](\d{2}) (\d{3}) (\d{2}) (\d{2}))$
Mail Adresi Regex //E-Mail Adress
@"^\w+[\w-\.]*\@\w+((-\w+)|(\w*))\.[a-z]{2,3}$"
Tarih Formatı Regex //Date
@"(((0[1-9]|[12][0-9]|3[01])([/])(0[13578]|10|12)([/])([1-2][0,9][0-9][0-9]))|(([0][1-9]|[12][0-9]|30)([/])(0[469]|11)([/])([1-2][0,9][0-9][0-9]))|((0[1-9]|1[0-9]|2[0-8])([/])(02)([/])([1-2][0,9][0-9][0-9]))|((29)(\.|-|\/)(02)([/])([02468][048]00))|((29)([/])(02)([/])([13579][26]00))|((29)([/])(02)([/])([0-9][0-9][0][48]))|((29)([/])(02)([/])([0-9][0-9][2468][048]))|((29)([/])(02)([/])([0-9][0-9][13579][26])))")
Sadece Rakam Girişine İzin Veren Regex // Only Number
create database database_name;
CREATE USER 'database_user'@'localhost' IDENTIFIED BY 'database_password';
GRANT ALL PRIVILEGES ON * . * TO 'database_user'@'localhost';
FLUSH PRIVILEGES;
exit