Skip to content

Instantly share code, notes, and snippets.

View umidjons's full-sized avatar
Working from home

Umid umidjons

Working from home
View GitHub Profile
umidjons /
Created July 13, 2018 06:46
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 07:04
A form for Merchant API
<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 April 3, 2018 07:04
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 March 7, 2018 06:26
CancelTransaction example on DLE
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 February 6, 2018 11:25
Check, is there any other transaction for this order
// ...
// 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 January 19, 2018 11:27
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 December 6, 2017 19:18
Wordpress with Docker Compose

Wordpress with Docker Compose

File docker-compose.yml

version: '3'

    image: nginx:latest
umidjons /
Created October 24, 2017 12:18
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 October 16, 2017 12:56
Dockerization of the connect-release

Dockerization of the connect-release


Folder structure:

|_ project
  |_ assets
    |_ connect-release.tar.gz
umidjons /
Last active March 9, 2024 07:54
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