Skip to content

Instantly share code, notes, and snippets.

View soykan's full-sized avatar

Soykan Ertürk soykan

View GitHub Profile
@soykan
soykan / ddnsserver.py
Created November 11, 2021 11:15 — forked from pklaus/ddnsserver.py
Simple DNS server (UDP and TCP) in Python using dnslib.py
#!/usr/bin/env python
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import argparse
import datetime
import sys
import time
import threading

Step 1

#loadkeys trq

Step 2

#ls /sys/firmware/efi/efivars
If the command shows the directory without error, then the system is booted in UEFI mode. If the directory does not exist, the system may be booted in BIOS (or CSM) mode. If the system did not boot in the mode you desired, refer to your motherboard's manual.

Step 3

Connect to the network:
Ethernet—plug in the cable.

@soykan
soykan / median-filter.py
Created February 6, 2021 19:43
Noise reduction with median filtering
import cv2
img = cv2.imread('salt-and-pepper-lena.png', cv2.IMREAD_GRAYSCALE)
cv2.imshow('salt-and-pepper noised', img)
"""
İkinci parametremiz komşuluk
matrisi boyutunun satır ve sütun
değerleridir ve tek sayı olmalıdır
"""
import cv2
import numpy as np
lena_low_contrast = cv2.imread('lena-low-contrast.jpeg', cv2.IMREAD_GRAYSCALE)
cv2.imshow('Lena Low Contrast', lena_low_contrast)
lena = cv2.equalizeHist(lena_low_contrast)
cv2.imshow('Lena', lena)
cv2.waitKey(0)
import numpy as np
import cv2
lena_low_contrast = cv2.imread('lena-low-contrast.jpeg', cv2.IMREAD_GRAYSCALE)
cv2.imshow('lena low contrast', lena_low_contrast)
# k indisine sahip n değeri
def number_of_intensities(intensity):
"""
Resimdeki bir yoğunluk değerinin
@soykan
soykan / i3-gaps.sh
Last active February 2, 2021 14:15
i3 gaps ubuntu insallation script
#!/bin/bash
sudo apt install -y libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf libxcb-xrm0 libxcb-xrm-dev automake libxcb-shape0-dev libxcb-xrm-dev git make gcc
mkdir tmp
cd tmp
# clone the repository
git clone https://www.github.com/resloved/i3.git
cd i3
@soykan
soykan / resizing-interpolation.py
Last active January 26, 2021 12:30
Resizing Interpolation on NumPy and OpenCV with Python
import numpy as np
import cv2
def interpolate(window_name, interpolation):
image = np.array([[100, 150, 250],
[50, 200, 120],
[220, 110, 60]], dtype=np.uint8)
cv2.namedWindow('image1', cv2.WINDOW_NORMAL)
cv2.imshow("image1", image)
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.TextView
class MainActivity : AppCompatActivity(), CustomDialog.Callback {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val customDialog: CustomDialog = CustomDialog()
customDialog.show(supportFragmentManager, "CUSTOM_DIALOG")
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="wrap_content"
android:layout_height="wrap_content">
<EditText
android:id="@+id/usernameEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:hint="Username" />
import android.app.Dialog
import android.content.Context
import android.content.DialogInterface
import android.os.Bundle
import android.widget.EditText
import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.DialogFragment
class CustomDialog : DialogFragment() {
private lateinit var callback: Callback