Skip to content

Instantly share code, notes, and snippets.

//https://www.youtube.com/c/SidsEClassroom
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
const char* ssid = ""; //Set your wifi network name(ssid)
const char* password = ""; //Set your router password
int RelayPin = D1; //Relay Shield is controlled by pin 1 (D1)
@shivasiddharth
shivasiddharth / recorder.py
Created January 14, 2019 19:46 — forked from sloria/recorder.py
WAV recording functionality using pyaudio
# -*- coding: utf-8 -*-
'''recorder.py
Provides WAV recording functionality via two approaches:
Blocking mode (record for a set duration):
>>> rec = Recorder(channels=2)
>>> with rec.open('blocking.wav', 'wb') as recfile:
... recfile.record(duration=5.0)
Non-blocking mode (start and stop recording):
@shivasiddharth
shivasiddharth / kodiinstaller.sh
Last active February 26, 2020 16:02
Script to install Kodi
#!/bin/bash
set -o errexit
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root (use sudo)" 1>&2
exit 1
fi
apt-get install kodi
@shivasiddharth
shivasiddharth / nasmounter.sh
Last active November 15, 2023 23:42
Script to mount NAS in Linux
#!/bin/bash
set -o errexit
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root (use sudo)" 1>&2
exit 1
fi
sudo apt-get install cifs-utils
@shivasiddharth
shivasiddharth / videoupscaler.py
Last active September 1, 2023 22:06
Script to upscale videos using OpenCV and ffmpeg
#!/usr/bin/env python
# Written by Shivasiddharth a.k.a Sid
# Youtube channel https://www.youtube.com/c/SidsEClassroom
# Share this script without removing the author's name
# This piece of script Upscales or Downscales videos using Opencv
# If the original video has an audio stream,
# it will merge the audio from the source file with the scaled video
@shivasiddharth
shivasiddharth / piobsinstaller.sh
Last active January 24, 2023 04:46
Script for installing OBS on Raspberry Pi
#!/bin/bash
echo ""
echo "Checking memory size.........."
Totalmem=$(cat /proc/meminfo|grep MemTotal|grep -o '[0-9]*')
if (($Totalmem > 3500000)); then
echo ""
echo "You have got enough memory. No need for a swap partition.........."
echo ""
else
@shivasiddharth
shivasiddharth / nginx-installer.sh
Last active June 2, 2020 11:40
Nginx installer script
#!/bin/bash
sudo apt-get update
sudo apt-get install nginx
sudo apt-get install libnginx-mod-rtmp
cat << EOF >> /etc/nginx/nginx.conf
rtmp {
server {
listen 1935;
chunk_size 4096;
@shivasiddharth
shivasiddharth / Breaks_At_Set_Intervals.xspf
Created June 1, 2020 16:16
VLC playlist sample files that simulate adverts playback during movies or videos
<?xml version="1.0" encoding="UTF-8"?>
<playlist xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/" version="1">
<title>Playlist</title>
<trackList>
<track>
<location>file://192.168.1.4/shivasiddharth/20180905/SIDDHY%20GENERAL/Movies/2%20States%20(2014).mp4</location>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:id>0</vlc:id>
<vlc:option>file-caching=1000</vlc:option>
<vlc:option>stop-time=1800.000</vlc:option>
@shivasiddharth
shivasiddharth / chatbotserver.py
Last active June 10, 2020 10:16
Python script for Raspberry Pi chatbot server
#!/usr/bin/env python3
import socket
import sys
import RPi.GPIO as GPIO
import _thread
import datetime
import random
import requests
import os
@shivasiddharth
shivasiddharth / swappartitioncreator.sh
Last active June 21, 2020 15:28
Script to create swap partition on Pi
#!/bin/bash
#Creates swap partition on boards with lesser than 3.5GB Memory/RAM
echo ""
echo "Checking memory size.........."
Totalmem=$(cat /proc/meminfo|grep MemTotal|grep -o '[0-9]*')
if (($Totalmem > 3500000)); then
echo ""
echo "You have got enough memory. No need for a swap partition.........."