Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# http://www.nongnu.org/avr-libc/user-manual/install_tools.html
# For optimum compile time this should generally be set to the number of CPU cores your machine has
JOBCOUNT=4
# Build Linux toolchain
# A Linux AVR-GCC toolchain is required to build a Windows toolchain
# If the Linux toolchain has already been built then you can set this to 0
@yukkeorg
yukkeorg / how-to-upgrade-nvmw-ssd-firmware-on-linux.md
Created February 20, 2019 14:18 — forked from klingtnet/how-to-upgrade-nvmw-ssd-firmware-on-linux.md
How to upgrade [Lenovo] NVMe SSD firmware on Linux

The instructions were tested on a Lenovo X1 Carbon 5th Gen (X1C5) on Arch Linux but should be applicable to other Lenovo models and Linux distributions.

BACKUP YOUR DATA! I created a bootable Ubuntu Image like this:

$ sudo sh -c 'curl --location --silent --fail "http://releases.ubuntu.com/18.04/ubuntu-18.04.1-desktop-amd64.iso" | pv > /dev/<your-usb-drive>'
# note that pv is only there to show progress, it is perfectly fine to redirect curl to the usb drive directly.

then I booted from this drive by pressing F12 on reboot and dumped my NVMe disk to an external hard drive like this:

@yukkeorg
yukkeorg / mm_slab_setup_bug_fix_on_4.7.x.patch
Last active October 29, 2016 22:05
Fix genarate thousand kworker on Linux Kernel 4.7
# Re: [Bug 172981] New: [bisected] SLAB: extreme load averages and over 2000 kworker threads
# Joonsoo Kim
# http://www.spinics.net/lists/linux-mm/msg114252.html
# Usage
# cd linux-X.X.X
# patch -p1 < this.patch
diff --git a/mm/slab.c b/mm/slab.c
index cc8bbc1..be4c7fa 100644
@yukkeorg
yukkeorg / kernel_build_on_debian_gcc-6.patch
Last active November 6, 2016 01:25
Patch for Building Linux kernel 4.8.5 with gcc-6 6.2.0(Enabled PIE default) on Debian
diff --git a/Makefile b/Makefile
index b249529..ae6fa4b 100644
--- a/Makefile
+++ b/Makefile
@@ -399,9 +399,9 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common \
-Werror-implicit-function-declaration \
-Wno-format-security \
- -std=gnu89
+ -std=gnu89 -fno-PIE
@yukkeorg
yukkeorg / pygobject-install.md
Last active August 29, 2015 14:09
pyenv環境にpycairoとpygobjectをソースからインストールする

事前準備

  • pycairoとpygobjectを構築する為に必要な開発パッケージをインストールする
  • pyenvでインストール先のPythonバージョンを指定する
pyenv shell 3.4.2
/*
* V4L2 video capture example
*
* This program can be used and distributed without restrictions.
*
* This program is provided with the V4L2 API
* see http://linuxtv.org/docs.php for more information
*/
#include <stdio.h>