How to simply fix the edit-only contact problem in android (force delete contact)

Problem: you cannot delete a contact from your contact-list because it is write-protected because there are links to e.g. Signal or Whatsapp shadow contacts.

The classical way is to unlink the contact, delete it and force refresh the whatsapp contact list. But this won’t work for Signal users

Here is a much easier way:

install the “simple contacts” app by simple mobile tools (also in fdroid store) and use it instead of the default app. Deleting contacts works in this app no matter if there are links.

Simple or?

Yeah I know it is a bad advice to simply point to an app. But the issue is here google contacts is crap. I am sure there are some other apps able to do this, but this one is OSS and doesn’t sell your data.

Anyway: maybe it is a good idea to simply replace the google contacts app in your workflows by his app. And as maintaining apps is sometimes exhausting maybe a little thanks to the maintainer (not me) would be a good idea. E.g. a good rating.

How to fix the E-Mobility problem

Currently we have a hype for Electric cars. Loading at home, environment friendly. Everyone is expected to buy one of the new and shiny cars.

But there are many disadvantages:

First, replacing cars needs a lot of more energy and also many people won’t replace their car (too expensive, like the car). So it will take 20 or more years to replace the most of them.
Second, the batteries are in some way dongled to the cars. There is no upgrade path except replacing the car. Same environmental and financial problem.
Additionally electric cars are expensive because of the high energy accumulator, so both solutions are not available for poor people.
Third, loading at home is also nothing for poor people, you need to find a special station because you have no own parking lot. There are also many different standards and people are simply overwhelmed with the loading system (you need an extra card).
Forth, long distances are only possible with longer stops

So my proposal

  1. replace the motor not the car with an electric motor
  2. replace the tank (or battery in an electric car) with an standardized generator bay. Generators can be everything what produces current, from an high energy battery to hydrogen generators, to generators using fossil fuels or one way chemical reactions. Also thinkable would be nuclear fuels in special settings (remote, cold and deserted areas).
  3. gas stations can change fuels of generator or the generator itself depending of equipment of the gas station and type of the generator
  4. (optional) add a small high energy accumulator (or codensator) for coping with generator outages and saving recuperation energy

How to setup django with webpack and webpack-dev-server

For loading and injecting webpack files I would recommend django-manifest-loader. To connect them we need a port for devServer, force the dev server to emit files and reference them with django
The setup: we have two servers webpack-dev-server and django.

