Skip to content

Instantly share code, notes, and snippets.

View pharzan's full-sized avatar

Farzan pharzan

View GitHub Profile
@pharzan
pharzan / schemacrawler-sqlite-macos-howto.md
Created December 30, 2018 19:45 — forked from dannguyen/schemacrawler-sqlite-macos-howto.md
How to use schemacrawler to generate schema diagrams for SQLite from the commandline (Mac OS)
@pharzan
pharzan / i3.md
Created July 31, 2018 08:45
Change resolution in i3
@pharzan
pharzan / ESP-01_reciever.ino
Last active January 8, 2022 17:28
ATTINY13 communication with ESP-01
/*
using software serial and GPIO 0 as recieve pin.
PIN 6 (ATTINY13) is connected and transmitting a number.
PIN 6 (ATTINY) --> GPIO ESP8266-01
When ESP-01 see's a new line the string is completed and printed to the Serial output of the arduino IDE.
*/
#include <SoftwareSerial.h>
SoftwareSerial mySerial(0, 2); // RX, TX
@pharzan
pharzan / overclock.md
Last active January 31, 2023 09:27
Linux Mint Nvidia oveclock settings

Following mining and findings performed on EVGA GeForce GTX 1070 SC GAMING Black Edition Graphics Card cards. Works on MSI 1060 and Gigabyte 1060 First run nvidia-xconfig --enable-all-gpus then set about editing the xorg.conf file to correctly set the Coolbits option.

# /etc/X11/xorg.conf
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
@pharzan
pharzan / esp32-micropython-flash.md
Created November 30, 2017 14:42
How to flash micropython on ESP-WROOM-32

How to flash micropython on ESP-WROOM-32

YOU’LL NEED

  • This version of the installer.
  • A tar.gz file that contains a valid firmware upgrade (see links bellow).
  • Python 2 with pyserial installed.
  • Find out the name of the serial port you’ll be using:

Windows use a COM# (where # is a number) MacOS will use something like /dev/tty.usbserial-XXXXXXXX (where XXXXXXXX is a value specific to your expansion board). > For Pytrack/Pysense this is /dev/tty.usbmodemPyXXXXXX Linux will use something like /dev/ttyUSB# (where # is a number). For Pytrack/Pysense this is /dev/ttyACM# instead. You can > use the following command as well:

@pharzan
pharzan / format.py
Last active November 30, 2017 07:52
Format ESP8266 01 File system
#to format:
from flashbdev import bdev
uos.VfsFat.mkfs(bdev)
vfs = uos.VfsFat(bdev, "")
# to create a boot.py file:
with open("/boot.py", "w") as f:
f.write("""\
# This file is executed on every boot (including wake-boot from deepsleep)
import esp
@pharzan
pharzan / server.py
Last active March 6, 2024 10:03
esp8266 post json data using usocket
#listens to the above run to
#FLASK_APP=server.py FLASK_DEBUG=1 python3.5 -m flask run -h 192.168.1.124 -p 8999:
#run this on the local server to listen to socket communication
from flask import Flask, render_template, jsonify
from flask import request as query
app = Flask(__name__)
@pharzan
pharzan / keybase.md
Last active April 22, 2019 18:00
keybase

Keybase proof

I hereby claim:

  • I am pharzan on github.
  • I am pharzan (https://keybase.io/pharzan) on keybase.
  • I have a public key ASD7kHx7hIepix8J9Oyrh6QAK0VIXiksugOW_TuQgdIv2wo

To claim this, I am signing this object:

@pharzan
pharzan / Django run script with arguments
Created October 11, 2017 10:57
how to run a Django script with arguments
# inside the script we should have something like below:
def run(*script_args):
print (script_args)
# from the shell when calling the script to run use the --script-args to pass in arguments and they will be recieved as tuples inside the script
#-> example: python manage.py runscript myscript --script-args Testing 123
will return ('Testing','123')