Skip to content

Instantly share code, notes, and snippets.

View parthpower's full-sized avatar
:shipit:

Parth Parikh parthpower

:shipit:
View GitHub Profile
@parthpower
parthpower / !WhatsApp On Web Monitor.md
Last active January 19, 2024 14:14
Simple JS to monitor offline and online time of a contact.

WhatsApp On Web Monitor

What It does

It gives notifications when someone goes online or offline or typing. Open chat of the contact you want to monitor and start script.

Simple Way

@parthpower
parthpower / !WhatsApp Emoji Bomber.md
Last active July 19, 2023 13:51
WhatsApp Emoji Bomber
@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
@parthpower
parthpower / rate.sh
Last active August 26, 2021 11:19
get rate from netdev stats
#!/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 / 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?
/*
* crcheck.cpp
*
* Created on: Apr 1, 2017
* Author: Parth Parikh
*/
/*
MIT License
Copyright (c) 2017 Parth Parikh
@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

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 / imgtocoe.py
Last active April 4, 2017 20:59
Simple gray scale image data to COE file convertor for Xilinx Block Memory initialization
__author__ = 'Parth Parikh'
import sys
import cv2
def help1():
print "Usage: imgtocoe <image path> <output name>"
exit()
if len(sys.argv) <3:
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]