in django settings.py we add (see https://django-manifest-loader.readthedocs.io/en/latest/docs/about_install.html#example-project-structure for more details):

INSTALLED_APPS += [“manifest_loader”]

we can skip installing the clean-plugin, webpack 5 has it inbuilt

new solution:

module.exports = (env, options) =>({

devServer: {
port: ‘8080’,
devMiddleware: {
writeToDisk: true,
},
headers: {
‘Access-Control-Allow-Origin’: ‘*’
},

},
plugins: [

new WebpackManifestPlugin({
writeToFileEmit: true,
}),
],
output: {

# replaces clean plugin
clean: true
}
}),

package.json


“scripts”: {
“serve:dev”: “webpack serve –mode development”,
}

see also:

https://github.com/devkral/secretgraph

old solution, just forget it

How to fix 51% attacks on (distributed) blockchains

distributed Blockchains on quorum base are vulnerable if one party controlls over 50% of the mining power.
My solution for this problem is, that not all mining is anonymous. Some miners are registered and sign their blocks extra with a public and verified certificate.
For the sacrifice of anonymity they get more share (at least 51%) or are in other models required for some block verifications. The clients are not affected.
If different mining pools are under the control of the same party, they get no extra share as it is easily detect and blockable because they are not anonymous.

windows in a VM doesn’t find a disk – how to fix

Do you had the error 0x000001 or inaccessible boot device for a windows in a VM and it doesn’t find a drive?
Here is the reason:

It requires an emulated SATA device. And for example qemu just emulates a Virtio device with less/other features so Windows complains that there is no device. It is really funny because the bootloader can start but if you open a console it just says: no drives found.

The fix is very easy: set the options for emulating a sata drive. Afterwards everything should work.

It is possible that if you do a fresh Windows install in a VM it installs some other boot code so this is working. But I haven’t done that for years so I don’t know what the current state is.


Sidenote: disk2vhd is really nice to move a windows into a VM together with this trick. This was what I was trying and how I hit this bug.

How to root the easy way

First unlock oem completely. For this boot into bootloader mode and execute fastboot oem unlock. Warning: this erases all your files.

Wait until an OTA update (skip if you can grab official firmware for your device (and it is the current version or we need a franken vendor partition) (but we still need the boot file from the official firmware)). Don’t install it; extract first the ota url (logcat or generate bugrequest while downloading) or extract update.zip. This zip file should contain a file named boot. And this file we need.
Continue the update. Now transfer the boot file to the device, install magisk manager on your android device and patch the boot file. Pull the patched file via adb from the device and switch the device into bootloader mode. Now flash the patched boot file to the boot partition and reboot.

Now you should be root.

If you want to stay root do the ota capture method before every update and patch the boot partition after every update.

I hope this guide was helpful

How to fix no wlan on android after root (not completely correct boot used / old vendor partition)

Do you know the problem? You root android via a magisk patched boot partition but the kernel on the boot partition slightly differs from the vendor kernel modules and you haven’t wlan, bluetooth, …

Here is the fix: let’s build a franken-vendor partition.
First you need root access. For this enter su in adb shell. Now go to magisk manager or whatever root tool you use and allow su.

Before we beginn: better make an backup of the vendor partition (adb shell "su -c 'cat /dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/vendor'" > vendorbackup). The exact path you can find out by using: adb shell cat /proc/mounts. Make at least a backup of the /vendor/lib/modules .ko files.

Next: remount the vendor partition in read-write-mode (mount -o remount,rw /vendor). Somewhere in /vendor/lib/modules are some .ko files. These are the linux kernel modules the wrong android kernel cannot load and this is the reason why we have no wifi, bluetooth, …

Next step is to transform the vendor image to which the boot partition original belongs. If the ending is .img we have to transform the sparse image into a raw image for mounting. Elsewise you may can skip the step.
Install the package containing simg2simg (for every distro, or operating system the name differs so you have to find out the program yourself).
Desparse the image with simg2simg <image> <rawimage>

The next step differs if you cannot the raw image. If this is the case move the raw image on the android device and mount it here.
Now you can overwrite the .ko modules with:
cat <vendor mount path>/lib/modules/<module name>.ko | adb shell "su -c 'cat > /vendor/lib/modules/<module name>.ko'"
or
adb shell "su -c 'cat <vendor mount path>/lib/modules/<module name>.ko > /vendor/lib/modules/<module name>.ko'"

You have to repeat this step for all modules. After that reboot and wifi should work again

A solution for locking in multi-core systems

Case: you have 1000 Cores. How do you synchronize without great overhead?
My proposed Solution: Partition. Create Clusters.

Instead of locking all cores, just use x Cores for a problem and then you lock only the x Cores. With this method the problems complexity greatly disolves. This solves also the caching coherance as it just has to work between x cores.

For a communication with the outer world a main cluster is proposed. It can assign and control clusters. For an access to the data of a cluster it can lock the memory area for the cluster and retrieve the data. Worker clusters can communicate on this way with the main cluster. Here are multiple other ways including messages possible.
In someway this is a big-little architecture with more cores.

Extensions:
some cores have hardware access like to video memory or to usb interrupts. Here the main cluster can be relieved by offloading tasks

how to adapt C++-objects for TSX

TSX doesn’t recognize partial writes to objects as writes to the whole object. This can cause a missing synchronisation.

The fix is very easy: you mark an object as written. This is possible with the prefetch builtin of GCC:

__builtin_prefetch(pointer_to_object, 1, 0)

The meaning of the two parameters are:

1 = write access
0 = weak locality. Don’t force tsx to cache something. We just want to mark an address as written to.

new Project: spkcspider

I started 7 months ago a project, spkcspider. It is like a digital business card with blogging and wp writing function. The key difference to current systems is that you can store structured data which is computer readable.

This way you can provide your data to web shops with just a link. For security I use in links embedded tokens and a multi factor authentication.

I wrote my project in python because if you look around: php, javascript or ruby are maybe widespread but they all have a dependency hell. You cannot really fix your project as maybe there is a dependency to an old, vulnerable version or an unknown hole (what is more likely if multiple authors just add a little piece).

Sorry for not going into the details. I will do it in a few weeks. My time is currently very limited.

Anyway, here are more information:
https://spkcspider.net/cgi-bin/cgihandler.fcgi/spider/ucs/list/7/NeDIjcG8wwFp63Li/

As you see, there is a cryptic string in the url. This is part of my security concept.

Update: I have a successor project: secretgraph. It should port spkcspider to encrypted graphs (graphql). Means: your content is end 2 end encrypted, moving accounts is easier, you can still search content (you can define unencrypted, searchable parts) and you have a fine grained, privacy first permission model. Currently there is no running version available.
The link will may fade out.