Skip to content

Instantly share code, notes, and snippets.

View dmitry-ra's full-sized avatar
🌐

Dmitry Razumikhin dmitry-ra

🌐
View GitHub Profile
@omgtehlion
omgtehlion / Program.cs
Last active August 18, 2020 00:22
this code generates a copy of officedaytime’s intrinsic guide, but for .NET Core
using HtmlAgilityPack;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Xml.Linq;
using System.Xml.XPath;
// generated page is hosted at https://drachev.com/officedaytime/
@howyay
howyay / Setting up Postfix on Debian.md
Last active January 27, 2026 14:13
A guide to set up a Postfix + Dovecot IMAP server with complete spf, dkim and dmarc support.

An ultimate guide to Postfix + Dovecot IMAP server with complete SPF, DKIM and DMARC support and additional instructions for a multi-domain setup

In this guide, domain.com will be your root domain and mail.domain.com will be the hostname of your mail server

@wpupru
wpupru / Как настроить SSH на сервере для увеличения времени сессий
Created December 24, 2018 21:50
Как настроить SSH на сервере для увеличения времени сессий
Как настроить SSH на сервере для увеличения времени сессий
Для устранения рассоединения при отсутствии активности в шелле необходимо настроить SHH сервис на стороне сервера.
Для этого нужно отредактировать файл «/etc/ssh/sshd_config».
Имя фала и его раположение одинаково как во FreeBSD, так и в CentOS.
Далее нам необходимо отредактировать три параметра:
Hello there! You are currently visiting gopherspace through a
proxy. To learn more about gopher and how to browse it, read this.
______________________________________________________________________
###################################################################
Writing C software without the standard library
Linux Edition
###################################################################
There are many tutorials on the web that explain how to build a
simple hello world in C without the libc on AMD64, but most of them
@whistler
whistler / import.sh
Created March 16, 2015 17:31
Copy files to another repository while saving git history
# copied from http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/
git clone <git repository A url> # clone source repository
cd <git repository A directory>
git remote rm origin # to make sure it doesn't affect the original repository
git filter-branch --subdirectory-filter <directory 1> -- --all # remove all files other than the ones needed
mkdir <directory 1> # move them into another directory where they will be stored in the destination repository (if needed)
mv * <directory 1>
git add .
git commit
@davidfowl
davidfowl / dotnetlayout.md
Last active January 30, 2026 02:31
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@guyellis
guyellis / removeMongoField.js
Last active November 30, 2021 23:37
How to remove a field from a collection in MongoDB
// Params:
// 1. query (filter) if you only want to remove this field from some records. {} will select any.
// 2. $unset the field(s) that you want to remove. Here I've set them to null but the value doesn't matter as it's ignored.
// 3. multi must be set to true otherwise it will only operate on the first record that it finds.
//
// Run this command in the MongoDB shell
db.<collectionName>.update( {}, {$unset: {<fieldName1>: null, <fieldName2>: null}}, {multi: true});
@kmcallister
kmcallister / gist:5640703
Created May 24, 2013 01:18
C++ range class
#include <iostream>
template <typename T>
class range {
private:
class iter {
private:
T m_x;
public:
@da9l
da9l / Install-Chocoaltey
Last active February 6, 2017 13:40
Install chocolatey behind proxy with system settings in Internet Explorer.
$wc=new-object net.webclient
$wp=[system.net.WebProxy]::GetDefaultProxy()
$wp.UseDefaultCredentials=$true
$wc.Proxy=$wp
iex ($wc.DownloadString('https://chocolatey.org/install.ps1'))
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs