Skip to content

Instantly share code, notes, and snippets.

View smartass08's full-sized avatar

Shubham Dubey smartass08

View GitHub Profile
@smartass08
smartass08 / Addmember.py
Last active May 19, 2020 15:54
Script to add members to your gsuite group using admin directory api.
# Need credentials.json in root of the script
from __future__ import print_function
from google.oauth2.service_account import Credentials
import googleapiclient.discovery, json, progress.bar, glob, sys, argparse, time
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
import os
import pickle
@smartass08
smartass08 / anime.go
Last active September 19, 2022 19:04
Seasonal anime Identifier written in go
package main
import (
"errors"
"fmt"
"os"
"strings"
)
type Episode struct {
@smartass08
smartass08 / mount.py
Last active December 31, 2020 12:35
AutoMount all gclone teamdrives available in account
from __future__ import print_function
from google.oauth2 import service_account
from googleapiclient.discovery import build
import sys
import os
import time
SCOPES = ['https://www.googleapis.com/auth/drive.readonly']
gc = "gclone mount --daemon" # Always use --daemon or it may break stuff
@smartass08
smartass08 / rclone_mount.py
Last active June 8, 2021 20:21
A mount script which will fetch all your TeamDrives using service account and mount it using rclone mount
from __future__ import print_function
from google.oauth2 import service_account
from googleapiclient.discovery import build
import sys
from glob import glob
import os
SCOPES = ['https://www.googleapis.com/auth/drive.readonly']
remote = 'docs:' # Always use --daemon or it may break stuff
folder_location = "/Volumes/MyShit/Mounts"
@smartass08
smartass08 / rain-download.go
Created September 11, 2020 10:31
Torrent downloader written in go using rain library (Toy experiment)
package main
import (
"github.com/cenkalti/rain/torrent"
"github.com/cheggaaa/pb/v3"
"os"
"sync"
"time"
)
package main
import (
"fmt"
"math"
"strings"
)
type PBar struct {
LastDifference int
import (
"context"
"fmt"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"log"
"sync"
"time"
)
package main
import (
"fmt"
"io"
"log"
"os"
"os/exec"
"regexp"
"strings"
var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
func randSeq(n int) string {
b := make([]rune, n)
for i := range b {
b[i] = letters[rand.Intn(len(letters))]
}
return string(b)
}
import (
"github.com/PaulSonOfLars/gotg_md2html"
)
func MakeKeyboards(button []tg_md2html.Button) [][]ext.InlineKeyboardButton {
var allbuttons [][]ext.InlineKeyboardButton
for _, v := range button {
var button1 []ext.InlineKeyboardButton
tempbtn := ext.InlineKeyboardButton{