Skip to content

Instantly share code, notes, and snippets.

View idma88's full-sized avatar
💻
Principium - dimidium totīus

Dmitrii Ivanov idma88

💻
Principium - dimidium totīus
View GitHub Profile
@idma88
idma88 / remove-from-git-index.txt
Created April 22, 2024 07:12 — forked from bendasvadim/remove-from-git-index.txt
GIT. Как полностью удалить файл из истории
1. Нужно найти все коммиты, которые изменяли файл:
git log --pretty=oneline --branches -- BIGFILE.ZIP
2.1 Удалить ссылки на файл из всей истории коммитов, начиная с последнего (пусть, хеш последнего коммита - 6df7640):
git filter-branch --index-filter 'git rm --cached BIGFILE.ZIP --ignore-unmatch' --prune-empty --tag-name-filter cat -- --all
2.2 Удалить ссылки на каталог из истории коммитов:
git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch BIG/DIR' --prune-empty --tag-name-filter cat -- --all
3. Отправляем изменения на сервер:
@idma88
idma88 / readme.md
Created August 8, 2023 07:39
Github Action: как сделать commit в защищённую ветку

1. Сгенерируйте пару ключей SSH

Без пароля и т.п.

ssh-keygen -t ed25519 -C "comment, ex.: your_email@example.com"

2. Добавьте открытый ключ (.pub) в качестве ключа развертывания

Ваш репозиторий --> Settings --> Security --> Deploy keys

@idma88
idma88 / update_git.sh
Created May 5, 2023 07:24
How to update Git
#!/bin/sh
git_version=2.40.1
sudo apt install wget dh-autoreconf libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc xmlto docbook2x install-info -y
wget https://github.com/git/git/archive/refs/tags/v$git_version.tar.gz
tar -zxf v$git_version.tar.gz
cd git-$git_version
make configure
@idma88
idma88 / README.md
Last active June 28, 2022 12:19
Индивидуальная конфигурация Git для папок

Что сделать?

Добавить в глобальный .gitconfig:

[includeIf "gitdir/i:d:/personal/"]
  path = d:/personal/config 

Пояснения

  • gitdir/i:... - Путь к директории, для которой применяется правило.\n
@idma88
idma88 / regex.md
Created February 3, 2021 07:05 — forked from vitorbritto/regex.md
Regex Cheat Sheet

Regular Expressions

Basic Syntax

  • /.../: Start and end regex delimiters
  • |: Alternation
  • (): Grouping
@idma88
idma88 / wildcard-ssl-certificate.md
Created April 6, 2020 19:29 — forked from talyguryn/wildcard-ssl-certificate.md
How to get a wildcard ssl certificate and set up Nginx.

How to get and install a wildcard SSL certificate

In this guide you can find how to resolve the following issues.

Feel free to ask any questions in the comments section below.

@idma88
idma88 / factorio_headless_guide.md
Created April 6, 2020 19:29 — forked from othyn/factorio_headless_guide.md
How to setup a Factorio Headless Server

[LINUX] Factorio Headless Server Guide

So, with credit to the Factorio wiki and cbednarski's helpful gist, I managed to eventually setup a Factorio headless server. Although, I thought the process could be nailed down/simplified to be a bit more 'tutorialised' and also to document how I got it all working for my future records.

The specific distro/version I'm using for this guide being Ubuntu Server 16.04.1 LTS. Although, that shouldn't matter, as long as your distro supports systemd (just for this guide, not a Factorio headless requirement, although most distros use it as standard now). The version of Factorio I shall be using is 0.14.20, although should work for any version of Factorio 0.14.12 and higher.

Alternate

If you prefer a simple, automated setup, [Bisa has a really handy init script that will do most of the work for

@idma88
idma88 / wot.php
Created October 16, 2018 20:26 — forked from cjmaxik/wot.php
World of Trucks loading screen pictures
<?php
$images = file_get_contents('http://lscreens.eut2.online.scssoft.com/eut2/lscr/data'); // Download WoT loading screens data file
$images = trim(substr($images, 1025)); // Trim and cut first 1024 symbols (idk what to do with it)
// Making array of things
$images_array = explode('\\n', json_encode($images));
foreach ($images_array as $key => &$value) {
$value = explode(';', $value);
}
![Иллюстрация к проекту](https://github.com/jon/coolproject/raw/master/image/image.png)
![Image alt](https://github.com/{username}/{repository}/raw/{branch}/{path}/image.png)
{username} — ваш ник на ГитХабе;
{repository} — репозиторий где хранятся картинки;
{branch} — ветка репозитория;
{path} — путь к месту нахождения картинки.