Skip to content

Instantly share code, notes, and snippets.

@hanvari
hanvari / jupyter_shortcuts.md
Last active April 13, 2018 19:43 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

A Better version:

https://www.cheatography.com/weidadeyue/cheat-sheets/jupyter-notebook/

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

@hanvari
hanvari / README.md
Created March 1, 2018 19:06 — forked from oznu/README.md
How to Bootcamp / Dual Boot Windows 10 on a mid-2011 iMac using USB

How to Install / Bootcamp Windows 10 on a mid-2011 iMac using USB

Apple has released support for bootcamping Windows 10, but only on 2012 Macs and later. Despite not being supported. it is possible to install Windows 10 on earlier iMacs and it seems to run quite well.

IMPORTANT: Unplug all external and physical hard drives (where possible) that you won't be installing to to avoid accidentally erasing them. Also make note of which drives and partitions remain (e.g. System and Storage hard drives), and be super careful to not erase the wrong one.

RECOVERY: If you nuke your machine, restore your time machine backup. Instructions here.

Requirements

@hanvari
hanvari / phonegap-gitignore
Created February 12, 2018 22:55
Phonegap Project .gitignore file
# ANDROID / ECLIPSE
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
@hanvari
hanvari / track_upstream_changes.md
Last active October 4, 2017 20:33
Tracking Upstream changes for scripts with local customizations
  1. Setup:
git clone <repo-url>
git branch -m master vendor
#check configurations
git config --get-regexp 'branch.vendor.*'
#master will contain customizations
git checkout -b master
@hanvari
hanvari / TestSSDPerformance.sh
Last active August 3, 2017 15:20
Benchmarking Disk access performance to detect SSD (or very high-speed HDD)
#reading 1000 random 4k blocks from first 16GB of a disk
time for i in `seq 1 1000`; do
dd bs=4k if=/dev/sda count=1 skip=$(( $RANDOM * 128 )) >/dev/null 2>&1;
done
#References:
# https://unix.stackexchange.com/questions/65595/how-to-know-if-a-disk-is-an-ssd-or-an-hdd
# https://serverfault.com/questions/551453/how-do-i-verify-that-my-hosting-provider-gave-me-ssds/551495#551495
@hanvari
hanvari / macos-heimdall-compile.sh
Created June 6, 2017 09:17
Build Heimdall on MacOS Sierra
git clone git@github.com:Benjamin-Dobell/Heimdall.git
cd Heimdall
mkdir build
cd build
cmake -DDISABLE_FRONTEND=ON -DCMAKE_BUILD_TYPE=Release ..
LIBRARY_PATH=/usr/local/lib make
#References:
#https://raw.githubusercontent.com/Benjamin-Dobell/Heimdall/master/Linux/README
@hanvari
hanvari / git-overwrite-local.md
Created January 27, 2017 16:26
Git overwrite local changes with remote version
git fetch --all
git reset --hard origin/master
git pull origin master
@hanvari
hanvari / sigchld_avoid_zombies.md
Created January 25, 2017 02:05
Avoiding zombie processes by handling SIGCHLD

We could simply set the SIGCHLD signal to be handled by SIG_IGN (ignored), and based on POSIX.1-2001 it will clean up the terminated child process.

struct sigaction sa;
sa.sa_handler = SIG_IGN;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
if (sigaction(SIGCHLD, &sa, 0) == -1) {
  perror(0);
  exit(1);
}
@hanvari
hanvari / hadoop-quick-start.md
Last active January 4, 2017 05:55
Apache Hadoop Quick Start