Skip to content

Instantly share code, notes, and snippets.

View lilianmoraru's full-sized avatar

Lilian Anatolie Moraru lilianmoraru

View GitHub Profile
lilianmoraru /
Created August 12, 2021 08:08 — forked from typebrook/
[Github-release] A script manages release note or its asset with GitHub API v3 #github #release #curl #asset
#!/usr/bin/env sh
# Author: Hsieh Chin Fan (typebrook) <>
# License: MIT
# Originally created by stefanbuck
# fork from:
# --
lilianmoraru /
Created May 22, 2019 20:00 — forked from dojoe/
Make DKMS sign kernel modules on installation, with full script support and somewhat distro independent

On systems with UEFI Secure Boot enabled, recent Linux kernels will only load signed modules, so it's about time DKMS grew the capability to sign modules it's building.

These scripts are extended and scriptified variants of and and add some error checking, a passphrase around your signing key, and support for compressed modules.

dkms-sign-module is a wrapper for the more generic sign-modules which can also be used outside of DKMS.


  1. Create a directory under /root, say /root/module-signing, put the three scripts below in there and make them executable: chmod u+x one-time-setup sign-modules dkms-sign-module
lilianmoraru / update_linux.bash
Last active March 3, 2019 11:37
pop_os self-compiling the Linux Kernel and installing inside EFI(also installs as backup the distro-provided kernel)
#! /bin/bash
set -euo pipefail
sudo update-alternatives --auto gcc
CFLAGS="-O3 -DNDEBUG -D_GNU_SOURCE -fomit-frame-pointer -fno-asynchronous-unwind-tables -ftree-vectorize -floop-strip-mine -floop-block -fgraphite-identity -m64 -mavx -march=native -mtune=native"
CXXFLAGS="-O3 -DNDEBUG -D_GNU_SOURCE -fomit-frame-pointer -fno-asynchronous-unwind-tables -ftree-vectorize -floop-strip-mine -floop-block -fgraphite-identity -m64 -mavx -march=native -mtune=native"
lilianmoraru / UpdateLLVM.bash
Last active April 5, 2018 08:01
Build locally your own optimized version of LLVM/Clang
#! /bin/bash
source_dir="" # Define this, example(this usually should be the device with the fastest Read perf): ${HOME:?}/git/llvm
build_dir="" # Define this, example(preferably a different device which can be slower): /ssd/llvm-build
install_prefix="" # Define this, example: /usr/local/llvm
update_project() {
local -r dir="${1:?}"
local -r branch="${2:?}"

Looking into the Future

futures-rs is the library which will hopefully become a shared foundation for everything async in Rust. However it's already become renowned for having a steep learning curve, even for experienced Rustaceans.

I think one of the best ways to get comfortable with using a library is to look at how it works internally: often API design can seem bizarre or impenetrable and it's only when you put yourself in the shoes of the library author that you can really understand why it was designed that way.

In this post I'll try to put down on "paper" my understanding of how futures work and I'll aim to do it in a visual way. I'm going to assume you're already somewhat familiar with Rust and why futures are a useful tool to have at one's disposal.

For most of this post I'll be talking about how things work today (as of September 2017). At the end I'll touch on what's being proposed next and also make a case for some of the changes I'd like to see.

If you're interested in learning more ab


You'll need to have a system running that is accessible through a DNS record. It should have access to the public Habitat depot, so it can download the required packages.

You'll need to register an OAuth application for GitHub. You need the client ID and client secret that are created for the application later in this guide. Your system needs to have access to so that it can authenticate.

Your system also needs to have an FQDN that can be resolved, for example This will be used in your OAuth application's "Authorization Callback URL." For this example, use The /#/sign-in is required.

Operating System

Dynamic section at offset 0x655d48 contains 38 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: []
0x0000000000000001 (NEEDED) Shared library: []
0x0000000000000001 (NEEDED) Shared library: []
0x0000000000000001 (NEEDED) Shared library: []
0x0000000000000001 (NEEDED) Shared library: []
0x0000000000000001 (NEEDED) Shared library: []
0x0000000000000001 (NEEDED) Shared library: []
0x0000000000000001 (NEEDED) Shared library: [] => (0x00007ffcf2f6d000) => /hab/pkgs/core/readline/6.3.8/20160729192706/lib/ (0x00007fe3a4584000) => /hab/pkgs/core/zlib/1.2.8/20160612064520/lib/ (0x00007fe3a4369000) => /hab/pkgs/core/glibc/2.22/20160612063629/lib/ (0x00007fe3a4165000) => /hab/pkgs/core/ncurses/6.0/20160612075116/lib/ (0x00007fe3a3f27000) => /hab/pkgs/core/glibc/2.22/20160612063629/lib/ (0x00007fe3a3c29000) => /hab/pkgs/core/guile/2.0.12/20160729224832/lib/ (0x00007fe3a383b000) => not found => /hab/pkgs/core/glibc/2.22/20160612063629/lib/ (0x00007fe3a3601000) => /hab/pkgs/core/glibc/2.22/20160612063629/lib/ (0x00007fe3a33fe000)
- !Ubuntu trusty
- !UbuntuUniverse
- !Env
HOME: /root
- !Install [git, ca-certificates, curl, gcc, g++, cmake,
build-essential, autoconf2.13, libcap-dev,
#! /bin/sh
## Warning: Please don't source this script from within' another script(note the use of "exit")
throw_error() {
if [ ! -z "$1" ]; then
printf "${red_color}$1${no_color}\n"