Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:

Parth Parikh parthpower

:shipit:
View GitHub Profile
@parthpower
parthpower / rate.sh
Last active Aug 26, 2021
get rate from netdev stats
View rate.sh
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: $0 <ifname> [delay (s) default=10s]";
exit 1;
fi
eth=$1
if [ "x$2" -eq "x" ]; then
delay=10
else
@parthpower
parthpower / watchsync.sh
Last active Apr 29, 2021 — forked from leomao/watchsync.sh
Watch file changes and sync two directories (to remote via ssh)
View watchsync.sh
#!/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
@parthpower
parthpower / readme.sh
Created Jul 15, 2020
PXE Boot Ubuntu
View readme.sh
#!/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 / README.md
Last active Oct 17, 2018
Pip install for the servers that don't allow outgoing connection.
View README.md

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

View keybase.md

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:

View crcheck.cpp
/*
* crcheck.cpp
*
* Created on: Apr 1, 2017
* Author: Parth Parikh
*/
/*
MIT License
Copyright (c) 2017 Parth Parikh
View CompleteFingerPrintEVM.py
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]
View FingerPrintVote.c
/*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
@parthpower
parthpower / VivadoCI.py
Last active Jun 10, 2016
A slightly modified version of https://github.com/Viq111/Vivado-CI I don't think it's "fork-able" so..Gist it is!
View VivadoCI.py
# -*- 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/)
##############
View sobel_soft_simulate.py
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()