Skip to content

Instantly share code, notes, and snippets.

View d4rkm3z's full-sized avatar
🧭
You gotta keep an open mind

Kirill Sadovnikov d4rkm3z

🧭
You gotta keep an open mind
View GitHub Profile
@d4rkm3z
d4rkm3z / index.js
Last active November 11, 2015 08:21
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var play = require('play-audio');
var parent = document.querySelector('.my-player');
var arrayMusic = [
'http://cs9-15v4.vk.me/p23/d7b5836f0aa2b3.mp3?extra=9smwPXxS36hDfbxbfFboFFe1iG3ET0uObOpeoUpNASVyIbO3vGynqj3b7c-ayq3QydYnM553AjD8sdoIww9b5n_ZO7mfgw&/Unheilig%20-%20Geboren%20Um%20Zu%20Leben.mp3',
'http://cs9-5v4.vk.me/p14/7f439d8e8b2012.mp3?extra=M5W5t54VhEN785zCu7XwwVj8yqj55u66Uj5Ku_r1TZR8tpyzYt1BdEtv97pYfl527mwh4u50MiIjDizXKD5JJ0tovh-vnA&/%D0%A1%D0%BC%D1%8B%D1%81%D0%BB%D0%BE%D0%B2%D1%8B%D0%B5%20%D0%93%D0%B0%D0%BB%D0%BB%D1%8E%D1%86%D0%B8%D0%BD%D0%B0%D1%86%D0%B8%D0%B8%20-%20%D0%94%D0%B5%D0%BC%D0%BE%D0%BD%D1%8B.mp3'
];
arrayMusic.forEach(function(val, key){
@d4rkm3z
d4rkm3z / formInclude.js
Last active January 11, 2016 07:26
megagroup
var massIncludingForms = [{
id: '#formZamer',
path: '/zakazat-zamer'
}];
var formInclude = {
/**
* @description Initialize forms from massIncludingForms for s3.includeForm script
* @author kirill.sadovnikov
* @date 2015-11-27
@d4rkm3z
d4rkm3z / README.md
Created December 29, 2015 13:17 — forked from magnetikonline/README.md
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@d4rkm3z
d4rkm3z / ultimate-ut-cheat-sheet.md
Created October 31, 2016 16:26 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@d4rkm3z
d4rkm3z / setup_proxychains-ng.sh
Created April 8, 2017 19:52 — forked from marcinwol/setup_proxychains-ng.sh
Setup and test proxychains-ng on Ubuntu 14.04
# if you havent done it yet, please download the tor-browser and start it
# https://www.torproject.org/download/download-easy.html.en
wget https://www.torproject.org/dist/torbrowser/5.0/tor-browser-linux64-5.0_en-US.tar.xz
tar xf tor-browser-linux64-5.0_en-US.tar.xz
# download the source of proxychains-ng
git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng
@d4rkm3z
d4rkm3z / selenium
Created June 6, 2017 16:10 — forked from adeubank/selenium
Set up selenium on Ubuntu 16.04 as a service
#!/bin/bash
case "${1:-''}" in
'start')
if test -f /tmp/selenium.pid
then
echo "Selenium is already running."
else
export DISPLAY=localhost:99.0
java -Dwebdriver.gecko.driver="/usr/lib/geckodriver/geckodriver" -jar /usr/lib/selenium/selenium-server-standalone.jar -port 4444 > /var/log/selenium/output.log 2> /var/log/selenium/error.log & echo $! > /tmp/selenium.pid
@d4rkm3z
d4rkm3z / virtualbox-clone-fixed-to-dynamic.md
Created June 22, 2017 17:39 — forked from stormwild/virtualbox-clone-fixed-to-dynamic.md
VirtualBox clone fixed size vm to dynamic, resize dynamic vm, expand partition

http://brainwreckedtech.wordpress.com/2012/01/08/howto-convert-vdis-between-fixed-sized-and-dynamic-in-virtualbox/ http://www.webdesignblog.asia/software/linux-software/resize-virtualbox-disk-image-manipulate-vdi/#comment-474

While there is no way to actually switch a VDI between fixed-size and dynamic, you can clone the existing VDI into a new one with different settings with VBoxManage.

VBoxManage clonehd [old-VDI] [new-VDI] --variant Standard
VBoxManage clonehd [old-VDI] [new-VDI] --variant Fixed

If you want to expand the capacity of a VDI, you can do so with

sudo -s
#Gearman
add-apt-repository ppa:ondrej/pkg-gearman
apt-get install gearman-job-server php-gearman
@d4rkm3z
d4rkm3z / postgres-cheatsheet.md
Created May 31, 2018 10:38 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@d4rkm3z
d4rkm3z / Description.md
Created August 6, 2018 16:49 — forked from juanje/Description.md
Limit Chrome from eating all the memory and CPU

I was tired of Chrome eating all my laptop resources so I decided to put some limit to it with cgroup.

As I was using Ubuntu 12.04 with support for cgroup, I installed the package cgroup-bin and add the following group to the file /etc/cgconfig.conf:

group browsers {
    cpu {
#       Set the relative share of CPU resources equal to 25%
        cpu.shares = "256";
 }