Skip to content

Instantly share code, notes, and snippets.


Anton Morev amorev

View GitHub Profile
View NotionTaskObject.ts
parent: {
database_id: taskDB
properties: {
Name: {
type: "title",
title: [
type: "text",
amorev / bash
Last active Dec 13, 2020
Sending file via Telegram from terminal
View bash
echo sending $curdir/$1
curl -F chat_id=$chatId -F document=@$curdir/$1$botToken/sendDocument
# more about gist on my site —
amorev / convert.php
Last active May 24, 2021
Convert webp images to png for work in safari
View convert.php
// details -
if ($handle = opendir('.')) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
$fileInfo = explode('.', $entry);
$fileName = $fileInfo[0];
$fileExt = $fileInfo[1];
if ($fileExt === 'png') {
amorev /
Last active Jun 9, 2022
WSL add Windows host address to /etc/hosts

This small gist will add automaticaly to hosts file and you will be able to communicate with your windows system, using as address.

After creating your wsl do next:

  1. Place at / and run chmod +x /
  2. Run visudo
  3. Add %sudo ALL=NOPASSWD: / to end of file
  4. Add sudo / at end of file /etc/profile

That's all. After first login in wsl after system start will point to your windows host

amorev / bash
Last active Oct 17, 2019
Wget file from Google Drive
View bash
# Change FILE_ID to ID of File in google drive.
# Change FILE_NAME to File name, which you want to use for save file
FILE_ID=FILE_ID FILE_NAME=FILE_NAME wget --load-cookies /tmp/cookies.txt "$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate '$FILE_ID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=$FILE_ID" -O $FILE_NAME && rm -rf /tmp/cookies.txt
amorev / bash
Last active Jan 4, 2022
Telegram backup script
View bash
# создаем один tar.bz2 архив
cd $backupDirectory
tar -cvjf $backupDirectory/archive.full.tar.bz2 $projectDirectory
split -b 40M archive.full.tar.bz2 ""
for i in `ls $backupDirectory | grep part`