Skip to content

Instantly share code, notes, and snippets.

// 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 September 26, 2018 04:07
Raspbian Stretch Headless Setup Procedure

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

@AdySan
AdySan / download-tadpoles-media.js
Created August 23, 2018 15:30 — forked from yongheng/download-tadpoles-media.js
Download Tadpoles Media
// 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 June 30, 2018 00:19
Raspberry Pi USB Mic and Pimoroni Unicorn pHAT Spectrum Analyzer: ** Warning: Extremely Janky Code **
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 June 29, 2018 21:44
this works on Raspberry Pi
#!/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 June 29, 2017 02:08 — forked from natelandau/.bash_profile
Mac OSX 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 June 25, 2017 06:50
hacked config for supporting aac audio on Restreamer
{
"name": "live",
"jsondb": "db/v1",
"auth": {
"username": "admin",
"password": "datarhei"
},
"ffmpeg": {
"options": {
"native_h264": [
@AdySan
AdySan / Home Network Topology
Last active June 13, 2017 19:28
Proposal for new home netwrok setup with Moca 2.0 and UniFi
+-------------+
| |
| UNIFI | +------+
TIME WARNER +--------------+ | AC-LITE | | WiFi |
CABLE +------------> MOCA 2.0 | | BEDROOM 1 | | IP |
BEDROOM 1 | +--+ | | | CAM |
| | | | | | |
+--------------+ | +------^------+ +---^--+
| |
+-+-----------+--+
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 December 27, 2016 22:58
Bash script to trim last few seconds of video files (.mp4) downloaded with you-get using ffmpeg
#!/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