Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
function generate_cert() {
if [ $# -ne 2 ]; then
echo "Usage: generate_cert <email> <domain>"
return 1
fi
local email=$1
local domain=$2
@taesiri
taesiri / config.json
Created June 7, 2023 17:54
v2ray-loadbalancer
{
"api": {
"services": [
"HandlerService",
"LoggerService",
"StatsService"
],
"tag": "api"
},
"inbounds": [
@taesiri
taesiri / speedy.py
Created April 10, 2023 05:10
SpeedTest.py
import requests
import time
def format_speed(speed_bytes):
"""
Formats download speed into a human-readable string.
:param speed_bytes: Download speed in bytes per second
:return: Formatted download speed string
@taesiri
taesiri / imagenet-labels.json
Created March 23, 2023 04:24
imagenet-labels.json
["tench",
"goldfish",
"great white shark",
"tiger shark",
"hammerhead shark",
"electric ray",
"stingray",
"cock",
"hen",
"ostrich",
@taesiri
taesiri / Dockerfile
Last active August 29, 2022 12:43
Dockerfile for JAX Cuda + PyTorch
FROM nvidia/cuda:11.6.1-cudnn8-devel-ubuntu20.04
# Install python3
RUN apt update && apt install -y python3-pip htop curl wget git
RUN ln -sf /usr/bin/python3 /usr/bin/python && \
ln -sf /usr/bin/pip3 /usr/bin/pip
RUN pip --no-cache-dir install --upgrade pip setuptools_rust
@taesiri
taesiri / index.html
Created February 25, 2022 03:31
Sketchfab set view
<div class="container">
<div class="iframe-container">
<iframe id="api-frame"></iframe>
</div>
<div class="explainer" id="explainer">
Set camera position example. The "Print view" button outputs camera information to the console.
</div>
<div class="controls" id="controls">
<button id="view1">View Poe</button>
<button id="view2">View Rey</button>
@taesiri
taesiri / install_xelatex_on_mac.txt
Created March 30, 2021 13:53 — forked from peterhurford/install_xelatex_on_mac.txt
How to install latex and xelatex on Mac so that Jupyter "Download as PDF" will work
brew install pandoc
brew tap homebrew/cask
brew cask install basictex
eval "$(/usr/libexec/path_helper)"
# Update $PATH to include `/usr/local/texlive/2020basic/bin/x86_64-darwin`
sudo tlmgr update --self
sudo tlmgr install texliveonfly
sudo tlmgr install xelatex
sudo tlmgr install adjustbox
sudo tlmgr install tcolorbox
@taesiri
taesiri / Install_OpenCV4_CUDA10.md
Created August 15, 2020 17:40 — forked from raulqf/Install_OpenCV4_CUDA11_CUDNN8.md
How to install OpenCV 4.2 with CUDA 10.0 in Ubuntu 18.04

How to install OpenCV 4.2.0 with CUDA 10.0 in Ubuntu distro 18.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries:

@taesiri
taesiri / get_replies.py
Created February 28, 2020 10:06 — forked from mcdickenson/get_replies.py
Extract replies to a tweet into a CSV
import csv
import tweepy
# get credentials at developer.twitter.com
auth = tweepy.OAuthHandler('API Key', 'API Secret')
auth.set_access_token('Access Token', 'Access Token Secret')
api = tweepy.API(auth)
# update these for whatever tweet you want to process replies to
@taesiri
taesiri / Hostspot.ps1
Created December 11, 2019 20:09
Windows Hotspot Creator
write-host("Ad-Hoc Creator")
write-host("Please enter an SSID") -foreground "green"
$network_name = Read-Host
write-host("Please enter a Password") -foreground "green"
$network_pass = Read-Host
write-host "Stopping current hosted network ..." -foreground "yellow"
netsh wlan stop hostednetwork
write-host "Creating new network ..."-foreground "green"
netsh wlan set hostednetwork mode=allow ssid=$network_name key=$network_pass
write-host("Starting network ...") -foreground "green"