Skip to content

Instantly share code, notes, and snippets.

@GuillermoPena
GuillermoPena / nodeJs.crypto.calculatingHash.js
Created February 26, 2014 16:30
NodeJS - CRYPTO : How to calculate a hash from file or string
var crypto = require('crypto')
, fs = require('fs')
// Algorithm depends on availability of OpenSSL on platform
// Another algorithms: 'sha1', 'md5', 'sha256', 'sha512' ...
var algorithm = 'sha1'
, shasum = crypto.createHash(algorithm)
// Updating shasum with file content
var filename = __dirname + "/anything.txt"
@moeiscool
moeiscool / nodeJs.crypto.calculatingHash.js
Last active May 1, 2024 12:32 — forked from GuillermoPena/nodeJs.crypto.calculatingHash.js
NodeJS - CRYPTO : How to calculate a hash from file or string
var crypto = require('crypto')
, fs = require('fs')
// Algorithm depends on availability of OpenSSL on platform
// Another algorithms: 'sha1', 'md5', 'sha256', 'sha512' ...
var algorithm = 'sha1'
, shasum = crypto.createHash(algorithm)
// Updating shasum with file content
var filename = __dirname + "/anything.txt"
@moeiscool
moeiscool / gist:589c4c235b85e349404cacd94d553c33
Created March 21, 2019 01:46 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@moeiscool
moeiscool / compile-ffmpeg-nvenc.sh
Last active May 1, 2024 12:31
This bash script will compile a static Ffmpeg build with NVENC and VAAPI hardware-accelerated support on Ubuntu in your home directory. You can modify the script to customize the build options as you see fit.
#!/bin/bash
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu.
#See the prefix path and compile options if edits are needed to suit your needs.
# This script assumes you have NVIDIA Drivers and CUDA Toolkit installed already
#install required things from apt
installLibs(){
echo "Installing prerequisites"
const express = require('express');
const dotenv = require('dotenv');
const {RtcTokenBuilder, RtcRole, RtmTokenBuilder, RtmRole} = require('agora-access-token');
dotenv.config();
const app = express();
const PORT = process.env.PORT || 8080;
const APP_ID = process.env.APP_ID;
const APP_CERTIFICATE = process.env.APP_CERTIFICATE;
@moeiscool
moeiscool / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Created November 11, 2020 17:18 — forked from Brainiarc7/VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

@moeiscool
moeiscool / README.md
Last active May 1, 2024 12:31
Browser-Based Buy Bot for BestBuy Xbox Series X or PS5

Browser-Based Buy Bot for BestBuy Xbox Series X or PS5 (Tested on BestBuy.ca)

This is not made for scalping. It is made for people who just want a dang console.

I made this to run in my Google Chrome web browser. You will need to leave a tab open. When the console is seen as available it will be added to your cart, default confirmations will be selected then you will be brought to the payment information page. Once it makes it to the payment information page a sound will play and an alert popup will appear.

If it is out of stock it will just wait 2 minutes and refresh.

This script will not complete any checkout processes. It will not process any purchases against your payment information. It only gets you to the payment information input page.

@Anteloper
Anteloper / iMessage-bot-on-beeper.md
Last active May 1, 2024 12:31
Running an iMessage Bot on EC2 Using Beeper

Requirements:

  • Be a Beeper user
  • Python > 3.7
  • Docker
  • yarn

1. Getting a Maubot running

  1. following these steps I ran the docker container to create a Maubot server on my local machine
  2. an unspoken but relevant step here is to create a user that you’ll log into your Maubot Manager interface with. do this line 86 of config.yaml. For example

DIY 지문 인식 도어락

  • 지문 인식 센서 jm-101B를 이용해 출입이 허가된 사람과 아닌 사람을 구분하고, 서보 모터로 경첩을 열고 닫음.
  • 라이브러리의 기초 예제 파일인 delete, enroll은 그대로 사용했으며, fingerprint.ino만 아래의 소스 코드처럼 수정했습니다.
  1. 지문 인식 센서에 사용자 지문 등록
  2. 지문 등록 과정이 끝나면 아래의 아두이노 파일을 업로드
  3. 작동중인 프로그램에 지문 검사를 하면 끝.
  4. 출입 불허된 사람 LED, 부저 울리는 코드와, 서보모터 각도 조종하는 코드만 추가함.
@moeiscool
moeiscool / amcrestVideoScraper.js
Last active May 1, 2024 12:30
Amcrest Camera Mass (Bulk) Video Exporter with Web Browser Console
/// How it works :
/// This script will download videos from your Amcrest Camera automatically (automate cumbersome task of individually clicking download on each video)
/// Limitation is that it will stop downloading when it reaches the end of the month.
/// HOW TO USE :
// 1. Login to Amcrest camera and click Playback tab.
// 2. Select Day of the Month to begin downloading from.
// 3. Open the Web Browser Console. (CTRL + SHIFT + C on Mac)
// 4. Paste this entire script in the execution field and run it.
// 5. You will see the files start downloading.