Skip to content

Instantly share code, notes, and snippets.

View unkcpz's full-sized avatar
🎯
Focusing

Jusong Yu unkcpz

🎯
Focusing
View GitHub Profile
@unkcpz
unkcpz / flake.nix
Created July 17, 2025 18:47
nix rust compiling aarch64
{
# build in this way @johan
# cargo build --target aarch64-unknown-linux-gnu
description = "Rust cross-compilation example with flakes";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
@unkcpz
unkcpz / r.wf
Created March 9, 2025 19:09
prototype workflow language syntax which support control flow and para
// lex the workflow language
// In rust it can use macro to define.
// here is more for a generic DSL defined from scratch with a concret specification.
// The input has raw format with also the ShellProcess definition in it.
// simple seq operation
// wf foobar(input: I) -> OB {
// proc proc_a = AProcess[I -> OA]
// proc proc_b = BProcess[OA -> OB]
//
@unkcpz
unkcpz / arch_linux_installation_guide.md
Created October 9, 2024 01:19 — forked from mjkstra/arch_linux_installation_guide.md
A modern, updated installation guide for Arch Linux with BTRFS on an UEFI system
<UPF version="2.0.1">
<PP_INFO>
Generated using Vanderbilt code, version 7 3 6
Author: kfg Generation date: 31 3 15
Automatically converted from original format
1 The Pseudo was generated with a Scalar-Relativistic Calculation
2.23000000000E+00 Local Potential cutoff radius
nl pn l occ Rcut Rcut US E pseu
4P 4 1 6.00 0.00000000000 1.53000000000 -4.15068716400
4D 4 2 9.50 0.00000000000 1.63000000000 -0.66209811300
@unkcpz
unkcpz / aiida-with-pg-rmq-containers.md
Created December 2, 2021 12:57 — forked from ltalirz/aiida-with-pg-rmq-containers.md
AiiDA production setup with containerized Postgresql & Rabbitmq

Why?

As of May 4th, 2021, erlang is not available from macports for the ARM (Apple Silicon) platform. Docker containers make it super easy to install postgresql and rabbitmq.

The M1 chips have great parallelism, so I'd hope to be able to run docker without noticing the overhead too much. I could use conda as well, but docker provides the neat docker-compose.yaml that makes it possible to start up and shut down all the services required with a single command.

Task

@unkcpz
unkcpz / test-leak-daemon.py
Created December 25, 2020 11:59
script which reproduce the memory leak issue
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# #
# The code is hosted on GitHub at https://github.com/aiidateam/aiida-core #
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=no-name-in-module
@unkcpz
unkcpz / patch.diff
Last active August 20, 2020 09:49
This is the diff patch of Dockerfile of aiidalab depoly in China domestic
diff --git a/Dockerfile b/Dockerfile
index 433c334..fcb1d09 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -38,12 +38,17 @@ RUN /usr/bin/pip3 install \
# TODO, remove when https://github.com/aiidateam/aiida-sssp/pull/25 is merged
# and installed on AiiDA lab
WORKDIR /opt/pseudos
-RUN base_url=http://legacy-archive.materialscloud.org/file/2018.0001/v3; \
-wget ${base_url}/SSSP_efficiency_pseudos.aiida; \
@unkcpz
unkcpz / process_run.py
Created May 7, 2020 08:30
In the context of asyncio, which way is better in running the process and interacting with it.
@pytest.mark.asyncio
async def test_wait_pause_play_resume():
"""
Test that if you pause a process that and its awaitable finishes that it
completes correctly when played again.
"""
proc = utils.WaitForSignalProcess()
asyncio.ensure_future(proc.step_until_terminated())
await utils.run_until_waiting(proc)
import numpy as np
import matplotlib.pyplot as plt
# fitting equation: y = (a-d)/(1+(x/c)^b)+d
# genrate the data set
a,b,c,d = 1,2,3,4
x = np.arange(0,10,0.01)
y = (a-d)/(1+(x/c)**b)+d + 0.1*np.random.random(len(x))
@unkcpz
unkcpz / startup.jl
Created May 30, 2019 05:10
julia startup.jl
ENV["EDITOR"] = "atom"
const PLOTS_DEFAULTS = Dict(:theme => :wong)
try
@eval using Revise
# Turn on Revise's automatic-evaluation behavior
Revise.async_steal_repl_backend()
@eval using Rebugger
# Activate Rebugger's key bindings