Skip to content

Instantly share code, notes, and snippets.

@ikorolev93
ikorolev93 / index.ts
Created March 20, 2018 06:42
Running redux-saga in a web worker
import {theSaga} from "somewhere";
const ctx: Worker = self as any;
const workerIO: RunSagaOptions<Action, undefined> = {
subscribe: cb => {
const listener = (ev: MessageEvent) => cb(ev.data);
ctx.addEventListener("message", listener);
return () => ctx.removeEventListener("message", listener);
},
dispatch: action => ctx.postMessage(action),
@ikorolev93
ikorolev93 / GG-Free.md
Last active October 16, 2016 15:30
GoodGame free premium quality

Инструкция:

  1. Устанавливаем менеджер юзерскриптов (если не установлен).
  1. Нажимаем ссылку для установки скрипта.
  2. Добавляем скрипт.
  3. Обновляем стримы на ГГ, должно разблокироваться премиум-качество.
@ikorolev93
ikorolev93 / run.sh
Created October 30, 2015 01:01
Script for running WC3 (or any fullscreen game, i guess) in separate X
#!/bin/sh
export WINEPREFIX="$(realpath ./wineprefix)" # required to make separate wineserver session
export WINEARCH="win32" # might as well
# X dies when client stops executing
# unfortunately, windows programs tend to fork
# so we tie to wineserver by executing it in foreground,
# then we put it to background manually to run wine and then wait for wineserver to die
exec xinit /bin/sh -c 'wineserver -f & wine w3l.exe -opengl; wait' -- :1
@ikorolev93
ikorolev93 / update.sh
Last active August 29, 2015 14:06
portage squashfs updater (server part)
#!/bin/sh
LOG=$(mktemp)
(
set -e
mkdir -p /home/dnt/portage
cd /home/dnt/portage
wget -N --ignore-length http://mirrors.digitalocean.com/gentoo/snapshots/portage-latest.tar.xz
if [ ! -s portage-latest.tar.xz ]; then exit 0; fi
tar -xJpf portage-latest.tar.xz
mksquashfs portage portage-latest.sqfs -comp xz -force-uid 250 -force-gid 250 -noappend
@ikorolev93
ikorolev93 / gist:7377774
Last active December 27, 2015 19:29
Create zpool
zpool create \
-f \
-R /mnt/gentoo \
-m none \
-o ashift=12 \
-o feature@lz4_compress=enabled \
-O atime=off \
-O canmount=off \
-O compression=lz4 \
-O dedup=off \
@ikorolev93
ikorolev93 / gist:7377710
Created November 8, 2013 21:08
Wiping /dev/sda
echo -n mem > /sys/power/state
hdparm --user-master u --security-set-pass 1 /dev/sda
hdparm --user-master u --security-erase 1 /dev/sda
hdparm -z /dev/sda
@ikorolev93
ikorolev93 / gist:7231942
Last active December 26, 2015 23:39
ZFS slaxbuild
#!/bin/bash
. /usr/share/slax/slaxbuildlib
#
# This is a template build script for Slax.
# Read all the comments in order to understand how to use it.
# Basically you fill in some necessary data and you run it.
#
# If it produces Slax module properly, you may upload it
# to Slax server by using command:
#
@ikorolev93
ikorolev93 / gist:7231931
Last active December 26, 2015 23:39
SPL slaxbuild
#!/bin/bash
. /usr/share/slax/slaxbuildlib
#
# This is a template build script for Slax.
# Read all the comments in order to understand how to use it.
# Basically you fill in some necessary data and you run it.
#
# If it produces Slax module properly, you may upload it
# to Slax server by using command:
#