This gist aims to facilitate the switching from bash
to zsh
as our defaut shell.
We will be using oh-my-zsh with the powerful theme: Powerlevel9k. You will find all the links below.
This process applies mainly for Arch Linux, but can be setup for any other distro (in theory :)).
I'm also using Gnome Terminal and pacaur as package manager.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qrcode | |
from qrcode.util import * | |
def hack_put(self, num, length): | |
if num == 0: | |
num = 233 # make a fake length | |
for i in range(length): | |
self.put_bit(((num >> (length - i - 1)) & 1) == 1) | |
qrcode.util.BitBuffer.put = hack_put |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a program doing matrix multiplication with gpu, which could be use to test if gpu monitor really works | |
// use nvcc to complile | |
#include <cassert> | |
#include <cstddef> | |
#include <cstdint> | |
#include <iomanip> | |
#include <iostream> | |
#include <random> | |
#include <stdexcept> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"io" | |
"log" | |
"os/exec" | |
"strings" | |
"sync" | |
"time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
stdSQL "database/sql" | |
"encoding/gob" | |
"fmt" | |
"strings" | |
"time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find the appropriate version here http://download.virtualbox.org/virtualbox/ | |
sudo VBOX_VERSION=6.0.4 | |
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | |
sudo rpm -Uvh http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/d/dkms-2.6.1-1.el7.noarch.rpm | |
sudo yum -y install wget perl gcc dkms kernel-devel kernel-headers make bzip2 | |
wget http://download.virtualbox.org/virtualbox/${VBOX_VERSION}/VBoxGuestAdditions_${VBOX_VERSION}.iso | |
sudo mkdir /media/VBoxGuestAdditions |
每个平台的信号定义或许有些不同。下面列出了POSIX中定义的信号。 Linux 使用34-64信号用作实时系统中。 命令man 7 signal提供了官方的信号介绍。
在POSIX.1-1990标准中定义的信号列表
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: nfs-provisioner | |
--- | |
kind: ClusterRole | |
apiVersion: rbac.authorization.k8s.io/v1 | |
metadata: | |
name: nfs-provisioner-runner |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:alpine as builder | |
WORKDIR /app | |
#the following 2 steps are optional if your image does not already have the certificate | |
# package installed, golang:alpine now seems to have it. But a more base image could be missing it. | |
#RUN apk update && apk upgrade && apk add --no-cache ca-certificates | |
#RUN update-ca-certificates | |
ADD main.go /app/main.go | |
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags="-s -w" -installsuffix cgo -o app . | |
FROM scratch |
NewerOlder