Skip to content

Instantly share code, notes, and snippets.

@alexandrnikitin
alexandrnikitin / 1create.sh
Last active April 16, 2022 13:39
How to launch Colab on a GCE spot instance
gcloud beta compute instances create colab-1-vm \
--machine-type=e2-highmem-4 \
--provisioning-model=SPOT \
--boot-disk-size=200GB \
--boot-disk-type=pd-balanced \
--instance-termination-action=DELETE \
--image=https://www.googleapis.com/compute/v1/projects/colab-marketplace-image-public/global/images/colab-mp-20220110 \
--network=https://www.googleapis.com/compute/v1/projects/<INSERT_PROJECT_ID>/global/networks/default \
--subnet=https://www.googleapis.com/compute/v1/projects/<INSERT_PROJECT_ID>/regions/<INSERT_REGION>/subnetworks/default \
--no-restart-on-failure \
@alexandrnikitin
alexandrnikitin / ergodox.sh
Created December 19, 2018 05:27
Ergodox keyboard layout
sudo apt-get install gcc-avr avr-libc
git clone https://github.com/qmk/qmk_firmware.git
cd qmk_firmware/
make ergodox_ez:default
@alexandrnikitin
alexandrnikitin / flamegraphs.sh
Last active October 2, 2018 11:33
HOWTO: Create FlameGraphs for java
yum install git perf cmake gcc gcc-c++
# generates method mappings
cd ~
git clone https://github.com/jrudolph/perf-map-agent.git
cd perf-map-agent/
export JAVA_HOME=/opt/jdk1.8.0_91
cmake .
make
C:\projects\my\bloom-filter-scala>sbt "project tests" "testOnly *UnsafeBitArraysSpec"
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading global plugins from C:\Users\a.nikitin.ADFORM\.sbt\0.13\plugins
[info] Loading project definition from C:\projects\my\bloom-filter-scala\project
[info] Set current project to bloom-filter-root (in build file:/C:/projects/my/bloom-filter-scala/)
[info] Set current project to tests (in build file:/C:/projects/my/bloom-filter-scala/)
[warn] javaOptions will be ignored, fork is set to false
[info] + UnsafeBitArray.|: OK, passed 100 tests.
[info] Elapsed time: 57.069 sec
#
@alexandrnikitin
alexandrnikitin / Install latest kernel on CentOS 7.sh
Created March 30, 2018 09:53
Install latest kernel on CentOS 7
sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
sudo yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
sudo yum --enablerepo=elrepo-kernel install kernel-ml
awk -F\' /^menuentry/{print\$2} /etc/grub2-efi.cfg
sudo grub2-set-default 0
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
shutdown -r now
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package com;
import org.junit.Ignore;
import org.junit.Test;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.infra.Blackhole;
import org.openjdk.jmh.profile.GCProfiler;
@alexandrnikitin
alexandrnikitin / Makefile.docker
Created November 2, 2017 15:00
Makefile for Dockerfile
NS = docker.repo.com
REPO = image/name
VERSION ?= v0.1.0
NAME = dsp-pricing-data-distribution-build
INSTANCE = default
.PHONY: build push shell run start stop rm tag_latest release
build:
; Assembly listing for method _1020.MethodBelow:RaiseValue(double):this
; Emitting BLENDED_CODE for generic X86 CPU
; optimized code
; ebp based frame
; partially interruptible
; Final local variable assignments
;
; V00 this [V00,T00] ( 6, 6 ) ref -> ecx this class-hnd
; V01 arg1 [V01,T04] ( 2, 2 ) double -> mm0
; V02 tmp0 [V02,T01] ( 4, 8 ) double -> mm2
@alexandrnikitin
alexandrnikitin / Disable CPU power saving on CentOS 7.sh
Last active May 20, 2021 03:20
Disable CPU power saving on CentOS 7
# disable power saving on CentOS 7
grep -E '^model name|^cpu MHz' /proc/cpuinfo
pgrep -lf ondemand
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do [ -f $CPUFREQ ] || continue; echo -n performance > $CPUFREQ; done
service cpuspeed stop
lsmod | grep ondemand
grep -E '^model name|^cpu MHz' /proc/cpuinfo