Skip to content

Instantly share code, notes, and snippets.

View Sagleft's full-sized avatar

Sagleft Sagleft

View GitHub Profile
@Sagleft
Sagleft / gist:30f901e3872beaae7a9b7918d1368176
Created October 31, 2018 14:58
mfinotaur_api_docs.html
Регистрация
Чтобы использовать сервис авторизуйтесь с помощью Единого Логина Freeland.
После входа вы получите api_key и user_id для запросов к API.
О сервисе
MFinotaur API - сервис горячего MFCoin кошелька для ваших проектов.
Если вы не хотите арендовать VPS/VDS и устанавливать на сервер MFCoind, то можете воспользоваться нашим решением.
Возможности
Создание новых адресов.
Прием, отправка MFCoin.
@Sagleft
Sagleft / bitcoin.conf
Created May 24, 2019 12:56 — forked from requnix/bitcoin.conf
Default Bitcoin Configuration file
##############################################################
# Bitcoin configuration. Lines beginning with # are comments.#
##############################################################
# Network-related settings:
# Run on the test network instead of the real bitcoin network.
#testnet=1
# Connect via a socks4 proxy
@Sagleft
Sagleft / rgb_to_hex_to_rgb.php
Created July 13, 2019 23:04 — forked from Pushplaybang/rgb_to_hex_to_rgb.php
php functions convert hex to rgb and rgb to hex
function hex2rgb($hex) {
$hex = str_replace("#", "", $hex);
if(strlen($hex) == 3) {
$r = hexdec(substr($hex,0,1).substr($hex,0,1));
$g = hexdec(substr($hex,1,1).substr($hex,1,1));
$b = hexdec(substr($hex,2,1).substr($hex,2,1));
} else {
$r = hexdec(substr($hex,0,2));
$g = hexdec(substr($hex,2,2));

скачиваем архив с ботом, распаковываем

wget https://update.u.is/downloads/linux/utopia_bot-latest.x86_64.tar.gz
tar -xvf utopia_bot-latest.x86_64.tar.gz
rm -f utopia_bot-latest.x86_64.tar.gz
mv utopia_bot-0.3-5082.el7.x86_64 utopia_bot
cd utopia_bot
  • Далее получаем в Desktop-клиенте токен для бота,
  • Вводим его при запуске бота:
@Sagleft
Sagleft / startopia_centos7_x86_64.md
Last active November 11, 2022 15:48
Автозапуск клиента Utopia в Headless Mode на примере CentOS

Автозапуск клиента Utopia в Headless Mode на примере CentOS

Это может быть необходимо, если вы создаете свой сервис (сайт, бота, etc) для Utopia Network, который будет использовать Utopia API.

Есть вариант более быстрой установки, готовый скрипт: https://gist.github.com/Sagleft/62d71f81ecf3fe23dce624fe182669cb (с этим скриптом сначала надо закинуть свой .db файл аккаунта в /home/account.db, затем запустить скрипт - установится Utopia, все необходимые пакеты, создастся сервис и запустится)

Сперва устанавливаем клиент Utopia:

@Sagleft
Sagleft / golang.udl.xml
Last active January 22, 2020 11:09 — forked from blinksmith/golang.udl.xml
Notepad++ Syntax Highlight for Go
<NotepadPlus>
<!--
NPP Syntax Highlight for Go
using most used color in NPP for Golang.
Author: blinksmith, sagleft Version: 0.1.4
Last tested in Notepad++ v7.5.4
Quick start :
Method 1
- Download golang.udl.xml and then open notepad++

Autostart Utopia client in Headless Mode using Ubuntu as an example

This may be necessary if you are creating your service (site, bot, etc) for the Utopia Network that will use the Utopia API.

First we install the Utopia client:

apt-get install gdebi-core libx11-xcb1 libgl1-mesa-glx libpulse-mainloop-glib0 libgtk-3-dev
cd /home
mkdir utopiahome

download the archive with the bot, unpack

wget https://update.u.is/downloads/linux/utopia_bot-latest.x86_64.tar.gz
tar -xvf utopia_bot-latest.x86_64.tar.gz
rm -f utopia_bot-latest.x86_64.tar.gz
mv utopia_bot-0.3-5082.el7.x86_64 utopia_bot
cd utopia_bot

Let's look at the ZG.com exchange API to get data about Crypton.

We will make GET requests to the REST API. Let's use the CRPUSDT trading pair as an example.

reference

1. Market depth

https://api.zg.com/openapi/quote/v1/depth?symbol=CRPUSDT&limit=10

Let's look at how to configure the Utopia client to autorun on Linux, as well as to auto-resume the client if it crashes.

This is useful if you want to place on your machine, for example, an automated bot that will work with Utopia channels.

First, download the client and create a script to update the client. using Centos as an example

cd /home
wget https://update.u.is/downloads/linux/utopia-latest.x86_64.rpm
yum install -y libxkbcommon-x11.x86_64 libGL pulseaudio-libs-glib2