Skip to content

Instantly share code, notes, and snippets.

View parthpower's full-sized avatar
:shipit:

Parth Parikh parthpower

:shipit:
View GitHub Profile
from sys import argv
import cv2
import numpy as np
def genTxtFile(imageFilePath,txtFilepath):
inputImage = cv2.imread(imageFilePath)
grayInputImage = cv2.cvtColor(inputImage,cv2.COLOR_RGB2GRAY)
try:
txtFile = open(txtFilepath,"w")
from sys import argv
import numpy as np
import cv2
if len(argv)!=5:
print("Usage: %s <height> <width> <input TXT File> <output TXT File>"%(argv[0]))
exit()
@parthpower
parthpower / VivadoCI.py
Last active June 10, 2016 13:41
A slightly modified version of https://github.com/Viq111/Vivado-CI I don't think it's "fork-able" so..Gist it is!
# -*- coding:Utf-8 -*-
# Vivado-CI Package
prog_name = "VivadoCI - Server Side"
# version:
version = 1
# By Viq - Vianney Tran
# License: Creative Commons Attribution-ShareAlike 3.0 (CC BY-SA 3.0)
# (http://creativecommons.org/licenses/by-sa/3.0/)
##############
/*The circuit:
* LCD RS pin to digital pin 13
* LCD Enable pin to digital pin 12
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* LCD VSS pin to ground
* LCD VCC pin to 5V
from time import sleep
import serial
vfyPwd = [239, 1, 255, 255, 255, 255, 1, 0, 7, 19, 0, 0, 0, 0, 0, 27]
genImg =[239, 1, 255, 255, 255, 255, 1, 0, 3, 1, 0, 5]
img2tz =[239, 1, 255, 255, 255, 255, 1, 0, 4, 2, 1, 0, 8]
img2tz2 =[239, 1, 255, 255, 255, 255, 1, 0, 4, 2, 2, 0, 9]
regModel = [239, 1, 255, 255, 255, 255, 1, 0, 3, 5, 0, 9]
/*
* crcheck.cpp
*
* Created on: Apr 1, 2017
* Author: Parth Parikh
*/
/*
MIT License
Copyright (c) 2017 Parth Parikh

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@parthpower
parthpower / README.md
Last active October 17, 2018 21:44
Pip install for the servers that don't allow outgoing connection.

remote_pip

It's a pain when you have an isolated server with tons of network restrictions (for good) and your code requires 10 python packages with 10 dependenices of each package!

This script addresses that issue by downloading the packages on your machine and SCPing them to the remote machine and installing them there. Not the greates way to do things but this works.

It keeps asking for remote password for ssh and scp, so it's better if you authenticate with public key instead of password and it's safer than password so why not!

Install

@parthpower
parthpower / readme.sh
Created July 15, 2020 23:05
PXE Boot Ubuntu
#!/bin/sh
set -x
# Just for note. shell scripts are easier than README.md
apt install dnsmasq
# don't need to run it forever
systemctl disable dnsmasq.service
# most systems has systemd running on port 53 which can be an issue.
# maybe disable dns server on dnsmasq?
@parthpower
parthpower / watchsync.sh
Last active March 8, 2023 23:09 — forked from leomao/watchsync.sh
Watch file changes and sync two directories (to remote via ssh)
#!/bin/bash
#
# Sync local directory to remote directory.
#
# Modified by: Leo Mao
# Modified from: https://gist.github.com/evgenius/6019316
#
# Requires Linux, bash, inotifywait and rsync.
#
# To avoid executing the command multiple times when a sequence of