Skip to content

Instantly share code, notes, and snippets.

View prostraction's full-sized avatar
🌑
whoami

Eva prostraction

🌑
whoami
View GitHub Profile
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"time"
)
@prostraction
prostraction / main.sh
Last active February 20, 2024 20:03
Various bash commands
nano /etc/ssh/sshd_config # Replace "Port 22" with another port
scp -P 22 backup.tar.gz user@ip:/home/temp
userdel -r <user> # -r also removes /home/usr and mail spool
systemctl list-unit-files
journalctl -u name.service
find / -size +100M # +1G
chattr +i data.txt # запретить писать всем
chattr -i data.txt # отменить запрет на запись
@prostraction
prostraction / README.md
Last active August 29, 2023 21:42
[Выводы по статистике нейронных сетей для шумоподавления изображений]

Этапы продвижения.

Здесь описан прогресс по научной работе.

Классификация шумов по патернам.

При попытке классифицировать шум по вейвлетам и перлинскому шуму, пока не получилось достичь приемлимого результата.

Добавить тип шумов "без шума", куда будут входить только определенные изображения (64x64 solid color и line paterns)?

@prostraction
prostraction / main.go
Last active August 24, 2023 11:47
[Fiber examples] #go
package main
import (
"encoding/json"
"net/http"
"net/url"
"sort"
"strconv"
"github.com/gofiber/fiber/v2"
@prostraction
prostraction / README.md
Last active August 24, 2023 11:47
Go общая инфа про микросервисы и задачки #go

Runtime

  • runtime.ReadMemStats()
  • runtime.GOMAXPROCS(runtime.NumCPU())

Mem

  • mem.Alloc
  • mem.TotalAlloc
  • mem.HeapAlloc
@prostraction
prostraction / main.cpp
Created April 22, 2023 20:30
C++ Measure Disk Space
#include <filesystem>
#include <iostream>
#include <cstring>
#include <cmath>
#include <bits/stdc++.h>
#include <set>
void process(const std::filesystem::path &dir) {
@prostraction
prostraction / main.cpp
Created April 22, 2023 20:28
C++ Parser: Finds and writes words from lines based on filter "starting", "words", "search-words", "end" "words"
#include <iostream>
#include <fstream>
#include <string>
void Parse(std::string& word, const std::string* F, const int& f_size, const std::string* L, const int& l_size, const int& f_current, const int& l_current) {
if (f_current < f_size) {
if (f_current + 1 == f_size && (F[f_current] == "*" || word.find(F[f_current]) != std::string::npos)) {
std::string verify;
for (auto i = 0; i < f_size; i++) {
if (F[i] == "*" && i > 0 && i < f_size - 1) {
@prostraction
prostraction / main.c
Last active November 29, 2020 17:38
[Dynamic sting array] #c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
char** strarray = NULL;
int i = 0, strcount = 0;
char line[1024];
int count_of_words = 0;
@prostraction
prostraction / main.sh
Created November 20, 2020 15:23
[Unable to lock /var/lib/dpkg] #Debian
sudo killall apt apt-get
// if some of these {
sudo lsof /var/lib/dpkg/lock
sudo lsof /var/lib/apt/lists/lock
sudo lsof /var/cache/apt/archives/lock
// } return at least one number, do
sudo kill -9 <process_id>
@prostraction
prostraction / main.go
Last active November 10, 2020 19:09
[uchar* C pointer to byte[] Go array] #go #cgo
// unsigned char* functionOnC();
func GoFunction() {
var length C.int = 1000
pointer := C.functionOnC()
if pointer != nil {
// you can use this expression instead of C.GoBytes(unsafe.Pointer(pointer), length)
slice := (*(*[1 << 30]byte)(unsafe.Pointer(pointer)))[:int(length):int(length)]
// now slice is collecting all *pointer's values
// you can do something like this:
_, err := conn.Write(slice)