Skip to content

Instantly share code, notes, and snippets.

View ozturkoktay's full-sized avatar

Oktay Ozturk ozturkoktay

View GitHub Profile
#!usr/bin/env python
# -*- coding: utf8 -*-
#: Imports
import MySQLdb
# class: Connection
# A simple mysql connection
# @completed
class Connection:
@ozturkoktay
ozturkoktay / turkish_cleaner.py
Created April 1, 2020 14:41
This is data cleaner for Turkish language.
#!usr/bin/env python
# -*- coding: utf8 -*-
# =============================================================================
# file: universal_cleaner.py
# A file consits of functions for cleaning and purifying an input text
# =============================================================================
#: Imports
import re
from functools import reduce
@ozturkoktay
ozturkoktay / utilities.py
Last active February 26, 2025 16:46
This is helper functions for Python projects.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
import pickle
import codecs
import numpy as np
from functools import reduce
@ozturkoktay
ozturkoktay / dataset_to_wordlist_tr.sh
Last active April 15, 2020 10:42
Convert text dataset to wordlist for Turkish language.
#!/bin/bash
# -*- coding: utf8 -*-
# USAGE: bash dataset_to_wordlist_tr.sh ./input.txt ./output.txt
# This script takes file clean punctuation, digits and convert capital
# latters to smaller and clean non Turkish characters.
# Finally make sorted uniq wordlist for Turkish language.
# If you want to add or remove character you can change line 20.
# Define Variables for input and output
@ozturkoktay
ozturkoktay / wake_up_colab.js
Last active September 5, 2020 19:49
Wake up colab python notebook when training
/* Wake up colab python notebook when training */
function ClickConnect(){
console.log("Working");
document.querySelector("colab-toolbar-button").click()
}
setInterval(ClickConnect,60000)

Execute these lines:

sudo sh -c 'cat > /etc/apt/sources.list.d/focal-dell.list << EOF
deb http://dell.archive.canonical.com/updates/ focal-dell public
deb http://dell.archive.canonical.com/updates/ focal-oem public
deb http://dell.archive.canonical.com/updates/ focal-somerville public
deb http://dell.archive.canonical.com/updates/ focal-somerville-melisa public
EOF'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9FDA6BED73CDC22
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash snd_hda_intel.dmic_detect=0"

-- Fix Touchpad

wget https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190/+attachment/5422562/+files/i2c-hid_standalone.zip

$ unzip i2c-hid_standalone.zip
$ make
$ sudo rmmod i2c_hid
$ sudo insmod /path/to/i2c-hid.ko polling_mode=1
$ sudo cp /path/to/i2c-hid.ko /lib/modules/$(uname -r)/kernel/drivers/hid/i2c-hid/i2c-hid.ko
@ozturkoktay
ozturkoktay / install_ubuntu_apps.sh
Last active May 9, 2022 20:25
Bash script for installing Ubuntu apps.
#!/bin/bash
sudo sed -i 's|http://tr.|http://|g' /etc/apt/sources.list;
tput setaf 1; echo "===> Sytem Update";
sudo apt update && sudo apt upgrade -y && sudo apt install ca-certificates curl gnupg lsb-release -y;
tput setaf 1; tput setaf 1; echo "===> Change Directory";
cd ~/Downloads/