Skip to content

Instantly share code, notes, and snippets.

Avatar

Rahul Reddy rahul-yr

View GitHub Profile
@rahul-yr
rahul-yr / raspberry-pi-debian-setup.sh
Created Oct 1, 2022
Raspberrry pi 4 debian setup
View raspberry-pi-debian-setup.sh
#! /bin/sh
# Update the system
sudo apt update
sudo apt upgrade -y
# Install snapd
sudo apt install snapd -y
sudo snap install core
@rahul-yr
rahul-yr / golang-docker-alpine-Dockerfile
Created Sep 18, 2022
Docker Golang light weight image Dockerfile
View golang-docker-alpine-Dockerfile
FROM golang:1.19.1-alpine3.16 as builder
WORKDIR /app
COPY go.* ./
RUN go mod download
COPY . ./
RUN go build -v -o server
FROM alpine:3.16
COPY --from=builder /app/server /app/server
EXPOSE 8080
CMD ["/app/server"]
@rahul-yr
rahul-yr / index.js
Created Sep 9, 2022
Stream HLS Videos using plain HTML - Along with custom request headers to Video.js
View index.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<title>Document</title>
@rahul-yr
rahul-yr / telegram-python-bot.py
Created Sep 6, 2022
Telegram Python bot snippets for getUpdates and InlineKeyboard
View telegram-python-bot.py
import requests
import json
def getUpdates():
api = "https://api.telegram.org/bot<token>/getUpdates"
# add headers
headers = {'Content-Type': 'application/json'}
# add body params
data = {'allowed_updates': ['update_id']}
# stringify body params
@rahul-yr
rahul-yr / main.go
Last active Jul 29, 2022
Firebase JWT authentication : Sample functions for token verification
View main.go
package main
import (
"context"
"fmt"
"log"
"os"
"strings"
"time"
@rahul-yr
rahul-yr / README.md
Last active Jul 26, 2022
This is a code-server installation script on GCP VM. It has already configured with Ngnix, Cert Bot and Google Domains. You just need to update the input variables on the top section
View README.md

This is a script to install and deploy code-server to your domain.

  • This enables you to access the vscode over the internet in a single click

Prerequisites

  • Domain Name (Suggested Google Domains)
  • GCP or Azure or AWS Account

Tech

  • Web server : Nginx
  • SSL : Let's encrypt
@rahul-yr
rahul-yr / code-server-installations.md
Last active Jul 26, 2022
code-server ip address updation
View code-server-installations.md
@rahul-yr
rahul-yr / main.go
Created Jul 5, 2022
This is the entry point for Todo GraphQL server
View main.go
package main
import (
"os"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"github.com/rahul-yr/learn-go-grapql/graph"
)
@rahul-yr
rahul-yr / router.go
Created Jul 5, 2022
This is the todo router for Go GraphQL
View router.go
package graph
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/graphql-go/graphql"
"github.com/rahul-yr/learn-go-grapql/todo"
)
@rahul-yr
rahul-yr / install.go
Created Jul 4, 2022
Go TODO graphQL packages
View install.go
// used as web server
// you could use any web server of your choice such as mux, http, go fiber etc
go get github.com/gin-gonic/gin
// used for handling cors
go get github.com/gin-contrib/cors
// is the actual module for implementing GraphQL Server
go get github.com/graphql-go/graphql