Skip to content

Instantly share code, notes, and snippets.

@OlliV
OlliV / attencoeff.m
Created February 27, 2012 23:54
Attenuation Coefficient Calculator on Matlab
% -------------------------------------------------------------------------
% | Attenuation Coefficient Calculator |
% | ================================== |
% | Olli Vanhoja |
% | 2010-08-26 |
% -------------------------------------------------------------------------
clear all
close all
close all hidden
clc
@OlliV
OlliV / transcoeff.m
Created February 27, 2012 23:55
Transmission Coefficient Calculator on Matlab
% -------------------------------------------------------------------------
% | Transmission Coefficient Calculator |
% | =================================== |
% | Olli Vanhoja |
% | 2010-08-26 |
% |
% e_r1 e_r2 |
% mu_r1 mu_r2 |
% |
% P_in | tau |
@OlliV
OlliV / skindepth.m
Created February 27, 2012 23:57
Skin Depth Calculator on Matlab
% -------------------------------------------------------------------------
% | Skin Depth Calculator |
% | ===================== |
% | Olli Vanhoja |
% | 2010-08-26 |
% |
% e_r1 e_r2 |
% e_ri1 e_ri2 |
% mu_r1 mu_r2 |
% |
@OlliV
OlliV / disable_OS_X_NotificationCenter.txt
Created July 26, 2012 19:56
Disable that annoying NotificationCenter on OS X Mountain Lion
launchctl unload /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
sudo mv /System/Library/LaunchAgents/com.apple.notificationcenterui.plist /System/Library/LaunchAgents/com.apple.notificationcenterui.bak
@OlliV
OlliV / gist:3186389
Created July 27, 2012 05:48
OS X Mountain Lion: Disable Press and Hold
defaults write -g ApplePressAndHoldEnabled -bool false
reboot
@OlliV
OlliV / emacs.patch
Created April 1, 2014 15:06
Add a new errno: EMACS - Editor too big.
From d8f85b3eeff44c31d21e987a4494ee1f8299322d Mon Sep 17 00:00:00 2001
From: Olli Vanhoja <[email protected]>
Date: Tue, 1 Apr 2014 18:03:56 +0300
Subject: [PATCH] Add a new errno: EMACS - Editor too big.
Make a best-effort to detect that Emacs is about to executed and return the error.
---
fs/exec.c | 13 ++++++++++++-
include/uapi/asm-generic/errno.h | 2 ++
2 files changed, 14 insertions(+), 1 deletion(-)
@OlliV
OlliV / email.ini
Created January 15, 2015 13:52
Sailfish: Disable haptic notification for received emails
#/usr/share/ngfd/events.d/email.ini
[email => play.mode=short]
sound.profile = im_fg.alert.tone@general => sound.filename
sound.stream.event.id = event-in-call
#ffmemless.effect = NGF_SHORT
sound.stream.module-stream-restore.id = x-meego-ringing-volume
mce.led_pattern = PatternCommunicationEmail
#haptic.type = alarm
[email => play.mode=*,context@call_state.mode=active]
@OlliV
OlliV / m0118.Xmodmap
Created January 15, 2015 13:56
xmodmap for Apple M0118
keycode 8 =
keycode 9 = Escape NoSymbol Escape
keycode 10 = 1 exclam 1 exclam NoSymbol exclamdown
keycode 11 = 2 quotedbl 2 quotedbl at rightdoublequotemark at
keycode 12 = 3 numbersign 3 numbersign sterling guillemotright sterling
keycode 13 = 4 currency 4 currency dollar guillemotleft dollar
keycode 14 = 5 percent 5 percent U2030 leftdoublequotemark U2030
keycode 15 = 6 ampersand 6 ampersand singlelowquotemark doublelowquotemark singlelowquotemark
keycode 16 = 7 slash 7 slash braceleft NoSymbol braceleft
keycode 17 = 8 parenleft 8 parenleft bracketleft less bracketleft
@OlliV
OlliV / gist:6deafc2a04e126e7c053
Created July 2, 2015 21:15
doubly linked list
#include <stdio.h>
#include <stddef.h>
#include <stdint.h>
struct node {
int x;
struct node * next;
};
void print(struct node * head)
@OlliV
OlliV / gist:abcfd5879efe1c1ebe5026fd9912c1fc
Created May 8, 2016 16:03
Root shell access with Docker
% groups
docker
% docker run --privileged=true --volume /:/root -it ubuntu sh
# ls root
bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv swapfile sys tmp usr var