Skip to content

Instantly share code, notes, and snippets.

View d351d3r's full-sized avatar
💻
Studying С++

Anatolii Cherednichenko d351d3r

💻
Studying С++
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <security/pam_modules.h>
#include <security/pam_ext.h>
// Функция аутентификации
PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) {
const char* user;
int ret = pam_get_user(pamh, &user, "Username: ");
@d351d3r
d351d3r / .sh
Created November 8, 2023 13:45
Debian
# Сборка live образа Debian
## Требования к скрипту сборки:
- Полностью автоматизированная сборка.
- На выходе требуется получить готовый iso.
- Управление списком устанавливаемых пакетов через конфигурационный файл.
- Наличие комментариев в коде и описание использования.
- Логирование процесса.
## Подготовка:
@d351d3r
d351d3r / .md
Last active December 16, 2023 18:58
Debian-live.md

Сборка live образа Debian

Требования к скрипту сборки:

  • Полностью автоматизированная сборка.
  • На выходе требуется получить готовый iso.
  • Управление списком устанавливаемых пакетов через конфигурационный файл.
  • Наличие комментариев в коде и описание использования.
  • Логирование процесса.

Подготовка:

@d351d3r
d351d3r / 3proxy in Oracle Linux 8.md
Last active June 26, 2021 14:12
Simple configuration of SOCKS5 and HTTP proxy on Oracle Linux 8

Enable EPEL repository

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

sudo dnf update

Install 3proxy

sudo dnf install 3proxy

@d351d3r
d351d3r / ML.py
Created December 12, 2020 14:09
ML.py
from dostoevsky.models import FastTextSocialNetworkModel
from dostoevsky.tokenization import RegexTokenizer
from alg import formula_fedosa
from web_parse import parse_web_irec
tokenizer = RegexTokenizer()
model = FastTextSocialNetworkModel(tokenizer=tokenizer)
string = parse_web_irec()
@d351d3r
d351d3r / huita.py
Created December 11, 2020 14:22
huita.py
import numpy
from nltk.stem.porter import *
from numpy import linalg, asarray
stemmer = PorterStemmer()
class LSI(object):
def __init__(self, stopwords, ignorechars, docs):
self.docs = []
/* A simple bot for emulating user keystrokes so that
* the session is not interrupted due to inactivity
* Start: auto, Pause: DELETE, Kill: END */
#pragma comment(lib, "user32")
#include <Windows.h>
#include <iostream>
int main()
{
// For hidden run
#include <algorithm>
#include <iostream>
#include <locale>
#include <string>
#include <cstring>
int strlen(char *s);
using namespace std;
int main() {
with open("input.txt") as f:
lst = f.readlines()
del lst[0]
lst = [[int(n) for n in x.split()] for x in lst]
for i in range(len(lst)):
for j in lst[i]:
if (lst[i][0] >= 1) & (lst[i][1] <= 10**5):
if (lst[i][0] + lst[i][1] - 1) % 4 != 0:
fo = open('output.txt', 'a')
fo.write(str((lst[i][0] + lst[i][1] - 1) % 4) + '\n')
@d351d3r
d351d3r / optix
Last active August 13, 2020 06:23
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit cmake-utils cuda
DESCRIPTION="NVIDIA Ray Tracing Engine"
HOMEPAGE="https://developer.nvidia.com/optix"
SRC_URI="NVIDIA-OptiX-SDK-${PV}-linux64-x86_64.sh"
# https://developer.download.nvidia.com/designworks/optix/secure/7.1.0/ga/NVIDIA-OptiX-SDK-7.1.0-linux64-x86_64.sh