Skip to content

Instantly share code, notes, and snippets.

Aditya Tannu AdySan

Block or report user

Report or block AdySan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View download-tadpoles-media.js
// Step 1: Open https://www.tadpoles.com/parents and log in;
// Step 2: Select the 'all' tab (IMPORTANT STEP);
// Step 3: Select a month;
// Step 4: Open the JavaScript console in your browser (e.g., press
// Command + Alt + i in Google Chrome on a Mac, or press
// Ctrl + Shift + i in Google Chrome in Windows);
// Step 5: Copy this entire code snippet, paste it to the JavaScript console,
// and press Enter to run; all photos and videos will be downloaded
// to your default Downloads folder and they should have proper
// file names.
@AdySan
AdySan / Raspbian Stretch Headless Setup Procedure.md
Created Sep 26, 2018
Raspbian Stretch Headless Setup Procedure
View Raspbian Stretch Headless Setup Procedure.md

To set any Raspberry Pi in headless mode, you'll only need your Pi with pre-loaded Raspbian OS (latest is Stretch) and your Wi-Fi network. Make sure you know your Wi-Fi SSID and Password in order to perform headless setup.

Once you've burned/etched the Raspbian image onto the microSD card, connect the card to your working PC and you'll see the card being mounted as "boot". Inside this "boot" directory, you need to make 2 new files. You can create the files using Atom code editor.

Step 1: Create an empty file. You can use Notepad on Windows or TextEdit to do so by creating a new file. Just name the file ssh. Save that empty file and dump it into boot partition (microSD).

Step 2: Create another file name wpa_supplicant.conf . This time you need to write a few lines of text for this file. For this file, you need to use the FULL VERSION of wpa_supplicant.conf. Meaning you must have the 3 lines of data namely country, ctrl_interface and update_config

View download-tadpoles-media.js
// Step 1: Open https://www.tadpoles.com/parents and log in;
// Step 2: Select the 'all' tab (IMPORTANT STEP);
// Step 3: Select a month;
// Step 4: Open the JavaScript console in your browser (e.g., press
// Command + Alt + i in Google Chrome on a Mac, or press
// Ctrl + Shift + i in Google Chrome in Windows);
// Step 5: Copy this entire code snippet, paste it to the JavaScript console,
// and press Enter to run; all photos and videos will be downloaded
// to your default Downloads folder and they should have proper
// file names.
@AdySan
AdySan / SpecAna.py
Last active Jun 30, 2018
Raspberry Pi USB Mic and Pimoroni Unicorn pHAT Spectrum Analyzer: ** Warning: Extremely Janky Code **
View SpecAna.py
import array
import pyaudio
import sys
import colorsys
import time
import alsaaudio as aa
from struct import unpack
import numpy as np
from sys import exit
import numpy as np
@AdySan
AdySan / usbmic.py
Created Jun 29, 2018
this works on Raspberry Pi
View usbmic.py
#!/usr/bin/env python3
import pyaudio
import wave
CHUNK = 512
FORMAT = pyaudio.paInt16 #paInt8
CHANNELS = 1
RATE = 44100 #sample rate
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "pyaudio-output.wav"
@AdySan
AdySan / .bash_profile
Created Jun 29, 2017 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
View .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@AdySan
AdySan / live.json
Created Jun 25, 2017
hacked config for supporting aac audio on Restreamer
View live.json
{
"name": "live",
"jsondb": "db/v1",
"auth": {
"username": "admin",
"password": "datarhei"
},
"ffmpeg": {
"options": {
"native_h264": [
@AdySan
AdySan / Home Network Topology
Last active Jun 13, 2017
Proposal for new home netwrok setup with Moca 2.0 and UniFi
View Home Network Topology
+-------------+
| |
| UNIFI | +------+
TIME WARNER +--------------+ | AC-LITE | | WiFi |
CABLE +------------> MOCA 2.0 | | BEDROOM 1 | | IP |
BEDROOM 1 | +--+ | | | CAM |
| | | | | | |
+--------------+ | +------^------+ +---^--+
| |
+-+-----------+--+
View Yi camera file system
crw-rw---- 1 root root 10, 54 Dec 31 1969 acodec
crw-rw---- 1 root root 10, 50 Dec 31 1969 adec
crw-rw---- 1 root root 10, 51 Dec 31 1969 aenc
crw-rw---- 1 root root 10, 53 Dec 31 1969 ai
crw-rw---- 1 root root 10, 63 Dec 31 1969 alarm
crw-rw---- 1 root root 10, 52 Dec 31 1969 ao
crw-rw---- 1 root root 5, 1 May 30 12:53 console
crw-rw---- 1 root root 10, 59 Dec 31 1969 cpld_periph
crw-rw---- 1 root root 10, 62 Dec 31 1969 cpu_dma_latency
crw-rw---- 1 root root 1, 7 Dec 31 1969 full
@AdySan
AdySan / TrimLast18s
Created Dec 27, 2016
Bash script to trim last few seconds of video files (.mp4) downloaded with you-get using ffmpeg
View TrimLast18s
#!/bin/bash
for f in *.mp4; do
duration=$(ffmpeg -i "$f" 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,//)
length=$(echo "$duration" | awk '{ split($1, A, ":"); print 3600*A[1] + 60*A[2] + A[3] }' )
trim_start=0
trim_end=$(echo "$length" - 18 - "$trim_start" | bc)
ffmpeg -ss "$trim_start" -i "$f" -c copy -map 0 -t "$trim_end" "${f%.mp4}-trimmed.mp4"
done
You can’t perform that action at this time.