This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/questions/7149411/j2me-exception-when-casting-from-pemobject-to-asymmetrickeyparameter-with-bounc | |
// https://stackoverflow.com/questions/11506891/how-to-load-the-rsa-public-key-from-file-in-c-sharp | |
// https://stackoverflow.com/questions/11346200/reading-pem-rsa-public-key-only-using-bouncy-castle/11367152#11367152 | |
using System; | |
using System.Buffers.Text; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Globalization; | |
using System.IO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/sha256" | |
"crypto/sha512" | |
"crypto/x509" | |
"encoding/pem" | |
"fmt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"github.com/yourbasic/graph" | |
"log" | |
"os" | |
"strconv" | |
"strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// On my computer (i7-4790K 4.0GHz) the overall time is 571ms | |
/* | |
* Simple example of algorithm: | |
* For example we want to calculate the smallest number that has 2^4 factors that is 120 | |
* We start by calculating prime number from 2 to n; (I'm not very sure how to calculate n) | |
* After I fill an sorted array named factors just by prime numbers, I start with the smallest one (2) | |
* I multiply the smallest one in a variable called result with the initial value of 1 | |
* After I multiply smallest value from the sorted list in the result, I remove that value from list, and re-inset value ^ 2 | |
* This makes sure that for each number in the list that we multiply in, the number of factors are doubled. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"github.com/yourbasic/graph" | |
"log" | |
"os" | |
"strconv" | |
"strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"github.com/yourbasic/graph" | |
"log" | |
"os" | |
"strconv" | |
"strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"github.com/yourbasic/graph" | |
"log" | |
"os" | |
"strconv" | |
"strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A script to extract the ID from links like: https://drive.google.com/file/d/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/view?usp=sharing | |
for arg in "$@" | |
do | |
arrIN=(${arg//// }) | |
python3 google-drive-downloader.py "${arrIN[4]}" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
URL="$1" | |
TOKEN="Telegram Bot Token" | |
CHAT_ID="Your Chat ID" # for example use @myidbot | |
temp_file=$(mktemp) | |
curl -o $temp_file "$URL" | |
sum=$(md5sum $temp_file) | |
while : | |
do | |
sleep 3600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use the app like python3 TelegramUploader.py /path/to/file | |
# At first install Telethon and humanize with pip3 install telethon humanize cryptg | |
# Note that cryptg is optional and only is used for speeding up the uploads | |
import sys, humanize | |
from telethon import TelegramClient, events, sync | |
def upload_progress_callback(downloaded_bytes, total_bytes): | |
print("Uploaded: " + humanize.naturalsize(downloaded_bytes) + " / " + humanize.naturalsize(total_bytes), end='\r') | |
# These example values won't work. You must get your own api_id and |