Skip to content

Instantly share code, notes, and snippets.

Dmitry Prokhorov dipspb

View GitHub Profile
@dipspb
dipspb / redis_key_sizes.sh
Created Mar 7, 2018 — forked from epicserve/redis_key_sizes.sh
A simple script to print the size of all your Redis keys.
View redis_key_sizes.sh
#!/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"; } '
}
View Mayavi 3D in Jupyter Notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dipspb
dipspb / new_stacked_rnns.py
Created Oct 2, 2017 — forked from fchollet/new_stacked_rnns.py
New stacked RNNs in Keras
View new_stacked_rnns.py
import keras
import numpy as np
timesteps = 60
input_dim = 64
samples = 10000
batch_size = 128
output_dim = 64
# Test data.
@dipspb
dipspb / ARMDebianUbuntu.md
Created Jan 17, 2017 — forked from Liryna/ARMDebianUbuntu.md
Emulating ARM on Debian/Ubuntu
View ARMDebianUbuntu.md

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

@dipspb
dipspb / build-log.txt
Created Dec 7, 2016
ArduPilot waf build failure inside of vagrant vm
View build-log.txt
Dmitriys-MBP:ardupilot dipspb$ vagrant up
.
.
.
Dmitriys-MBP:ardupilot dipspb$ vagrant rsync
Dmitriys-MBP:ardupilot dipspb$ vagrant ssh
Welcome to Ubuntu 16.10 (GNU/Linux 4.8.0-26-generic i686)
* Documentation: https://help.ubuntu.com
@dipspb
dipspb / x_domain_session_wrapper.rb
Created May 24, 2011
vendor/rhosync/lib/x_domain_session_wrapper.rb
View x_domain_session_wrapper.rb
require "cgi"
class XDomainSessionWrapper
def initialize(app, opts={})
@app = app
@session_cookie = opts[:session_cookie] || 'rhosync_session'
yield self if block_given?
end
def is_sync_protocol(env)
@dipspb
dipspb / sencha-reverseAnimation-howto.js
Created Apr 12, 2011
How to produce reverse animation instance in SenchaTouch
View sencha-reverseAnimation-howto.js
function reverse(animation) {
var a = ('string' == typeof animation) ? Ext.anims[animation] : animation;
if (!a) return animation;
function BackAnimation(){}
BackAnimation.prototype = a;
var ba = new BackAnimation();
ba.config = Ext.apply({}, {reverse: true}, a.config);
return ba;
You can’t perform that action at this time.