Skip to content

Instantly share code, notes, and snippets.

@ocihangir
ocihangir / convert-file-to-binary-array.py
Last active September 29, 2022 14:04
This script converts a file into a uint_8 byte array to be copied into a code as a variable
# This script converts a file into a uint_8 byte array to be copied into a code as a variable
# e.g.: uint8_t sampleData[10] = {0, 1, 2, 3, 4, 5, 6, A, B, C}
import sys
if len(sys.argv) < 2:
print("Usage python3 convert-file-to-binary.py filename")
sys.exit(1)
try:
#
# This gist is used to convert Keepass CSV (1.x) file into Firefox LockWise format.
# Read the comments for the field assumptions.
#
# Ozan Cihangir - 2020
#
import csv
import uuid
import time
@ocihangir
ocihangir / gist:886d523fc1d168badfe08202d9449b3b
Created August 29, 2017 15:12
from sklearn.lda import LDA ImportError: No module named lda
Appearently scikit-learn removed sklearn.lda after version 0.17.0 . If you still need it, you need to downgrade scikit-learn to 0.16.0
pip uninstall scikit-learn
pip install scikit-learn==0.16.0
@ocihangir
ocihangir / UsefulDockerCommands.md
Last active August 17, 2017 08:10
Useful Docker Commands

Container related

Stop all containers:

docker stop $(docker ps -aq)

Remove all containers:

docker stop $(docker ps -aq)

File sharing

@ocihangir
ocihangir / Leo2UART.ino
Created December 6, 2015 00:46
This code converts Arduino Leonardo into a USB to UART converter
/*
* This code converts Arduino Leonardo into a USB to UART converter
*/
int incomingByte = 0;
void setup() {
// initialize serial:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only