Skip to content

Instantly share code, notes, and snippets.

View dergachev's full-sized avatar

Alex Dergachev dergachev

View GitHub Profile
# Copied from http://ttaportal.org/wp-content/uploads/2012/10/7-Reallocation-using-LVM.pdf
##
## Showing the problem: need to reallocate 32GB from /dev/mapper/pve-data to /dev/mapper/pve-root
##
df -h
# Filesystem Size Used Avail Use% Mounted on
# /dev/mapper/pve-root 37G 37G 0 100% /
# tmpfs 2.0G 0 2.0G 0% /lib/init/rw
//
// proof of concept for how to write a chrome extension that makes the forward button always active
// hopefully can intelligently detect what to do (eg numeric URL? presence of pager?)
//
history.pushState({'forward':1}, "GO-NEXT", "/");
window.history.go(-1);
window.onpopstate = function(event) {
if(event.state && event.state.forward) {
console.log("location: " + document.location + ", state: " + JSON.stringify(event.state));
@dergachev
dergachev / _highlight_quotes_bookmarklet.md
Last active May 25, 2017 05:43
Highlight Quotes Bookmarklet
time sleep 1
# real 0m1.001s
# user 0m0.000s
# sys 0m0.001s
##
## What if I only care about the real time? Grepping fails?!
##
@dergachev
dergachev / Vagrantfile
Last active March 12, 2016 19:29
Berkshelf gem require slow - Vagrantfile
if ENV['PROFILE_REQUIRE']
require 'benchmark'
module Kernel
# make an alias of the original require
alias_method :original_require, :require
# rewrite require
def require name
time = (Benchmark.realtime { original_require name } * 1000).round
if time > 50

Cached version of http://unix-heaven.org/proxmox-ve-kvm-template

How to create a KVM template in Proxmox VE

Wed, 10/31/2012 - 19:01 — dnaeon

Probably this is something that most people working with Proxmox VE have stumbled upon.

In Proxmox VE you can only use (at least for now) OpenVZ templates. If you are intrested in running Proxmox VE with KVM (as I was), then you will be surprised that the only supported templates are for OpenVZ.

@dergachev
dergachev / _wedding_photo_picks.md
Last active December 22, 2015 22:39
WeddingPhotoPicks: instructions for exporting a subset of photos from Lightroom

Here are the instructions to filter out just the photos we picked.

I'm attaching a file alex_suzanne_picks.lrsmcol that defines a LightRoom Smart Collection Settings that filters out just the photos we want. This file is identical to the following, but includes all the photos:

s = {
  id = "D7B14054-AE5E-4FC8-8E16-FC0EAA9B9581",
  internalName = "Alex_Suzanne_Picks,
  title = "Alex_Suzanne_Picks",
 type = "LibrarySmartCollection",
@dergachev
dergachev / _increase_swap.md
Created September 12, 2013 17:53
Increase swap on Ubuntu

My Vagrant Ubuntu VM just died while running a memory intensive command.

Its output just says "Killed".

vim /var/log/syslog confirms that the machine ran out swap and the process was killed.

free -m shows we have 768M (or so) swap space.

sudo swapon -s shows that we have a single swap partition at /dev/mapper/precise64-swap_1

@dergachev
dergachev / backup-services.md
Last active October 12, 2023 06:14
Results of my backup services research

backup services research

I googled around, especially with site:news.ycombinator.com for backup recommendations. Here are notes on the top hits.

tarsnap

http://www.tarsnap.com/

  • by prolific HN member; focus on encryption and deduplication