Skip to content

Instantly share code, notes, and snippets.

View Dmitry-Klymenko's full-sized avatar

Dmitry Klymenko Dmitry-Klymenko

  • Cashrewards
  • Wollongong
View GitHub Profile
@Dmitry-Klymenko
Dmitry-Klymenko / mikrotik_generate_peer.rsc
Last active January 3, 2025 10:12
MikroTik script for RouterOS to create another peer for Wireguard interface
#
# A MikroTik script for RouterOS to create yet another peer for wireguard server interface
#
# For each peer, change peerName, peerIP and peerAllowedIPs
# v20250103
#using global to allow execution line by line
:global tmpWGInterfaceName wg0tmp
:global wgInterfaceName wireguardServer
:global wgInterfacePort 13232
@Dmitry-Klymenko
Dmitry-Klymenko / gist:c8aef3ad40d27d9adabdbba76ee1648b
Created December 21, 2024 04:55
Mikrotik configuration script adding Synology resources to address list
add list=SkipVPN comment="Synology" address=account.synology.com
add list=SkipVPN comment="Synology" address=apiauth.quickconnect.to
add list=SkipVPN comment="Synology" address=autoupdate.synology.com
add list=SkipVPN comment="Synology" address=checkip.dyndns.org
add list=SkipVPN comment="Synology" address=checkip.synology.com
add list=SkipVPN comment="Synology" address=checkip.webrtc.quickconnect.to
add list=SkipVPN comment="Synology" address=checkipv6.quickconnect.to
add list=SkipVPN comment="Synology" address=checkipv6.synology.com
add list=SkipVPN comment="Synology" address=checkport.synology.com
add list=SkipVPN comment="Synology" address=cnc.quickconnect.cn
@Dmitry-Klymenko
Dmitry-Klymenko / duplicate_file_finder.py
Created July 16, 2024 06:05
This script is designed to identify and delete duplicate files within a specified directory. It compares files in two directories: one containing the files to check for duplicates and the other containing the original files to compare against. If a duplicate is found, the script can either report the duplicate or delete it, based on the provided…
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# This script is intended to run under Python 2.7
"""
Description:
This script is designed to identify and delete duplicate files within a specified directory. It compares files in two directories:
one containing the files to check for duplicates and the other containing the original files to compare against. If a duplicate
is found, the script can either report the duplicate or delete it, based on the provided command-line arguments.
@Dmitry-Klymenko
Dmitry-Klymenko / bigquery-copy-between-regions.sh
Last active June 18, 2019 00:36 — forked from dutchiechris/bigquery-copy-between-regions.sh
Google Cloud Platform Big Query script to copy data from one region to another
#!/bin/sh
#
# Google Cloud Platform Big Query script to copy data from one region to another
#
# Disclaimer: This is not an officially supported Google product.
# Written code can be used as a baseline but is not meant for production usage.
#
# Based on https://gist.github.com/dutchiechris/1da2f8786107a635e7e6f5a8c50e84dc with a few improvements (main one: support for large BQ files which cannot be exported to a single JSON file).
#
# Window 10 has a Bash shell feature. Once enabled and installed it allows to run shell command on Windows platform. It is a completely different environment through.
function() {
return function(model) {
var globalSendTaskName = '_' + model.get('trackingId') + '_sendHitTask';
// Hook the sendHitTask - grab an original reference to a function
var originalSendTask = window[globalSendTaskName] = window[globalSendTaskName] || model.get('sendHitTask');
model.set('sendHitTask', function(sendModel) { //overwrite sendHitTask with our code
var hitPayload = sendModel.get('hitPayload');
<html>
<head>
<title>Example</title>
</head>
<body dir="ltr">
Blah blah blah
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@Dmitry-Klymenko
Dmitry-Klymenko / gist:fe27859dd61a32829b07
Created February 2, 2015 09:04
Базовый JavaScript - объяснение для новичков
/*********************************
* Вступление в JavaScript
*********************************/
function main() {
// Это однострочный комментарий - здесь можно писать все что угодно - Адвордс Скриптинг эту строчку проигнорирует
/* А это многострочный комментарий
очень полезен для "отключения" строчек кода или написания целой кучи пояснений к коду
*/
// Фукция main является отправной точкой выполнения и ее наличие является обязательной (только для скриптов AdWords)
// Давайте начнем с переменных JavaScript
@Dmitry-Klymenko
Dmitry-Klymenko / simple-javascript-description
Created February 2, 2015 09:02
Базовый JavaScript - объяснение для чайников
/*********************************
* Вступление в JavaScript
*********************************/
function main() {
// Это однострочный комментарий - здесь можно писать все что угодно - Адвордс Скриптинг эту строчку проигнорирует
/* А это многострочный комментарий
очень полезен для "отключения" строчек кода или написания целой кучи пояснений к коду
*/
// Фукция main является отправной точкой выполнения и ее наличие является обязательной (только для скриптов AdWords)
// Давайте начнем с переменных JavaScript
@Dmitry-Klymenko
Dmitry-Klymenko / gist:4d27e32224b545d61f9b
Created February 2, 2015 07:58
Демонстрационный скрипт для подстановки параметров в Google AdWords
// Давайте определим константы
var END_DATE = new Date('December 21, 2015'); //день окончания акции
var AD_GROUP_NAME = 'On Sale'; //имя группы объявлений (Ad Group) в адвордс
/*
Функция main() отправная точка скрипта. С нее начинается выполнение скрипта. Нет, она не принимает параметры: argv и argc
*/
function main() {
//эта функция возвращает ассоциативный массив с количеством часов и минут до окончания распродажи
var timeLeft = calculateTimeLeftUntil(END_DATE);
// Давайте определим константы
var END_DATE = new Date('December 21, 2015'); //день окончания акции
var AD_GROUP_NAME = 'On Sale'; //имя группы объявлений (Ad Group) в адвордс
/*
Функция main() отправная точка скрипта. С нее начинается выполнение скрипта. Нет, она не принимает параметры: argv и argc
*/
function main() {
//эта функция возвращает ассоциативный массив с количеством часов и минут до окончания распродажи
var timeLeft = calculateTimeLeftUntil(END_DATE);
var adGroup = getAdGroup(AD_GROUP_NAME); //выбираем из адвордса нужную группу объявлений