Skip to content

Instantly share code, notes, and snippets.

View otuva's full-sized avatar
💩

Onur Alp Akin otuva

💩
View GitHub Profile
@otuva
otuva / db2txtdataset.py
Created June 23, 2021 09:45
Change 'English Turkish Dictionary' favorite words db into flashcard dataset. Use '/' for words separator and ';' for card separator. -- 'Ingilizce Turkce Sozluk' favori kelimeler databaseini import edilebilir flashcard datasetine donusturun. Kelime ayraci olarak '/' ve kart ayraci olarak ';' kullanin.
import sqlite3
import csv
import re
# bunu database dosyasinin yeriyle degistirin
DB_FILE_PATH = "/home/tfp/Desktop/script/zendb_yedek230621.db"
# degismeye gerek yok
CSV_FILE_PATH = "words.csv"
NEW_CSV_FILE_PATH = "new.csv"
@otuva
otuva / db2txtdataset.sh
Last active November 15, 2021 12:01
Tr-ing sozluk favorilerini flashcard datasetine ceviren script
#!/bin/bash
# app linki: https://play.google.com/store/apps/details?id=paket.bolum2
# yedek database'inin oldugu yer
db="/home/tfp/zendb_yedek.db"
output_file="/home/tfp/Desktop/output.txt"
main() {
query=$(sqlite3 ${db} <<- EOF
@otuva
otuva / viewsource.css
Created October 22, 2021 06:11
Firefox original viewsource.css file
@charset "utf-8";
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
*|*:root {
background-color: white;
color: black;
@otuva
otuva / selectDate.py
Created October 25, 2021 09:22
LibreOffice Calc python macro to select current date from rows
import datetime
def main(*args, **kwargs):
today = datetime.date.today()
current_date = today.strftime('%d-%m-%Y')
desktop = XSCRIPTCONTEXT.getDesktop()
model = desktop.getCurrentComponent()
sheet = model.CurrentController.ActiveSheet
range = sheet.getCellRangeByName("A1:A900")
@otuva
otuva / dsAlgoPythonSummary.md
Last active May 20, 2023 19:27
Data structures and algorithms in Python summary

Algorithm analysis and Recursion

Algorithm analysis and Recursion (1/4)

Experimental Analysis

from time import time
start time = time()
#run algorithm
@otuva
otuva / bash_length_rc.sh
Created May 3, 2022 08:30
Bash function to calculate length of a given string
len()
{
# $ len <string>
local temp_var=$1
if [[ -z ${temp_var} ]]
# $ echo <string> | len
then
read temp_var
fi
echo "${#temp_var}"
@otuva
otuva / Python_requests_Burp_Zap_proxy.md
Last active August 27, 2022 06:09
Python requests Burp/Zap proxy

Burp

  • After you have downloaded your certificate from Burp (either through the browser or directly from the application's GUI), it is DER formatted. In order to convert it to the needed PEM encoded format, run the following command:
openssl x509 -inform der -in certificate.cer -out certificate.pem
  • You are now ready to export your environment variables and use requests with Burp.
[Desktop Entry]
Type=Application
Name=Xbindkeys
Exec=xbindkeys
NoDisplay=false
Terminal=false
Icon=org.gnome.Settings-keyboard-symbolic
Categories=Accessories;

$ flatpak run com.github.Matoking.protontricks -v --gui

protontricks (INFO): Running inside Flatpak sandbox, version 1.14.0.
protontricks (INFO): Found Steam directory at /home/tfp/.var/app/com.valvesoftware.Steam/.local/share/Steam
protontricks (INFO): Using Steam directory at /home/tfp/.var/app/com.valvesoftware.Steam/.local/share/Steam. You can also define Steam directory manually using $STEAM_DIR
protontricks (INFO): Using default Steam Runtime at /home/tfp/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/steam-runtime
protontricks (INFO): WINETRICKS environment variable is not available. Searching from $PATH.
protontricks (INFO): Found 1 Steam library folders
protontricks (INFO): Currently logged-in Steam user: arauwo
@otuva
otuva / test_branch_output.md
Last active May 20, 2023 19:28
test version
protontricks (INFO): Running inside Flatpak sandbox, version 1.14.0.
protontricks (INFO): Found Steam directory at /home/tfp/.var/app/com.valvesoftware.Steam/.local/share/Steam
protontricks (INFO): Using Steam directory at /home/tfp/.var/app/com.valvesoftware.Steam/.local/share/Steam. You can also define Steam directory manually using $STEAM_DIR
protontricks (INFO): Using default Steam Runtime at /home/tfp/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/steam-runtime
protontricks (INFO): WINETRICKS environment variable is not available. Searching from $PATH.
protontricks (INFO): Found 1 Steam library folders
protontricks (INFO): Currently logged-in Steam user: <USER>
protontricks (INFO): Couldn't find custom shortcuts. Maybe none have been created yet?
protontricks (INFO): User has configured app Proton version (CompatToolMapping): proton_experimental