Skip to content

Instantly share code, notes, and snippets.

View dim13's full-sized avatar
🇺🇦
Кто к нам с чем зачем, тот от того и того!

Dimitri Sokolyuk dim13

🇺🇦
Кто к нам с чем зачем, тот от того и того!
View GitHub Profile
diskutil list external # -> disk4
diskutil eraseDisk MS-DOS "WIN10" MBR disk4
hdiutil mount ~/Downloads/Win10_22H2_German_x64.iso
rsync -avh --progress --exclude=sources/install.wim /Volumes/CCCOMA_X64FRE_DE-DE_DV9/ /Volumes/WIN10/
wimlib-imagex split /Volumes/CCCOMA_X64FRE_DE-DE_DV9/sources/install.wim /Volumes/WIN10/sources/install.swm 2048
@dim13
dim13 / commit.txt
Last active April 25, 2020 11:07
Git Commit Messages
Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
Write your commit message in the imperative: "Fix bug" and not "Fixed bug"
defaults write org.vim.MacVim MMTextInsetLeft 5
defaults write org.vim.MacVim MMTextInsetRight 5
#!/bin/sh
#
# $RuOBSD: lesspipe,v 1.3 2004/04/08 04:57:24 form Exp $
#
# Copyright (c) 2003 Oleg Safiullin <form@pdp-11.org.ru>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
@dim13
dim13 / try.c
Created August 9, 2019 12:28
try/catch in plain c
#include <err.h>
#include <stdio.h>
#include <setjmp.h>
#include <signal.h>
static sigjmp_buf exception;
#define try if (!sigsetjmp(exception, 1))
#define catch else
#define throw siglongjmp(exception, 1)
@dim13
dim13 / git-license
Created July 31, 2019 14:05
git license
#!/bin/sh
YEAR=`date +%Y`
NAME=`git config user.name`
MAIL=`git config user.email`
cat <<EOF>LICENSE
Copyright (c) $YEAR $NAME <$MAIL>
Permission to use, copy, modify, and distribute this software for any
@dim13
dim13 / xkb
Created December 20, 2018 09:53
# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="pc105"
XKBLAYOUT="us,ru"
XKBVARIANT=","
XKBOPTIONS="compose:102,caps:escape,grp:alt_space_toggle"
BACKSPACE="guess"
@dim13
dim13 / Makefile
Created November 20, 2018 22:29
Mirror all go releases (OpenBSD Make)
SRC:= 1.2.2
SRC+= 1.3 1.3.1 1.3.2 1.3.3
SRC+= 1.4 1.4.1 1.4.2 1.4.3
SRC+= 1.5 1.5.1 1.5.2 1.5.3 1.5.4
SRC+= 1.6 1.6.1 1.6.2 1.6.3 1.6.4
SRC+= 1.7 1.7.1 1.7.3 1.7.4 1.7.5 1.7.6
SRC+= 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7
SRC+= 1.9 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7
SRC+= 1.10 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5
SRC+= 1.11 1.11.1 1.11.2
#!/bin/sh
#
VERSION=OPENBSD_$(uname -r | tr . _)
MODULES='src ports xenocara'
CVSROOT=anoncvs@anoncvs.eu.openbsd.org:/cvs
export ${CVSROOT}
cd /usr
cvs -d ${CVSROOT} up -r${VERSION} -ACPd ${MODULES}
DEPS=$(shell go list -f '{{join .Deps " "}}' .)
SRCS=$(shell go list -f '{{range .GoFiles}}{{$$.Dir}}/{{.}} {{end}}' ${DEPS} .)
app: ${SRCS}
go build -o $@ .