Skip to content

Instantly share code, notes, and snippets.

View raghavmri's full-sized avatar
🎯
Focusing

Raghav Mrituanjaya raghavmri

🎯
Focusing
View GitHub Profile
@raghavmri
raghavmri / gcrgc.sh
Created August 17, 2021 16:08 — forked from ahmetb/gcrgc.sh
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# program 29 Python program to import math module and ask the user to choose the function and to go again or not.
import math
def main():
print("1.ceil - returns the smallest integer greater than or equal to x.\n")
print("2.sqrt - returns the square root of the number\n")
print("3.exp - returns the logarithm, e raised to the entered number\n")
print("4.fabs - returns the absolute number of the number\n")
print("5.floor - returns the largest integer less than or equal to x\n")
@raghavmri
raghavmri / install_dev_tools_linux.sh
Created October 21, 2021 13:31
This shell script will install all the dev tools needed
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com $(lsb_release -cs) main" -y
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages -y
sudo apt update
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
refreshenv
choco feature enable -n allowGlobalConfirmation
choco install terraform git termius postman atom github-desktop yarn vscode google-drive-file-stream microsoft-teams adobereader tor-browser vlc python nodejs golang 7zip deluge -y
refreshenv
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
if __name__ == '__main__':
app.run()
{
"language": "typescript",
"app": "npm run --silent compile && node main.js",
"projectId": "5632caca-2a91-436c-963d-57dccfa2d7b0",
"terraformProviders": ["aws@~> 3.63"],
"terraformModules": [],
"context": {
"excludeStackIdFromLogicalIds": "true",
"allowSepCharsInLogicalIds": "true"
}
import { Construct } from 'constructs';
import { App, TerraformStack } from 'cdktf';
import { AwsProvider, EC2 } from '@cdktf/provider-aws';
class MyStack extends TerraformStack {
constructor(scope: Construct, name: string) {
super(scope, name);
// define resources here
new AwsProvider(this, 'aws', {
@raghavmri
raghavmri / .env.test
Last active July 2, 2023 09:17
A simple discord bot crafted using python and discord.py
DISCORD_TOKEN="Here Goes your discord token"
@raghavmri
raghavmri / main.py
Created December 5, 2021 09:00
youtube_downloader_python
# importing the module
from pytube import YouTube, Playlist
from pathlib import Path
import os
# Global variables
file_size = 0
def main():
@raghavmri
raghavmri / main.py
Created December 7, 2021 15:47
A simple QR generator using python
import pyqrcode # pip install pyqrcode
# pip install pypng
# you need to install pypng if you want to convert the qr code to png
import png
# This creates a QR code for our youtube channel
# Can be any text or URL
QRCode = pyqrcode.create(
'https://www.youtube.com/channel/UC5GG_qSQ2OgROyc0fRo0KzQ')