Skip to content

Instantly share code, notes, and snippets.

View anyxem's full-sized avatar
🎧

Sergey anyxem

🎧
View GitHub Profile
@anyxem
anyxem / gist:084e413167c283d42e7d7f4ad403c3ec
Created January 18, 2024 22:46
Run node as a service
$ sudo vim /etc/systemd/system/mltnode.service
Insert
[Unit]
Description=ML Node Daemon
After=network.target
[Service]
Type=Simple
User=safeuser
#!/bin/bash
TIME="10"
URL="https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage"
TEXT="Deploy status: $1%0A%0AProject:+$CI_PROJECT_NAME%0AURL:+$CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID/%0ABranch:+$CI_COMMIT_REF_SLUG%0ALink:+$DOCS_LINK"
curl -s --max-time $TIME -d "chat_id=$TELEGRAM_USER_ID&disable_web_page_preview=1&text=$TEXT" $URL > /dev/null
import React, { useState, useCallback } from 'react';
import PropTypes from 'prop-types';
import { useTranslation } from 'server/i18n';
import Subscription from 'store/models/Subscription';
import cx from 'classnames';
import css from './style.css';
/**
* AutoRenewSwitch
* @param subscription
// имитация случайных нажатий на кнопки
var classes = ['.increment', '.decrement'];
var steps = 0;
var max_steps = 500; // сколько щелкать
var completed = false;
while (steps < max_steps) {
@anyxem
anyxem / gist:cb04ed3de77d4a2c44a86f1f8ccd2621
Created May 28, 2016 20:13
Ручной тест с помощью одиннадцатиклассницы
javascript:(function(){var%20a,w=document.createTreeWalker(document,NodeFilter.SHOW_TEXT);while(a=w.nextNode()){if(a.textContent.trim().length)a.textContent='Одиннадцатиклассница%20';}})()