Skip to content

Instantly share code, notes, and snippets.

View alikhil's full-sized avatar
🎯
Focusing

Alik Khilazhev alikhil

🎯
Focusing
View GitHub Profile
@alikhil
alikhil / backups.rsc
Last active March 9, 2025 12:13
Mirotik auto dns switchover scripts
# source https://forum.mikrotik.com/viewtopic.php?t=144577
# script to disable secondary DNS when adguard is back up
:global disableBackup do={
# set variables
:local adguardIP "192.168.11.2"
:local message "\E2\9C\85 Primary DNS $adguardIP is up. Switching Cloudflare DNS to Adguard."
:local myhost ([/system identity get name])
:if ([/ip dns get servers]!=$adguardIP) do={
# Description: Boxstarter Script
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST>
#---- TEMPORARY ---
Disable-UAC
#--- Windows subsystems/Features ---
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
@alikhil
alikhil / tactic.go
Created September 26, 2020 17:19
Tactic for Gophers and Dragons game - https://quasilyte.dev/gophers-and-dragons
package tactic
import "github.com/quasilyte/gophers-and-dragons/game"
func ChooseCard(s game.State) game.CardType {
return winingTactic(s)
}
func winingTactic(s game.State) game.CardType {
import logging
from os import getenv
from dotenv import load_dotenv
load_dotenv()
from telegram import Update, InlineKeyboardMarkup, InlineKeyboardButton
@alikhil
alikhil / main.go
Created May 16, 2018 13:21
Redirect to site using parameter from url
package main
import (
"log"
"net/http"
)
var destination string
func redirect(w http.ResponseWriter, r *http.Request) {
@alikhil
alikhil / setup_class.sh
Last active March 30, 2018 18:31
Script for downloading and organising dataset
# should be run from "root" dir
ARGS=1
E_BADARGS=85
if [ $# -ne "$ARGS" ]
then
echo "Usage: `basename $0` {cars|bike}"
exit $E_BADARGS
fi
@alikhil
alikhil / Dockerfile
Created January 12, 2018 14:56
PostgreSQL with Russian Hunspell dictionary in docker
FROM postgres:9.6
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& apt-get install -y git \
&& apt-get install -y build-essential \
&& apt-get install -y postgresql-server-dev-9.6 \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p hunspell \
&& cd hunspell \
@alikhil
alikhil / slang.tmLanguage
Created April 24, 2017 16:33
Language grammar for Slang
{
// версия 1
// операторы, ключевые слова, названия юнитов в определении
// константы, комментарии, базовые типы, библиотечные юниты
patterns = (
{ name = 'string.quoted.double.slang';
begin = '"';
end = '"';
patterns = (
{ name = 'constant.character.escape.untitled';
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>src</string>
</array>
<key>name</key>
<string>untitled</string>
@alikhil
alikhil / make_backup.sh
Last active September 24, 2016 14:50
backuping open edx courses
#!/bin/bash
if [ ! -d /root/backups ]; then
mkdir /root/backups
fi
DIR_NAME='/root/backups/'$(date +"%d-%m-%Y__%H_%M")
mkdir "$DIR_NAME"
echo $DIR_NAME