Skip to content

Instantly share code, notes, and snippets.

View ozkansen's full-sized avatar
:octocat:

Özkan ŞEN ozkansen

:octocat:
View GitHub Profile
@ozkansen
ozkansen / shell_plus.py
Last active March 12, 2019 20:50 — forked from lorne-luo/python_console_for_pycharm.py
django_extensions' shell_plus for Pycharm's python console
# Note : settings.py define in DEBUG_EXTENSIONS true
# add Pycharm -> Settings -> Django Console
# Shell Plus
try:
from django.conf import settings
from pprint import pprint
from django.core.management.color import no_style
if settings.DEBUG_EXTENSIONS:
from django_extensions.management.shells import import_objects
@ozkansen
ozkansen / goland64.vmoptions
Created March 21, 2019 11:00 — forked from halidaltuner/goland64.vmoptions
Performance tuning for Goland or other Jetbrains IDEs.
# custom GoLand VM options
-server
-Xms2g
-Xmx2g
-Xss16m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
@ozkansen
ozkansen / jupyter_install_note.sh
Last active January 11, 2020 07:16
Jupyter Install Notes
pip install jupyter jupyter-contrib-nbextensions jupyter_nbextensions_configurator --user && \
jupyter contrib nbextension install --user && \
jupyter nbextensions_configurator enable --user
Type Foundry Log
Thought it might be nice to share or maintain a log or list of foundries.
http://www.felicianotypefoundry.com/
http://www.fontsmith.com/fonts/
http://sudtipos.com/home
http://www.type-together.com/
http://fontfabric.com/
http://www.letterheadfonts.com/
http://thedaleguild.com/
@ozkansen
ozkansen / .env
Last active April 29, 2020 09:55
vscode python src folder settings. Add file in workspace folder
PYTHONPATH=./src:${PYTHONPATH}
@ozkansen
ozkansen / networkmanager-wifi-powersave.md
Created May 20, 2020 07:43 — forked from jcberthon/networkmanager-wifi-powersave.md
NetworkManager Wi-Fi powersaving configuration

NetworkManager WiFi Power Saving

NetworkManager supports WiFi powersaving but the function is rather undocumented.

From the source code: wifi.powersave can have the following value:

  • NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
  • NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
  • NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
from subprocess import Popen, PIPE, TimeoutExpired
from typing import Tuple
def execute_command(
command: str, sudo: bool = False, shell: bool = False
) -> Tuple[str, str, int]:
"""
Subprocess Execute Command
@ozkansen
ozkansen / sensor_read.py
Last active September 21, 2020 11:36
Ardunio analog pin is not attached sensor read value problem
#!/usr/bin/env python3
# Using python package : https://pypi.org/project/pyFirmata/
from pyfirmata import Arduino, util
board = Arduino("/dev/ttyACM0")
it = util.Iterator(board)
it.start()
def connect_channel(self, channel, delay=1/4):
listen = self.r.pubsub()
listen.subscribe(channel)
self.r.publish(channel, "a::1")
def start_process():
while True:
message = listen.get_message()
time.sleep(delay)
import random
import string
class RandomPassword:
def __init__(self, length=8, string=True, number=True, special=False) -> None:
self.length = length
self.string = string
self.number = number
self.special = special