Skip to content

Instantly share code, notes, and snippets.

View npfate's full-sized avatar
💭
learning

Chernyshov Alexander npfate

💭
learning
  • Saint-Petersburg
View GitHub Profile
@npfate
npfate / ipmikvm.sh
Created October 5, 2022 19:55 — forked from sangjinhan/ipmikvm.sh
Shell Script for IPMI remote KVM console
#!/bin/bash
function cleanup {
# Remove JNLP file and SSH process
rm -f $HOST.jviewer.jnlp
kill $!
}
USAGE="Usage: $0 -p <SSH proxy host> <hostname> <username>"
@npfate
npfate / data.json
Created March 29, 2022 21:14 — forked from sklyar/data.json
List of all countries with translations
[
{
"name": "Afghanistan",
"alpha2_code": "AF",
"alpha3_code": "AFG",
"native_name": "افغانستان",
"numeric_code": "004",
"currency_code": "AFN",
"translations": {
"russian": "Афганистан",
@npfate
npfate / data.json
Created March 29, 2022 21:13 — forked from sklyar/data.json
List of all currencies with translations
[
{
"name": "United Arab Emirates Dirham",
"rus": "ОАЭ Дирхам",
"ukr": "Дірхам Об'єднаних Арабських Еміратів",
"bgr": "Обединени арабски емирства Дирхам",
"cze": "Spojené arabské emiráty Dirham",
"deu": "Dirham der Vereinigten Arabischen Emirate",
"gre": "Ηνωμένα Αραβικά Εμιράτα Dirham",
"est": "Araabia Ühendemiraadid Dirham",
@npfate
npfate / README.md
Created March 11, 2022 20:09 — forked from etiennetremel/README.md
Simple Wireguard setup as VPN server and multiple clients

Simple WireGuard configuration

1 server, 2 clients

Getting started

Install Wireguard on all machines.

Generate all keys

@npfate
npfate / maintenance.html
Created July 23, 2021 19:44 — forked from cronfy/maintenance.html
HTML: Техническое обслуживание сайта (503) (Simple Maintenance Page)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Техническое обслуживание</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
@npfate
npfate / .htaccess
Created July 23, 2021 19:44 — forked from cronfy/.htaccess
.htaccess 503 Техническое обслуживание сайта (maintenance page)
AddDefaultCharset utf-8
ErrorDocument 503 /maintenance.html
RewriteEngine On
RewriteBase /
# uncomment and set your ip to allow your ip to enter
#RewriteCond %{REMOTE_ADDR} !1\.2\.3\.4
# block requests to site, but allow let's encypt generation
@npfate
npfate / cleanup.sh
Created July 23, 2021 19:41 — forked from cronfy/cleanup.sh
Smoothly remove large number of files, by batches/sec
#!/bin/sh
# Удаляем по 20 файлов в секунду. За 3 часа плавно удалим 200k файлов.
# Пригодится, когда нужно обновить кеш картинок на сайте, но нельзя удалить сразу весь кеш,
# потому что сайт ляжет из-за генерации новых картинок.
find ./ -type f | while sleep 1 ; do
CNT=0
while read line ; do
CNT=$(($CNT + 1))
@npfate
npfate / Reset-SynTPEnh.xml
Last active December 12, 2020 01:45
Reset SynTPEnh.exe on event of reseting explorer.exe. - When explorer.exe hangs, it will reset with the Event ID 1002. Thinkpad T420 SynTPEnh.exe hangs too and you can't scroll up or down with trackpoint. This gist makes it reset it automatically
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2020-10-20T22:24:24.8106676</Date>
<Author>ALEXTHINK\alexander-think</Author>
<Description>Reset SynTPEnh.exe on event of reseting explorer.exe</Description>
<URI>\Reset-SynTPEnh</URI>
</RegistrationInfo>
<Triggers>
<EventTrigger>
@npfate
npfate / bookmark.html
Created July 10, 2017 17:38 — forked from creaslippers/bookmark.html
Add to bookmark
<script>
function addFav() {
var isWebkit, isMac;
var UA = navigator.userAgent.toLowerCase();
var title = document.title;
var url = document.location;
// Webkit (Chrome, Opera), Mac
if ( (isMac = (UA.indexOf('mac') != -1)) || (isWebkit = (UA.indexOf('webkit') != -1)) ){
document.getElementById('fav').innerHTML = 'Нажмите "' + (isMac ? 'Command/Cmd' : 'Ctrl') + ' + D" для добавления сайта в закладки';
@npfate
npfate / language.js
Created July 10, 2017 17:37 — forked from creaslippers/language.js
Language detection
// Language detection
function LanguageInfo(){
var n = navigator;
this.UALanguage = n.language ? n.language : n.browserLanguage ? n.browserLanguage : null;
this.userLanguage = n.userLanguage ? n.userLanguage : n.systemLanguage ? systemLanguage : null;
}
function getCookie ( lg )
{