Skip to content

Instantly share code, notes, and snippets.

Lars-Magnus Skog ralphtheninja

Block or report user

Report or block ralphtheninja

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
ralphtheninja /
Created Dec 22, 2016 — forked from jaronkk/
Cleanup and reset docker on Jenkins workers / slaves
# This script should be located on each Jenkins slave, and the jenkins user should have permission to run it with sudo
# Attempts to cleanly stop and remove all containers, volumes and images.
docker ps -q | xargs --no-run-if-empty docker stop
docker ps -q -a | xargs --no-run-if-empty docker rm --force --volumes
docker volume ls -q | xargs --no-run-if-empty docker volume rm
docker images -a -q | xargs --no-run-if-empty docker rmi -f
# Stops the docker service, unmounts all docker-related mounts, removes the entire docker directory, and starts docker again.
ralphtheninja /
Created Oct 28, 2019 — forked from ipbastola/
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


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

1. Check the current kernel version

$ uname -r 
ralphtheninja /
Last active Jul 2, 2019
Use JOBS=max to speed up native node modules

When npm installs native node modules it uses node-gyp to compile code. This is the seam node uses for targeting different operating systems, e.g. OS X, linux, Windows etc.

By default node-gyp compiles using one core and if you have more than one you probably want to utilize that power to speed up compile time. The way node-gyp handles this is by using the JOBS environment variable, which sets the jobs variable here. This piece of code then checks the value of jobs to determine how many cores to use.

Note that if the value of JOBS is max then all cores will be used. So lets try this on leveldown. First lets check that JOBS isn't set yet:

lms@ux301|01:34|~/src/leveldb-repos/leveldown (master) $ echo $JOBS

if !pathNfilename_abs.is_null() {
let path = std::path::Path::new(
match fs::canonicalize(path) {
Ok(v) => {
return to_cstring(v.to_str().unwrap());
View cli-branch.txt
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
View desktop crash
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error { valid_up_to: 2532, error_len: Some(1) }', src/libcore/
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/
at src/libstd/
3: std::panicking::default_hook
View deltachat core rust windows binaries
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
View core dump when receiving message
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/
#2 0x000055973bab05e7 in deltachat::dc_job::dc_job_do_DC_JOB_MOVE_MSG (context=0x55973dc23650, job=0x7f7aae9d9608) at src/
#3 0x000055973baae12a in deltachat::dc_job::dc_job_perform (context=0x55973dc23650, thread=100, probe_network=0) at src/
#4 0x000055973baad67a in deltachat::dc_job::dc_perform_imap_jobs (context=0x55973dc23650) at src/
#5 0x000055973ba40ded in repl::start_threads::{{closure}} () at examples/repl/
#6 0x000055973ba2c533 in std::sys_common::backtrace::__rust_begin_short_backtrace (f=...) at /rustc/5d20ff4d2718c820632b38c1e49d4de648a9810b/src/libstd/sys_common/
View desktop-gdb-attached.log
[New LWP 32297]
[New LWP 32716]
[New LWP 32722]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/".
0x00007f64bb5426c1 in buf_redux::buffer::BufImpl::bytes_written ()
from /home/lms/src/deltachat/deltachat-node/build/Release/deltachat.node
(gdb) thread apply all bt
Thread 35 (Thread 0x7f649846f700 (LWP 32722)):
View maybe-related.txt
You can’t perform that action at this time.