Skip to content

Instantly share code, notes, and snippets.

View chexov's full-sized avatar

Anton P. Linevich chexov

  • Los Angeles
View GitHub Profile
@chexov
chexov / vmm-alpine.sh
Created December 29, 2018 01:45 — forked from voutilad/vmm-alpine.sh
Installing Alpine Linux in OpenBSD's VMM Hypervisor
# Assuming you're a regular user that has doas allowances for vmctl
mkdir -p ~/vmm
cd ~/vmm
# Grab the the one of the virt iso's of Alpine Linux
curl https://nl.alpinelinux.org/alpine/v3.6/releases/x86_64/alpine-virt-3.6.0-x86_64.iso -o alpine-virt-3.6.0-x86_64.iso
# Make a new virtual disk image, change the size as needed
vmctl create alpine-virt.img -s 6G
@chexov
chexov / Tensorflow_Build_GPU.md
Created December 11, 2017 23:54 — forked from smitshilu/Tensorflow_Build_GPU.md
Tensorflow 1.4 Mac OS High Sierra 10.13 GPU Support

Tensorflow

System information

  • OS - High Sierra 10.13
  • Tensorflow - 1.4
  • Xcode command line tools - 8.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
  • Cmake - 3.7
  • Bazel - 0.7.0
@chexov
chexov / web-servers.md
Created March 17, 2017 09:15 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@chexov
chexov / gist:1cf207a7bdd17ad2ff43
Last active August 29, 2015 14:28 — forked from jedi4ever/gist:903751
Tuning stuff for Ubuntu hosts
# /etc/security/limits.conf
* soft nofile 999999
* hard nofile 999999
root soft nofile 999999
root hard nofile 999999
===========================================================
# /etc/sysctl.conf
# sysctl for maximum tuning
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}

Install OS X 10.10 Yosemite in VirtualBox

(based on this pastebin i've found via Google, markdownified and adjusted to work with the official Yosemite release)

Yosemite's first developer preview was released right after Monday's WWDC opening keynote. For the general public, an open beta will be available to download later this summer. However, for those who want a sneak peek at the new hotness, there is a way to safely install it without risking your machine, using the free and powerful VirtualBox application from Oracle.

(LEGAL DISCLAIMER: This guide aims to explain how to create a virtual machine on a regularly purchased Apple computer, running a genuine Mac OS X operating system, for testing purposes only.)

#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
#!/bin/sh
cd /
umount /pref
echo 3 > /proc/sys/vm/drop_caches
#wifi mode is specified
if [ "${1}" == "ap" ]; then
echo -e "\nPress CTRL+C now if you want to skip hibernation"
echo "killall hostapd"
killall hostapd
import Image, ImageDraw, ImageFont
import clipboard
# Simple script to create SysML frame around the image
# Define non-configurable options here
H_TEXT_OFFSET = 20
V_TEXT_OFFSET = 20
H_CUT_OUT = 20
V_CUT_OUT = 20
@chexov
chexov / mixpanel.error.tracking.js
Created April 5, 2012 17:23
Mixpanel js error tracking
<script>
window.onerror = function(message, file, line) {
var prop = {}
prop.message = message;
prop.file = file;
prop.line = line;
mpq.track('js-err'r,track_properties);
}
</script>