Skip to content

Instantly share code, notes, and snippets.

Working from home

Umid umidjons

Working from home
View GitHub Profile
umidjons /
Created Jul 13, 2018
Send an Excel file into Telegram group using node-telegram-bot-api

Send an Excel file into Telegram group using node-telegram-bot-api

import * as TelegramBot from 'node-telegram-bot-api';
import * as fs from 'fs';

const TOKEN = '<your_token_got_from_gotfather>';
const GROUP_ID = '<your_group_id>';
const FILE = './data.xlsx';
umidjons / form_for_merchant_api.html
Last active May 8, 2018
A form for Merchant API
View form_for_merchant_api.html
<form method="POST" action="">
<input type="hidden" name="merchant" value="5aec04053f3861ae47378173"/>
<input type="hidden" name="amount" value="100"/> <!-- Amount in coins -->
<input type="hidden" name="account[Ebook]" value="1"/>
<input type="hidden" name="lang" value="en"/>
<button type="submit">Checkout</button>
umidjons /
Created Apr 3, 2018
Installing Payme Magento Plugin

Installing Payme Gateway for Magento

Prepare the container

docker pull alexcheng/magento2:2.2.1
git clone
cd docker-magento2/
git checkout 2.2.1
umidjons / cancel-transaction-method.php
Created Mar 7, 2018
CancelTransaction example on DLE
View cancel-transaction-method.php
class MerchantAPI {
public function CancelTransaction($id, $reason)
if (is_array($this->Authorize())) {
return $this->Authorize();
foreach ($this->errors as $k => $v) {
umidjons / createtransaction-check-other-transaction-for-order.php
Last active Feb 6, 2018
Check, is there any other transaction for this order
View createtransaction-check-other-transaction-for-order.php
// ...
// todo: Check, is there any other transaction for this order/service
$transaction = new Transaction();
$found = $transaction->find(['account' => $this->request->params['account']]);
if ($found) {
if (($found->state == Transaction::STATE_CREATED || $found->state == Transaction::STATE_COMPLETED)
&& $found->paycom_transaction_id !== $this->request->params['id']) {
umidjons /
Created Jan 19, 2018
Generate random string (password) from linux terminal

Generate random string (password) from Linux terminal

Here we are generating 20 length random string. We can use them as password.

tr -dc A-Za-z0-9_ < /dev/urandom | head -c 20 | xargs

Sample outputs:

umidjons /
Last active Dec 6, 2017
Wordpress with Docker Compose

Wordpress with Docker Compose

File docker-compose.yml

version: '3'

    image: nginx:latest
umidjons /
Created Oct 24, 2017
Convert putty ssh key to openssh format

Convert to OpenSSH format

# convert
sudo puttygen putty-generated.ppk -O private-openssh -o openssh-format.ppk

# copy to .ssh/ folder
cp openssh-format.ppk ~/.ssh/

# connect to a host using generated key
umidjons /
Last active Oct 16, 2017
Dockerization of the connect-release

Dockerization of the connect-release


Folder structure:

|_ project
  |_ assets
    |_ connect-release.tar.gz
umidjons /
Last active Jan 30, 2023
Download Audio from YouTube with youtube-dl

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track