Skip to content

Instantly share code, notes, and snippets.

View ralphtheninja's full-sized avatar
🏠
Working from home

ralphtheninja

🏠
Working from home
View GitHub Profile
@ralphtheninja
ralphtheninja / storage.js
Created February 1, 2022 23:21
mixmap storage wrapper
/**
* Storage wrapper object for relaying operations to backend.
*/
module.exports = function (backend) {
var storageFn = function (name) {
return {
write: function (offset, buf, cb) {
cb(new Error('write not implemented'))
},
truncate: function (length, cb) {

1. build pktd (to get pktwallet and pktctl)

https://docs.pkt.cash/en/latest/pktd/#installation

2. run the wallet

Note, this will ask you questions the first time. Input wallet passphrase and write down mnemonic for wallet recovery.

./pktd/bin/pktwallet
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5Hi4F9oI7/3D8oQQmM1TrIgPTYpTPbUp3lvc00xffUCfQB9npQXSoxZPaeuKYlVU+CXpvge0jKr9KottPgLvMbqJLZ3lacZNW33tcqDfv/UjJoPUVd1zQUww1MW+xp2ktsu19SwCvBYNjtHAFo0r95KnCMPyDh13vLmtaixgsQBCdhbq4qbWoI5ELDHYzNnuqTHCB2e1YClM5DBkIHj1Iq+lsSnH8Pd/oM4GiRFIE3nC/m5VDDB/29YQNKU4Wx7fKgtPsUnOEQYsA7gbRL3Ac12NOYfeim+vKVaxNn9B8NUOhgpYa3iTV0vjsfZnCgJW/QEqkgWmSXvys5ZldlhcOGqyW08yz3zPAAoEjhzemYmbj+BKca0z8xidZZo/+EEBmWc6M9s2/q3Hy0uj7ZhV8+RTbmwkUc437n/faAN5DQQGIQWQMw2BeETXjOmFMoSpoX+drAbfaboPJbRveG2nMTekQOc+lkEaTSyEEDeHW306KR6NTY6EqHPQebOoSU9tgEBeA3CqPMmd7VqeyNfAr7pWyhcaGWPxYKYSCcOms6vEZOO8ICO72cffrWRJnNhHmYwvThirtuJiloLAJQT5B9q/ayhsageexPm6mGgfjPx30thb4dgEO66f/KO+Bzvvf6CHPeK2jiGR5k2XylMWT78eQ64QjA7W17H7SwHBtcQ== lms@x260
@ralphtheninja
ralphtheninja / clean-up-boot-partition-ubuntu.md
Created October 28, 2019 22:36 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
if !pathNfilename_abs.is_null() {
let path = std::path::Path::new(
std::ffi::CStr::from_ptr(pathNfilename_abs)
.to_str()
.unwrap(),
);
match fs::canonicalize(path) {
Ok(v) => {
return to_cstring(v.to_str().unwrap());
}
cd deltachat-node
cd deltachat-core-rust
git fetch
git checkout --track origin/cleanup-cli
git rebase origin/master
cd ..
node scripts/rebuild-core.js
./node_modules/.bin/node-gyp rebuild
cp deltachat-core-rust/target/release/deltachat.dll build/Release
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error { valid_up_to: 2532, error_len: Some(1) }', src/libcore/result.rs:999:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:59
at src/libstd/panicking.rs:197
3: std::panicking::default_hook
Directory of C:\projects\deltachat-node-d4bf8\deltachat-core-rust\target\release
05/30/2019 05:17 PM <DIR> .
05/30/2019 05:17 PM <DIR> ..
05/30/2019 05:06 PM 0 .cargo-lock
05/30/2019 05:06 PM <DIR> .fingerprint
05/30/2019 05:06 PM <DIR> build
05/30/2019 05:17 PM 3,272 deltachat.d
05/30/2019 05:17 PM 7,560,704 deltachat.dll
05/30/2019 05:17 PM 3,276 deltachat.dll.d
05/30/2019 05:17 PM 59,060 deltachat.dll.lib
of file /home/lms/src/deltachat/deltachat-core-rust/target/debug/examples/repl.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) bt
#0 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62
#1 0x000055973cada91a in std::ffi::c_str::CStr::from_ptr () at src/libstd/ffi/c_str.rs:963
#2 0x000055973bab05e7 in deltachat::dc_job::dc_job_do_DC_JOB_MOVE_MSG (context=0x55973dc23650, job=0x7f7aae9d9608) at src/dc_job.rs:493
#3 0x000055973baae12a in deltachat::dc_job::dc_job_perform (context=0x55973dc23650, thread=100, probe_network=0) at src/dc_job.rs:150
#4 0x000055973baad67a in deltachat::dc_job::dc_perform_imap_jobs (context=0x55973dc23650) at src/dc_job.rs:62
#5 0x000055973ba40ded in repl::start_threads::{{closure}} () at examples/repl/main.rs:192
#6 0x000055973ba2c533 in std::sys_common::backtrace::__rust_begin_short_backtrace (f=...) at /rustc/5d20ff4d2718c820632b38c1e49d4de648a9810b/src/libstd/sys_common/backtrace.rs:136