Skip to content

Instantly share code, notes, and snippets.

View amitkhare's full-sized avatar
🤔
Brainstorming

Amit Kumar Khare amitkhare

🤔
Brainstorming
View GitHub Profile
@amitkhare
amitkhare / sub.example.com.conf
Last active May 9, 2020 19:56
Apache2 Reverse Proxy with web-sockets and SSL
<VirtualHost *:80>
ServerName sub.example.com
ProxyPreserveHost On
SSLProxyEngine On
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
@amitkhare
amitkhare / Nginx RTMP module on Ubuntu 18.04.md
Last active December 2, 2024 06:01
Nginx RTMP module on Ubuntu 18.04 with RTMPS support for Facebook live streaming Hardware and Software live-streaming encoders have typically used the RTMP streaming protocol. With the Facebook enforcement of the RTMPS encrypted live-stream some older hardware and software encoders can no longer work. By using the method below we can convert RTM…

update

sudo apt-get update
sudo apt-get upgrade

install nginx

sudo apt-get install nginx -y
sudo apt-get install libnginx-mod-rtmp -y
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://apis.google.com/js/api.js"></script>
<script>
#region NameSpaceRegion
using System;
using System.Windows.Forms;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Xml;
using System.Xml.Linq;
using BeeSys.Wasp3D.Hosting;
@amitkhare
amitkhare / ProjectionMath.cs
Last active November 14, 2020 06:50
ProjectionMath for Wasp3D
#region NameSpaceRegion
using System;
using System.Windows.Forms;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Xml;
using System.Xml.Linq;
using BeeSys.Wasp3D.Hosting;
@amitkhare
amitkhare / Open-chrome-as-app.bat
Created February 23, 2021 13:26
Opens running code server at default gateway port 9090 in chrome as app.
@echo off
netsh wlan show interfaces | Findstr /c:"Signal" && set "CStatus=true" || set "CStatus=false"
for /f "tokens=2,3 delims={,}" %%a in ('"WMIC NICConfig where IPEnabled="True" get DefaultIPGateway /value | find "I" "') do set "location=%%a"
set location=%location:"=%
IF /i "%CStatus%"=="true" "C:\Program Files\Google\Chrome\Application\chrome.exe" --new-window --app=https://%location%:9090
@amitkhare
amitkhare / open-mobile-hotspot-ftp-folder.bat
Created February 23, 2021 13:28
Opens ftp folder if PC is connected through mobile hotspot and there is an FTP server running on it at port 2221
@echo off
netsh wlan show interfaces | Findstr /c:"Signal" && set "CStatus=true" || set "CStatus=false"
for /f "tokens=2,3 delims={,}" %%a in ('"WMIC NICConfig where IPEnabled="True" get DefaultIPGateway /value | find "I" "') do set "location=%%a"
set location=%location:"=%
echo opening explorer at %location%
IF /i "%CStatus%"=="true" explorer.exe ftp://%location%:2221
@amitkhare
amitkhare / scrcpy-open-tcpip.bat
Created February 23, 2021 13:30
opens scrcpy in WiFi mode. node - mobile needs to be connected through USB at first.
@echo off
adb.exe kill-server
netsh wlan show interfaces | Findstr /c:"Signal" && set "CStatus=true" || set "CStatus=false"
for /f "tokens=2,3 delims={,}" %%a in ('"WMIC NICConfig where IPEnabled="True" get DefaultIPGateway /value | find "I" "') do set "location=%%a"
set location=%location:"=%
@amitkhare
amitkhare / c9start.sh
Created February 24, 2021 05:24
updated cloud9 code start script
#!/bin/bash
dirbase="/var/www/"
# cd $dirbase
read -p "Current Directory as base? (y/N) " isCurrDir
if [ "$isCurrDir" = "Y" ] || [ "$isCurrDir" = "y" ]; then
dirpath=$(pwd)
@amitkhare
amitkhare / code-server.service
Last active March 14, 2024 17:45
Code-Server behind Apache2 Proxy with Letsencrypt SSL
#Located in :::: /lib/systemd/system/code-server.service
[Unit]
Description=code-server
After=network.target
[Service]
Type=simple