Skip to content

Instantly share code, notes, and snippets.

View ShilGen's full-sized avatar

Shilov Gennady ShilGen

View GitHub Profile
@ShilGen
ShilGen / debug.php
Last active June 16, 2023 07:38
PHP debug
<?php
if ((isset($_SERVER['QUERY_STRING'])) and ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') ){
define('DEBUG', 1);
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('html_errors', true);
} else {
define('DEBUG', 0);
}
if (!defined('_BR_')) define('_BR_',chr(13).chr(10));
#!/bin/sh
# Запускать командой sudo ./getreboothistory.sh | tee reboothistory.txt
# На выходе reboothistory.txt файл с историей перезагрузок сервера reboothistory.txt
# sudo chmod +x getreboothistory.sh
uname -a
ip -4 addr | grep -oP '(?<=inet\s)\d+(\.\d+){3}'
echo "uptime"
uptime
@ShilGen
ShilGen / csv.cs
Created June 19, 2023 09:40
C# | Как создать csv файл
using System;
using System.IO;
using System.Text;
public class Script
{
public static object Execute()
{
using (var sw = new StreamWriter(@"C:\Users\shilgen\Documents\1.csv", false, Encoding.UTF8))
{
@ShilGen
ShilGen / JS_Fetch_GET_example.html
Last active September 21, 2023 16:26
JS Fetch GET example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>FETCH JS</title>
</head>
<body>
<h1>Authors</h1>
<ul id="authors"></ul>
@ShilGen
ShilGen / .vimrc
Last active November 5, 2023 19:20
Моя шпаргалка по Vim
set number
set foldmethod=manual
set viminfo='1000,f1
set showcmd
set incsearch
set hlsearch
set ruler
set showmatch
set cursorline
public static class Helper
{
public static string getMonthName ( DateTime dt ) {
string[] m = new string[]{
"Январь",
"Февраль",
"Март",
"Апрель",
"Май",
@ShilGen
ShilGen / MOXA_NPort_Ubuntu.md
Last active October 4, 2023 06:04
Алгоритм настройки связи Модем - MOXA NPort 5250A - сервер Ubuntu 20.04

Алгоритм настройки связи Модем - MOXA NPort 5250A - сервер Ubuntu 20.04

1520864-67

1) установка зависимостей

sudo apt install libssl-dev
sudo apt install gcc
sudo apt install make
sudo apt install minicom
@ShilGen
ShilGen / SG_Git_mini_course.md
Created November 22, 2023 19:43
Мини-курс: Работа Git

Мини-курс: Работа Git

Программа курса:

  1. Основы. Git в pet-проекте
  2. Повседневные инструменты
  3. Ветки.

1. Основы. Git в pet-проекте

Начните с использования Git для личных нужд. Пока не думайте ни про какие ветки, делайте все в main.

Обновление репозитариев

apt-get update

Проверка версии Python

python3 --version