Skip to content

Instantly share code, notes, and snippets.

View pshirshov's full-sized avatar
😹

Paul S. pshirshov

😹
View GitHub Profile
@pshirshov
pshirshov / modules_load
Created June 3, 2018 20:04
Old genkernel customization
# Module groups for genkernel initramfs auto-loading
# RAID
MODULES_ATARAID=""
#MODULES_DMRAID="dm-mod dm-mirror dm-crypt"
MODULES_DMRAID=""
MODULES_LVM=""
#MODULES_MDADM="dm-mod dm-snapshot dm-mirror dm-crypt dm-bbr raid0 raid1 raid456 raid5 raid6 raid10"
MODULES_MDADM=""
@pshirshov
pshirshov / lvm_shrink.md
Last active June 2, 2018 23:17
LVM: shrink volume

Copy partition table:

sfdisk -d /dev/sda > part_table
sfdisk /dev/sda < part_table

Copy boot partition

dd if=/dev/sda1 of=/dev/sdb1 bs=50M
@pshirshov
pshirshov / tutorial.md
Created June 1, 2018 08:51 — forked from Hengjie/tutorial.md
How to passthrough SATA drives directly on VMWare ESXI 6.5 as RDMs

How to passthrough SATA drives directly on VMWare EXSI 6.5 as RDMs

There aren't many tutorials about this, the only tutorials I've found were about passing through entire PCIe cards to VMs, or refered to old ESXI versions (below 6.5) that used a more comprehensive desktop client instead of the web app. In v6.5, the web app was introduced and the desktop client was deprecated. You used to be able to setup RDMs in the desktop client, but with the introduction of the web console, this is no longer the case. This tutorial shows you how to pass SATA HDDs to the virtual machine on VMWare ESXI 6.5. This tutorial is partially based on VMWare's own KB and the now deprecated Forza IT blog post.

Summary

We attach the SATA HDDs as a RDM (Raw Device Mapper) into an existing virtual disk in the command line, then on the web app

@pshirshov
pshirshov / nixos_openldap_radius.md
Last active October 10, 2024 12:24
FreeRadius, OpenLDAP and Samba on NixOS howto
  1. Install NixOS
  2. Add required packages

In /etc/nixos edit configuration.nix

  imports =
    [  # ...
      ./ldapserver.nix
    ];
@pshirshov
pshirshov / services.scala
Last active April 4, 2018 23:17
IDL: services model
package com.github.pshirshov.izumi.idealingua.runtime.services
import scala.concurrent.{ExecutionContext, Future}
import scala.util.Try
import scala.language.{higherKinds, implicitConversions}
//--------------------------------------------------------------------------
// Runtime: unopinionated part
trait ServiceResult[R[_]] {
@pshirshov
pshirshov / GenericCirce.scala
Created March 16, 2018 16:52
Circe with generic types
import io.circe._
import io.circe.parser._
import io.circe.syntax._
import io.circe.generic.decoding._
import io.circe.generic.encoding._
import io.circe.generic.semiauto._
case class GenericModel[Payload](payload: Payload, value: String)
case class TestPayload()
@pshirshov
pshirshov / CatsAbstractMonadicResult.scala
Created March 14, 2018 16:28
A simple example explaning how to abstract on result container moand type
import cats._
import cats.implicits._
trait Service[R[_]] {
type Result[T] = R[T]
def computeValue(): Result[Int]
}
class ServiceImpl[R[_] : Monad : Foldable]
@pshirshov
pshirshov / Pipeline.scala
Last active March 12, 2018 14:27
A dirty example of monadic value processing pipeline
import cats.Foldable
import shapeless.ops.product._
import shapeless.ops.tuple._
import cats._
import cats.implicits._
trait Pipeline[+A] {
@inline def map[B](f: A => B): Pipeline[B]
@inline def flatMap[B](f: A => Pipeline[B]): Pipeline[B]
@pshirshov
pshirshov / PolymorphicCirce.scala
Created March 3, 2018 00:39
circe with polymorphism
import OT.{OT1, OT2}
import _root_.io.circe._
import _root_.io.circe.generic.semiauto._
import _root_.io.circe.syntax._
import io.circe.parser._
//import _root_.io.circe.java8.time._
decode[List[Int]](List(123, 456).asJson.noSpaces)
sealed trait ST
-server
-ea
-noverify
-Xms1024m
-Xmx2048m
-XX:+UseG1GC
-XX:-UseParNewGC
-XX:-UseConcMarkSweepGC
-XX:ReservedCodeCacheSize=240m
-XX:+OmitStackTraceInFastThrow