Skip to content

Instantly share code, notes, and snippets.

View skushnerchuk's full-sized avatar

Sergey Kushnerchuk skushnerchuk

View GitHub Profile
@skushnerchuk
skushnerchuk / arp-packet-scanner.go
Created May 6, 2024 05:19 — forked from herry13/arp-packet-scanner.go
Catching ARP packet in Go
package main
import (
"fmt"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
"log"
"net"
)
@skushnerchuk
skushnerchuk / script.sh
Created March 13, 2024 12:12 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@skushnerchuk
skushnerchuk / Install FreeNAS SCALE on a partition and create a mirror.md
Created December 13, 2023 10:39 — forked from gangefors/Install FreeNAS SCALE on a partition and create a mirror.md
How to install TrueNAS SCALE on a partition instead of the full disk

Install TrueNAS SCALE on a partition instead of the full disk

The TrueNAS installer doesn't have a way to use anything less than the full device. This is usually a waste of resources when installing to a modern NVMe which is usually several hundred of GB. TrueNAS SCALE will use only a few GB for its system files so installing to a 16GB partition would be helpful.

The easiest way to solve this is to modify the installer script before starting the installation process.

swagger: "2.0",
info:
title: "Swagger Sample App",
description: "Please to click Terms of service"
termsOfService: "javascript:alert(document.cookie)"
contact:
name: "API Support",
url: "javascript:alert(document.cookie)",
email: "javascript:alert(document.cookie)"
version: "1.0.1"
def get_password_hash(password: str, salt: StrOrNone = None, rounds: int = 216000) -> str:
"""
Хеширование пароля.
Хеширование осуществляется так же как и в Django-варианте проекта,
чтобы не вынуждать пользователей сбрасывать пароли после миграции.
:param password: строка пароля
:param salt: строка соли
:param rounds: количество шагов
scss
body.desktop {
.q-focusable:focus, .q-manual-focusable--focused, .q-hoverable:hover {
&.no-hover {
& > .q-focus-helper {
opacity: 0;
}
}
}
}
@skushnerchuk
skushnerchuk / build.yml
Last active May 31, 2022 11:21
replace external submodules in gitlab pipeline
include:
- project: 'devops/ci'
ref: master
file: '/gitlab/scripts.yml'
before_script:
- !reference [.scripts, replace_external_submodules]
@skushnerchuk
skushnerchuk / BootDialog.js
Last active February 11, 2022 07:22
Quasar v2 dialog
import { boot } from 'quasar/wrappers'
export default boot(({ app }) => {
const $q = app.config.globalProperties.$q
app.config.globalProperties.showDialog = (options) => {
return new Promise((resolve, reject) => {
$q.dialog(options).onOk((data) => {
resolve({
ok: true,
@skushnerchuk
skushnerchuk / MonthPicker.vue
Last active October 19, 2021 10:49
Quasar v2 month picker
<template>
<q-input
square
dense
mask="##.####"
outlined
v-bind="$attrs"
:model-value="modelValue"
@update:model-value="setInputValue"
style="width: 125px"
@skushnerchuk
skushnerchuk / Dialog.vue
Last active September 28, 2021 14:28
Quasar dialog
<template>
<q-dialog ref="dialog" @hide="onDialogHide">
<q-card style="min-width: 450px">
<q-card-section>
<span v-if="title">
{{ title }}
<q-space style="height: 10px"/>
</span>