Skip to content

Instantly share code, notes, and snippets.

View ephrin's full-sized avatar

Volodymyr Myrza ephrin

  • Vinnytsia/Ukraine
View GitHub Profile
@ephrin
ephrin / launch.bat
Created November 12, 2014 18:41
windows launch app per core
start /affinity 1 program.exe
@ephrin
ephrin / vzlist.sh
Created December 2, 2014 07:07
vzlist
[root@prox4 ~]$ vzlist
Unable to open /etc/pve/openvz/171.conf: Transport endpoint is not connected
Unable to open /etc/pve/openvz/185.conf: Transport endpoint is not connected
Unable to open /etc/pve/openvz/190.conf: Transport endpoint is not connected
Unable to open /etc/pve/openvz/191.conf: Transport endpoint is not connected
Unable to open /etc/pve/openvz/192.conf: Transport endpoint is not connected
Unable to open /etc/pve/openvz/193.conf: Transport endpoint is not connected
Unable to open /etc/pve/openvz/194.conf: Transport endpoint is not connected
Unable to open /etc/pve/openvz/195.conf: Transport endpoint is not connected
Unable to open /etc/pve/openvz/196.conf: Transport endpoint is not connected
@ephrin
ephrin / crm.conf
Created December 2, 2014 10:01
crm.conf
server {
listen *:80;
##comment/uncomment##
# server_name crm.hotels24.ua;
# server_name crm.hotels24.stage;
server_name crm.hotels24.dev;
charset utf-8;
root /var/www/admin_hotels24/public;
@ephrin
ephrin / u-docker.sh
Created March 13, 2015 19:07
docker ubuntu
[ -e /usr/lib/apt/methods/https ] || {
apt-get update
apt-get install -y apt-transport-https
}
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sh -c "echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
apt-get update
apt-get install -y --force-yes apparmor lxc-docker
[ -e /usr/lib/apt/methods/https ] || {
apt-get update
apt-get install apt-transport-https
}
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get install -y lxc-docker
@ephrin
ephrin / amps_vs_and.php
Last active August 29, 2015 14:18
[PHP] "&&" vs "and"
<?php
$e = 0;
$a = null;
function justAmps($e, $a){
if($a = 5 && $e + $a){
print "+";
} else {
print "-";
}
@ephrin
ephrin / 53d5a969a4781937098b82cc.json
Last active August 29, 2015 14:20
385662 transaction booking date 2015-05-03 09:56:05.000+03:00
/* 1 */
{
"_id" : ObjectId("55422b88a4781970558b456d"),
"timestamp" : "Thu Apr 30 16:17:59 2015",
"role" : "Partners",
"data" : {
"url" : "/calendar/room/",
"params" : {
"tariff" : "53d5a969a4781937098b82cc",
"data" : {
@ephrin
ephrin / fix_ideapad_mic.sh
Last active August 29, 2015 14:21
Lenovo Ideapad Microphone issue fix
echo $'alias snd-card-0 snd-hda-intel\noptions snd-hda-intel model=auto'| sudo tee --append /etc/modprobe.d/alsa-base.conf > /dev/null
# After reboot make sure that your mic is not muted. To check that run alsamixer in terminal.
@ephrin
ephrin / example.bash
Created May 17, 2015 09:05
valgrind - process memleak
#You can use valgrind to find memory related issues:
#Usage:
valgrind --tool=memcheck program_name #(/sbin/docker or wharever the path to docker is)
valgrind --leak-check=yes program_name
#Example:
valgrind --leak-check=yes /sbin/httpd
#Check for lines containing definitely lost or probably lost to confirm that there is a memory leak.
@ephrin
ephrin / cmd.sh
Created May 25, 2015 06:20
Straight Bash Space Separated Usage `./myscript.sh -e conf -s /etc -l /usr/lib /etc/hosts ` http://linuxgeeks.ru/bash-2.htm
#!/bin/bash
while [[ $# > 1 ]]
do
key="$1"
case $key in
-e|--extension)
EXTENSION="$2"
shift
;;