Skip to content

Instantly share code, notes, and snippets.

View optimistanoop's full-sized avatar
💭
<tod-fod-code>

Anoop Kumar optimistanoop

💭
<tod-fod-code>
View GitHub Profile
@optimistanoop
optimistanoop / youtube-upload.js
Created October 18, 2022 07:21 — forked from soygul/youtube-upload.js
YouTube video uploader using JavaScript and Node.js
// YouTube API video uploader using JavaScript/Node.js
// You can find the full visual guide at: https://www.youtube.com/watch?v=gncPwSEzq1s
// You can find the brief written guide at: https://quanticdev.com/articles/automating-my-youtube-uploads-using-nodejs
//
// Upload code is adapted from: https://developers.google.com/youtube/v3/quickstart/nodejs
const fs = require('fs');
const readline = require('readline');
const assert = require('assert')
const {google} = require('googleapis');
@optimistanoop
optimistanoop / app.md
Last active January 23, 2022 13:37
firebase and firestore special commands

To setup github actions

firebase init hosting:github

To get indexes

firebase firestore:indexes

To deploy indexes

firebase deploy --only firestore:indexes

@optimistanoop
optimistanoop / app.md
Last active January 13, 2022 12:52
Git commands for quick solutions.

to pull only one file

git checkout origin/master -- path/to/file

to see only commits of an author in a branch

git log <branch>--author='<author>

to push all local branch to a remote

git push <remote> --all

@optimistanoop
optimistanoop / app.md
Last active March 12, 2021 16:27
tmux terminal

Tmux

Tmux is a terminal multiplexer. It allows you to run and manage several command prompts simultaneously from one tmux session. It is the equivalent of a graphical window manager, for command prompts.

Install tmux

sudo apt-get update && sudo apt-get -y install tmux

sudo apt-get install tmux

Common session commands

@optimistanoop
optimistanoop / app.md
Last active February 24, 2021 11:32
install nodejs

Installing Node.js and npm from NodeSource

NodeSource is a company focused on providing enterprise-grade Node support. It maintains an APT repository containing multiple Node.js versions. Use this repository if your application requires a specific version of Node.js.

At the time of writing, NodeSource repository provides the following versions:

v14.x - The latest stable version. v13.x v12.x - The latest LTS version. v10.x - The previous LTS version.

@optimistanoop
optimistanoop / logging.py
Created July 23, 2019 09:08
python logging
import logging
sysdate = str(datetime.date.today())
logging.basicConfig(filename=sysdate+'.log',
filemode='a',
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
datefmt='%H:%M:%S',
level=logging.DEBUG)
logging.info('anp main')
@optimistanoop
optimistanoop / offline.py
Created July 23, 2019 09:05
Offline sqlite python
import sqlite3
class Offline:
def __init__(self):
print('hello offline')
self.conn = sqlite3.connect('offline.db')
c = self.conn.cursor()
c.execute('''CREATE TABLE IF NOT EXISTS visitors (id INTEGER PRIMARY KEY, clientId text, locationId text, cameraNumber text, frame text)''')
c.execute('''CREATE TABLE IF NOT EXISTS errors (id INTEGER PRIMARY KEY, clientId text, locationId text, cameraNumber text, frame text, errors text, er_cat text)''')
# sql1 = 'DELETE FROM Frames_and_Scores'
# c.execute(sql1)
@optimistanoop
optimistanoop / pyinstallerWithMxnet.md
Last active June 24, 2019 07:27
generate exe from pyinstaller

To generate .exe file

pyinstaller -F --add-data <path of open cv file>;. <main file of codebase>

example

pyinstaller -F --add-data C:\Users\Anoop\AppData\Local\Programs\Python\Python35\Lib\site-packages\cv2\opencv_ffmpeg410_64.dll;. roi_version.py

other commands

pyinstaller -F getface.py

@optimistanoop
optimistanoop / app.md
Last active June 24, 2019 07:20
running wesense app

Running wesense app

nohup python <file name>.py &

to see the output from a file

tail -f

@optimistanoop
optimistanoop / app.md
Last active May 8, 2019 12:53
python modules installed in local folder

pip3 install numpy -t py_modules/

pip3 install -r requirements.txt -t py_modules/

Use this below lines for referencing your local py_modules

import os
import sys

where_am_i = os.path.dirname(os.path.abspath(file))