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 <arpa/inet.h>
@mertcangokgoz
mertcangokgoz / get-mikroskop.sh
Created August 22, 2020 08:46
Download Mikroskop Online Catalog
#!/bin/sh
#
# Download Mikroskop Online Catalog
#
# Visit:
# https://migroskop.migros.com.tr/
#
# Requirements:
# apt install wget jq
#
#!/usr/bin/env bash
# Install Rails
trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
set -e
log_info() {
printf "\n\e[0;35m $1\e[0m\n\n"
}
#! /bin/bash
#Check root
if [ $(id -u) != "0" ];
then
echo "Needs to be run by a user with root privilege."
exit 1
fi
# Check debian packages manager
@mertcangokgoz
mertcangokgoz / download-springer.sh
Created April 26, 2020 17:18
springer.com Downloader amme hizmeti
wget "https://link.springer.com/content/pdf/10.1007/978-1-4842-4932-1" -O "Programming Persistent Memory.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-15-2429-5" -O "Forensic Genetics in the Governance of Crime.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-13-8437-0" -O "Autistic Community and the Neurodiversity Movement.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-13-8491-2" -O "Updates on Myopia.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-3-030-41882-3" -O "Audacious Education Purposes.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-3-030-29509-7" -O "The Future of Software Quality Assurance.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-15-0749-6" -O "Understanding China’s School Leadership.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-15-3053-1" -O "Educational Change Amongst English Language College Teachers in China.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-3-03
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
aio threads;
ssl_certificate /root/.acme.sh/mertcangokgoz.com/mertcangokgoz.com.cer;
ssl_certificate_key /root/.acme.sh/mertcangokgoz.com/mertcangokgoz.com.key;
ssl_trusted_certificate /root/.acme.sh/mertcangokgoz.com/fullchain.cer;
@mertcangokgoz
mertcangokgoz / country2flag.py
Created November 28, 2019 16:41
Django country to flag converter
from django import template
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(name="country")
def convertflag(value):
County = {
"AF": "AFGHANISTAN",
@mertcangokgoz
mertcangokgoz / default.vcl
Created November 23, 2019 10:01
varnish configuration for django app
#
# This is an example VCL file for Varnish.
#
# It does not do anything by default, delegating control to the
# builtin VCL. The builtin VCL is called when there is no explicit
# return statement.
#
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
# and https://www.varnish-cache.org/trac/wiki/VCLExamples for more examples.
location / {
error_page 418 = @cachemiss;
error_page 419 = @mobileaccess;
recursive_error_pages on;
if ($request_method = POST) { return 418; }
if ($arg_s != "") { return 418; }
if ($arg_p != "") { return 418; }
if ($arg_amp != "") { return 418; }
#!/bin/bash
# JPG
find $1 -type f -and \( -iname "*.jpg" -o -iname "*.jpeg" \) \
-exec bash -c '
webp_path=$(sed 's/\.[^.]*$/.webp/' <<< "$0");
if [ ! -f "$webp_path" ]; then
cwebp -quiet -q 90 "$0" -o "$webp_path";
fi;' {} \;