Skip to content

Instantly share code, notes, and snippets.

View asilbalaban's full-sized avatar

Asil Balaban asilbalaban

View GitHub Profile
@asilbalaban
asilbalaban / run.sh
Created July 17, 2023 06:44
run python script if not running
#!/bin/bash
if ps aux | grep script.py | grep -v grep > /dev/null
then
echo "The script is running."
else
echo "The script is not running."
/usr/bin/python3 ~/teklif-botu/script.py
fi
@asilbalaban
asilbalaban / restart-bluetooth.sh
Created March 29, 2023 13:43
Ubuntu Bluetooth Connectivity Issues Fixer
#!/bin/bash
systemctl stop bluetooth
hciconfig hci0 down
rmmod btusb
modprobe btusb
hciconfig hci0 up
systemctl start bluetooth
import requests
import bcrypt
"""
pip3 install bcrypt
"""
def getSalt(email):
url = "https://api.sorare.com/api/v1/users/" + email
response = requests.get(url)
@asilbalaban
asilbalaban / setup.md
Last active October 3, 2022 11:59
create-desktop-server

sudo apt update sudo apt upgrade sudo apt install tasksel sudo apt install ubuntu-desktop sudo apt install lightdm sudo reboot

sudo apt-get install xrdp systemctl enable xrdp sudo ufw allow 3389/tcp

import keyboard
import time
import random
prompt = str(input('Bir kavram girin: '))
if prompt == '':
prompt = "reglan arm cycling jersey design in bright green, yellow, blue, red, grey, white, black, purple, vivid colors, sharp, realistic, ultra detailed, 8k"
prompt = "cycling jersey design in pastel colors, sharp, realistic, ultra detailed, 8k"
@asilbalaban
asilbalaban / jordanred_export.jsx
Created September 15, 2022 11:05
Custom export script for Adobe Illustrator
// 3D sunum için export scripti
var document = app.activeDocument;
var exportOptions = new ExportOptionsJPEG();
exportOptions.artBoardClipping = true;
exportOptions.antiAliasing = true;
exportOptions.qualitySetting = 100;
scaleTo = 24.91
@asilbalaban
asilbalaban / postgre-reset-auto-increment.sql
Created August 23, 2022 13:27
postgre-reset-auto-increment.sql
SELECT SETVAL(pg_get_serial_sequence('price_ranges', 'id'), (SELECT MAX(id) FROM price_ranges));
@asilbalaban
asilbalaban / atasozleri.py
Created August 22, 2022 09:16
debug yaparken lazım olan random cümleler
def get_random_proverb():
import random
listOfProverb = [
"Acıkan yanağından,susayan dudağından belli olur.",
"Ah alan onmaz, ah yerde kalmaz.",
"Ak köpeğe koyun diye sarılma.",
"Akıl yiğide sermayedir.",
"Al malın iyisini çekme kaygısını.",
"Almak kolay ödemek zordur.",
"Altın kılıç demir kapıyı açar.",
@asilbalaban
asilbalaban / Flask-Production.md
Created August 22, 2022 08:24
Flask ile production notları

# Kurulum

sudo apt-get install apache2 sudo apt-get install libapache2-mod-wsgi-py3 python-dev a2enmod wsgi

Gerekli paketleri kurduktan sonra flask için bir .wsgi dosyası oluşturuyoruz.

@asilbalaban
asilbalaban / pomodoro.py
Created August 19, 2022 08:17
pomodoro.py example
import rumps
class PomodoroApp(object):
def __init__(self):
self.config = {
"app_name": "Pomodoro",
"start": "Start Timer",
"pause": "Pause Timer",
"continue": "Continue Timer",
"stop": "Stop Timer",