Skip to content

Instantly share code, notes, and snippets.

🖤

Shao Cheng TerrorJack

🖤
Block or report user

Report or block TerrorJack

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View T.hs
{-# LANGUAGE LambdaCase #-}
{-# OPTIONS_GHC -Wall -O2 -threaded -rtsopts "-with-rtsopts=-A64m -n2m -I0 -qg" #-}
module T where
import Control.Concurrent
import Control.Exception
import Control.Monad
import Data.IORef
View baidupcs.Dockerfile
FROM ubuntu:bionic
ARG DEBIAN_FRONTEND=noninteractive
RUN \
apt update && \
apt full-upgrade -y && \
apt install -y \
curl \
desktop-file-utils \
View gc-talk.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<title>A tour into GHC’s garbage collection</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.8.0/css/reveal.css">
@TerrorJack
TerrorJack / git-move-files-in-subfolder.md
Created Dec 31, 2019 — forked from ajaegers/git-move-files-in-subfolder.md
Git: move files in an subfolder keeping history
View git-move-files-in-subfolder.md

Change structure of project folder with Git

I have this structure:

 project-folder/
     .git
     wp-admin/
     wp-content/
     wp-includes/
    .htaccess
@TerrorJack
TerrorJack / arm64.md
Created Dec 11, 2019 — forked from george-hawkins/arm64.md
Running virtualized x86_64 and emulated arm64 Ubuntu cloud images using QEMU
View arm64.md

QEMU arm64 cloud server emulation

This is basically a rehash of an original post on CNXSoft - all credit (particularly for the Virtio device arguments used below) belongs to the author of that piece.

Download the latest uefi1.img image. E.g. ubuntu-16.04-server-cloudimg-arm64-uefi1.img from https://cloud-images.ubuntu.com/releases/16.04/release/

Download the UEFI firmware image QEMU_EFI.fd from https://releases.linaro.org/components/kernel/uefi-linaro/latest/release/qemu64/

Determine your current username and get your current ssh public key:

View jsval-gc.hs
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE UnboxedTuples #-}
{-# OPTIONS_GHC -Wall -O2 #-}
import Data.Foldable
import GHC.Exts
import GHC.Types
import System.Mem
View fetch-node.py
#!/usr/bin/env python3
from io import BytesIO
import json
import os
from sys import argv
import tarfile
from urllib.request import urlopen
View cont.hs
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString as BS
import qualified Data.ByteString.Unsafe as BS
import Data.Char
import Data.Time.Clock.POSIX
import qualified DynFlags as GHC
import Foreign
import qualified GHC
import GHC.ForeignPtr
View v8-options.txt
SSE3=1 SSSE3=1 SSE4_1=1 SSE4_2=1 SAHF=1 AVX=1 FMA3=1 BMI1=1 BMI2=1 LZCNT=1 POPCNT=1 ATOM=0
Synopsis:
shell [options] [--shell] [<file>...]
d8 [options] [-e <string>] [--shell] [[--module] <file>...]
-e execute a string in V8
--shell run an interactive JavaScript shell
--module execute a file as a JavaScript module
Note: the --module option is implicitly enabled for *.mjs files.
@TerrorJack
TerrorJack / haproxy.cfg
Created Oct 3, 2019 — forked from cmer/haproxy.cfg
Simple, no bullshit TCP port forwarding using HAProxy
View haproxy.cfg
listen l1
bind 0.0.0.0:443
mode tcp
timeout connect 4000
timeout client 180000
timeout server 180000
server srv1 host.example.com:9443
You can’t perform that action at this time.