Skip to content

Instantly share code, notes, and snippets.

View iakunin's full-sized avatar

Maksim Iakunin iakunin

View GitHub Profile
@nukdokplex
nukdokplex / 100_hirkn-ipsets.sh
Created October 9, 2022 04:16
Selective routing to WireGuard on Keenetic
#!/bin/sh
# /opt/etc/ndm/fs.d/100_hirkn-ipsets.sh
[ "$1" != "start" ] && exit 0
echo " --- HIRKN ENTRY POINT --- "
RKN_SET_FILE="/opt/root/rkn.lst"
GOOGLE_SET_FILE="/opt/root/google.lst"
CUSTOM_SET_FILE="/opt/root/custom.lst"
@andreoss
andreoss / .editorconfig
Last active October 23, 2020 17:21
Qulice-compliant .editorconfig
[*]
charset = utf-8
end_of_line = lf
tab_width = 4
indent_size = 4
indent_style = space
insert_final_newline = false
max_line_length = 80
ij_visual_guides = 80
ij_wrap_on_typing = true
@stdmitry
stdmitry / regulations.md
Last active December 12, 2019 14:56
Комментарии к регламенту разработки

Спринты по 1-ой неделе

  • В понедельник, после закрытия спринта, разработчик оценивает задачи на следующий спринт
  • Оценке подлежат все задачи разработчика в новом спринте, которые не переданы в тестирование
  • В результате оценки не должно остаться задач с Remaining Estimate = 0
  • В спринт берутся задачи с совокупной оценкой ~26 часов на разработчика (~4 часа на оценку / декомпозицию)

Задача должна быть декомпозирована на блоки по 4-8 часов

  • Если оценка задачи оказывается больше 8 часов, задача должна быть разбита разработчиком на несколько частей / этапов
@elviejokike
elviejokike / ZonedDateTimeAttributeConverter.java
Last active August 2, 2023 11:16
ZonedDateTime Attribute Converter - Database timestamps stored in UTC. JPA model uses the default time zone of the system.
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import java.sql.Timestamp;
import java.time.ZoneId;
import java.time.ZonedDateTime;
@Converter(autoApply = true)
public class ZonedDateTimeAttributeConverter implements AttributeConverter<ZonedDateTime, Timestamp> {
static ZoneId utcZoneId = ZoneId.of("UTC");
@2E0PGS
2E0PGS / linux-usb-file-copy-fix.md
Last active May 11, 2024 06:48
Fix Ubuntu and other Linux slow/hanging file copying via USB.

If your running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:

echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

I suggest you edit your /etc/rc.local file to make this change persistant across reboots.

sudo nano /etc/rc.local

@carlos-jenkins
carlos-jenkins / multihooks.py
Last active August 10, 2023 22:12
Delegating script for multiple git hooks
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2017 Carlos Jenkins <carlos@jenkins.co.cr>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@cam8001
cam8001 / dapply
Last active December 20, 2023 19:40
Apply a patch directly from a URL without downloading it first.
#!/bin/bash
# Downloads and applies a patch from Drupal.org.
if [ -z "$1" ]
then
echo "You need to supply a URL to a patch file."
exit
fi
URL=$1;
@jboner
jboner / latency.txt
Last active June 30, 2024 18:51
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD