Skip to content

Instantly share code, notes, and snippets.

View mistical2008's full-sized avatar

Evgeniy Talko mistical2008

  • Russia
View GitHub Profile
@mistical2008
mistical2008 / arch_gpu_passthrough.MD
Created April 14, 2018 19:40
Arch GPU passthrough

Install rpmextract

sudo pacman -Suy rpmextract

Get lates edk2.git-ovmf-x64

wget https://www.kraxel.org/repos/jenkins/edk2/edk2.git-ovmf-x64-XXXXXX.noarch.rpm
@mistical2008
mistical2008 / installing_virt_manager.md
Last active March 21, 2021 10:28 — forked from diffficult/installing_virt_manager.md
Easy instructions to get virt-manager qemuv/kvm running on Arch

[Easy instructions to get QEMU/KVM and virt-manager up and running on Arch] #linux #kvm #qemu

Easy instructions to get QEMU/KVM and virt-manager up and running on Arch

  1. Make sure your cpu support kvm with below command:

     grep -E "(vmx|svm)" --color=always /proc/cpuinfo
    
  2. Make sure BIOS have enable “Virtualization Technology”.

  3. User access to /dev/kvm so add your account into kvm(78) group:

@mistical2008
mistical2008 / .bash_aliases
Created April 27, 2018 12:46 — forked from Rhernandez513/.bash_aliases
bashrc, bash_aliases, inputrc
# Directory navigation aliases
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias back='cd $OLDPWD'
#misc aliases
alias open='gnome-open'
alias grep='grep -n'
@mistical2008
mistical2008 / control-apache-memcached-linux.md
Created May 26, 2018 07:27 — forked from umidjons/control-apache-memcached-linux.md
Start/stop/restart apache and memcached services in linux

Restart apache

/usr/local/apache2/bin/apachectl start
/usr/local/apache2/bin/apachectl stop
/usr/local/apache2/bin/apachectl restart

Restart memcached

@mistical2008
mistical2008 / uniq.js
Created June 8, 2018 08:18 — forked from telekosmos/uniq.js
Remove duplicates from js array (ES5/ES6)
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
});
};
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
});
@mistical2008
mistical2008 / 01-knuth-shuffle.js
Created June 8, 2018 08:39 — forked from piotrlewandowski/01-knuth-shuffle.js
JS array shuffle algorithms
/**
* Using the Fisher-Yates (aka Knuth) Shuffle.
*/
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex ;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
@mistical2008
mistical2008 / random.js
Created June 9, 2018 15:08 — forked from kerimdzhanov/random.js
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
// root.tsx
import { getUserSession, requireUser, logout } from "~/session";
export function loader({ request }) {
// use case: know if the user is logged in, no redirect to /login
let userSession = await getUserSession(request);
let isAuthenticated = userSession.has("userId");
return { isAuthenticated };
}
import { createCookieSessionStorage } from "remix";
let { getSession, commitSession, destroySession } = createCookieSessionStorage({
cookie: {
name: "__session",
secrets: ["r3m1xr0ck5"]
}
});
export { getSession, commitSession, destroySession };