Skip to content

Instantly share code, notes, and snippets.

View moredure's full-sized avatar

Mykhailo Faraponov moredure

View GitHub Profile
@moredure
moredure / crosstab.js
Last active April 28, 2020 13:29
Authentication Across tabs with VueJs and Vuex plugin
import router from '@/router'
const userKey = 'user'
const refreshAction = 'sessions/refresh'
const logoutAction = 'sessions/logout'
const updateMutations = [
'sessions/LOGIN',
'sessions/LOGOUT',
'sessions/SIGNUP'
]
@moredure
moredure / README libvirt cloud-init with static networking.md
Created March 1, 2018 22:15 — forked from itzg/README libvirt cloud-init with static networking.md
Configuring a libvirt domain with a static IP address via cloud-init local datasource

Here is how to create a cloud-init disk image and OS disk image suitable for configuring into a libvirt domain file.

In my case I am naming my domain (a.k.a. virtual machine or VM) xenial with a static IP address of 192.168.0.101. The filenames "network-config" and "user-data" files are arbitrary, so they can be named with a prefix for the domain, etc.

First, get the cloud image and convert into QCOW2 format:

qemu-img convert -O qcow2 xenial-server-cloudimg-amd64-disk1.img xenial-server-cloudimg-amd64-disk1.qcow2
@moredure
moredure / PBQvsThreadPool.java
Created February 13, 2018 22:40 — forked from coderplay/PBQvsThreadPool.java
Using PriorityBlockingQueue in thread pool
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.RunnableFuture;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@moredure
moredure / raftmodule.go
Created February 2, 2018 11:24 — forked from nipuntalukdar/raftmodule.go
Bare bone example showing raft protocol using hashicorp raft library
package main
import (
"fmt"
"github.com/hashicorp/raft"
"github.com/hashicorp/raft-boltdb"
"io"
"os"
"time"
)
@itzg
itzg / README libvirt cloud-init with static networking.md
Last active March 21, 2026 13:18
Configuring a libvirt domain with a static IP address via cloud-init local datasource

Here is how to create a cloud-init disk image and OS disk image suitable for configuring into a libvirt domain file.

In my case I am naming my domain (a.k.a. virtual machine or VM) xenial with a static IP address of 192.168.0.101. The filenames "network-config" and "user-data" files are arbitrary, so they can be named with a prefix for the domain, etc.

First, get the cloud image and convert into QCOW2 format:

qemu-img convert -O qcow2 xenial-server-cloudimg-amd64-disk1.img xenial-server-cloudimg-amd64-disk1.qcow2
@Wack0
Wack0 / upwned247.php
Last active December 13, 2023 08:16
UCam247/Phylink/Titathink/YCam/Anbash/Trivision/Netvision/others IoT webcams : remote code exec: reverse shell PoC. (works only in qemu usermode)
<?php
/*
Updated version, 2016-12-02: fixed shellcode so it *actually* works on QEMU
usermode emulation (seems I pushed an old version), and removed debug output.
-------------------------
NB: THIS PoC ONLY WORKS IN QEMU USERMODE EMULATION!
If anyone wants to fix this, go ahead (no pun intended).
However, I don't have a vulnerable product and am unwilling to acquire one.
@nipuntalukdar
nipuntalukdar / raftmodule.go
Created June 15, 2016 10:59
Bare bone example showing raft protocol using hashicorp raft library
package main
import (
"fmt"
"github.com/hashicorp/raft"
"github.com/hashicorp/raft-boltdb"
"io"
"os"
"time"
)
@olegslavkin
olegslavkin / ovs.sh
Last active June 20, 2022 12:08
Install Openvswitch from source (Ubuntu 14.04.3 Server)
!#/bin/bash
# Install openvswitch Ubuntu 14.04.3
# Author: Oleg Slavkin (oleg@slavkin.info)
echo "-------------------------------"
echo "Step 1. Install git package"
echo "-------------------------------"
sudo apt-get update
sudo apt-get -y install git
@whiteinge
whiteinge / index.js
Last active September 19, 2017 03:50
POC Node HTTP server for server-sent-events using RxJS
/**
Proof-of-concept server-sent events HTTP server using Node.js and RxJS
Open http://localhost:8000 in a browser and view the console.
**/
var http = require('http'),
https = require('https');
var Rx = require('rx');
@zxbodya
zxbodya / render-react-with-rxjs.md
Last active November 1, 2021 08:49
React with RxJS, reactive way :)

Observable React elements with RxJS

Note: if you want to skip history behind this, and just looking for final result see: rx-react-container

When I just started using RxJS with React, I was subscribing to observables in componentDidMount and disposing subscriptions at componentWillUnmount.

But, soon I realised that it is not fun to do all that subscriptions(that are just updating property in component state) manually, and written mixin for this...

Later I have rewritten it as "high order component" and added possibility to pass also obsarvers that will receive events from component.