Skip to content

Instantly share code, notes, and snippets.

View shantanuo's full-sized avatar

Shantanu Oak shantanuo

  • oksoft
  • mumbai
View GitHub Profile
@Amourspirit
Amourspirit / LibrePythonista-docker-linuxserver-libreoffice.md
Last active March 28, 2025 23:25
Running LibrePythonista in linuxserver/libreoffice docker

Running LibrePythonista in linuxserver/libreoffice docker

In order to install LibrePythonista in linuxserver/libreoffice docker (Alpine) image py3-pip must be installed. The other packages are required to install matplotlib.

Create a docker and a docker-compose.yml files and place them in the same folder. Use the contents from the examples below.

Note that volumes are optional. If you want to follow this yml file on Linux or Mac then create a folder in your home folder named vm_shared and that folder will be shared with you docker image.

volumes:
@alexanderdavidsen
alexanderdavidsen / fetch-aws-spotprice.bash
Last active January 28, 2025 04:38
Bash script to fetch AWS spot pricing
#!/usr/bin/env bash
# Colors
BLUE='\033[0;34m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
BOLD='\033[1m'
@tdmalone
tdmalone / aws-services.py
Created December 28, 2023 04:39
Using an undocumented (and thus subject-to-change) API, provides a list of all AWS services colourised as to whether or not they're available in the given region. Alternatively, given two regions, colourised based on whether services are available in one region, both regions, or neither of them.
#!/usr/bin/env python
import json, sys
from urllib.request import urlopen
def green(str): return f'\033[92m{str}\033[0m'
def orange(str): return f'\033[38;5;214m{str}\033[0m'
def red(str): return f'\033[91m{str}\033[0m'
def yellow(str): return f'\033[93m{str}\033[0m'
@jsoncow
jsoncow / unsupported.csv
Created November 5, 2023 13:26
Unsupported AWS Service Quotas
ServiceCode ServiceName QuotaCode QuotaName
AWSCloudMap AWS Cloud Map L-D95E8A57 Instances per namespace
AWSCloudMap AWS Cloud Map L-2DA90E5C Instances per service
AWSCloudMap AWS Cloud Map L-D589BB26 Custom attributes per instance
account AWS Account Management L-E37B66F4 Number of concurrent region-opt requests per account
account AWS Account Management L-33A0F311 Number of concurrent region-opt requests per organization
acm AWS Certificate Manager (ACM) L-DA1D8B98 ACM certificates created in last 365 days
acm AWS Certificate Manager (ACM) L-D2CB7DE9 Imported certificates
acm AWS Certificate Manager (ACM) L-FB94F0B0 Domain names per ACM certificate
acm AWS Certificate Manager (ACM) L-F141DD1D ACM certificates
@justmarkham
justmarkham / python_version_history.ipynb
Last active February 22, 2025 06:46
Data School blog post
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MaxHalford
MaxHalford / dataset.csv
Last active March 11, 2023 06:33
Are Airbnb guests less energy efficient than their host?
date kilowatt-hour n_hosts n_guests temperature
2022-01-01 2.171 0.0 0.0 7.875000000000028
2022-01-02 10.31 0.0 0.5 8.787500000000023
2022-01-03 16.107 0.0 1.0 8.35000000000003
2022-01-04 16.563 0.0 1.0 9.250000000000014
2022-01-05 17.098 0.0 1.0 5.700000000000024
2022-01-06 18.76 0.0 1.0 2.950000000000024
2022-01-07 20.853 0.0 1.0 3.2500000000000284
2022-01-08 19.548 0.0 1.0 8.887500000000031
2022-01-09 20.81 0.0 1.0 8.72500000000003
@ustayready
ustayready / gpt.py
Created January 16, 2023 23:49
CloudGPT - Use ChatGPT to analyze AWS policies for vulnerabilities
import openai
import boto3
import json
import time
from typing import Dict, List
openai.api_key = '### SET YOUR OPENAPI API KEY HERE ###'
session = boto3.session.Session()
client = session.client('iam')
@akhan619
akhan619 / tokenizers.md
Last active October 31, 2023 10:22
Exploring Tokenizers from Hugging Face

Exploring Tokenizers from Hugging Face

Hugging Face (HF) has made NLP (Natural Language Processing) a breeze. In this post, we are going to take a look at tokenization using a hands on approach with the help of the Tokenizers library. We are going to load a real world dataset containing 10-K filings of public firms and see how to train a tokenizer from scratch based on the BERT tokenization scheme. In the process we will understand tokenization in detail and some gotchas to keep an eye out for.

Background on NLP (Optional)

If you already have an understanding of the NLP pipeline, you can safely skip this section.

For any NLP task, one of the first steps is pre-processing the data so that it can be fed into our NLP models. For those new to NLP, the general pipeline for any NLP task (text classification, question answering, etc.) is as follows:

@rasbt
rasbt / video-subtitles-via-whisper.py
Last active March 20, 2025 13:55
Script that creates subtitles (closed captions) for all MP4 video files in your current directory
# Sebastian Raschka 09/24/2022
# Create a new conda environment and packages
# conda create -n whisper python=3.9
# conda activate whisper
# conda install mlxtend -c conda-forge
# Install ffmpeg
# macOS & homebrew
# brew install ffmpeg
# Ubuntu
@codewithbas
codewithbas / stats.py
Created January 26, 2022 11:24
Getting stats from Twitter's API
import json
from TwitterAPI import (
TwitterAPI,
TwitterPager
)
consumer_key = "<YOUR API KEY>"
consumer_secret = "<YOUR API KEY SECRET>"
access_token = "<YOUR ACCESS TOKEN>"
access_token_secret = "<YOUR ACCESS TOKEN SECRET>"