Skip to content

Instantly share code, notes, and snippets.

View hi-ko's full-sized avatar

Heiko Robert hi-ko

  • ecm4u GmbH
  • Stuttgart, Germany
View GitHub Profile
@hi-ko
hi-ko / android-backup-apk-and-datas.md
Last active January 26, 2024 13:36 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

Fetch application APK

@hi-ko
hi-ko / mbr-to-gpt-uefi.md
Created January 18, 2024 09:33 — forked from cjyar/mbr-to-gpt-uefi.md
Convert a disk from MBR to GPT+UEFI, in Linux.

Before starting, make sure you have a backup, and make sure to have a linux live boot ready to rescue your system. It's easy to mess this up!

  1. Use gdisk to convert the partition table to GPT.

    gdisk /dev/sda

  2. Create the "BIOS boot" partition that GRUB needs.

    n to create a new partition. Needs to be about 1MB. You can probably squeeze this in from sectors 34-2047. Use L or l to look up the code for "BIOS boot" (ef02).

  3. Write the new partition table.

    w

  4. Reload the partition table. > partprobe /dev/sda
### Remove all snapshots crteated by the zfs-auto-snapshot tool
zfs list -t snapshot -o name | grep zfs-auto-snap | tac | xargs -n 1 zfs destroy -r
@hi-ko
hi-ko / ldap sync fail fix.js
Created November 29, 2022 19:52 — forked from douglascrp/ldap sync fail fix.js
LDAP sync fail: Job DEFAULT.ldapPeopleJobDetail threw an unhandled Exception: org.springframework.dao.DataIntegrityViolationException: No property value exists for ID
// from https://hub.alfresco.com/t5/alfresco-content-services-forum/ldap-sync-fails-after-cleanalfproptablespostexec-sql/m-p/40015/highlight/true#M2224
var context = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var SyncStatus = Packages.org.alfresco.repo.security.sync.SyncStatus;
var attributeService = context.getBean('attributeService', Packages.org.alfresco.service.cmr.attributes.AttributeService);
var ROOT_ATTRIBUTE_PATH = ".ChainingUserRegistrySynchronizer";
var STATUS_ATTRIBUTE = "STATUS";
var SUMMARY_ATTRIBUTE = "SUMMARY";
var zone = "ldap1";
@hi-ko
hi-ko / getGlobalPropertyValue.js
Last active November 29, 2022 18:08
Alfresco Javascript Console Recipes
function getGlobalPropertyValue(propertyValue){
var ctxt = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var globalProperties = ctxt.getBean('global-properties', Packages.java.util.Properties);
var placeholderHelper = new Packages.org.springframework.util.PropertyPlaceholderHelper('${', '}', ':', true);
var propertyValue = globalProperties[propertyValue];
if (propertyValue){
propertyValue = placeholderHelper.replacePlaceholders(propertyValue, globalProperties);
}
@hi-ko
hi-ko / cleanup.sh
Created March 22, 2022 15:22
basic docker commands
docker container ls -a
docker container rm cc3f2ff51cab cd20b396a061
# Removing all stopped containers
docker container prune
# Stop and remove all containers
docker container stop $(docker container ls -aq)
docker container rm $(docker container ls -aq)
## Install Docker
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
@hi-ko
hi-ko / checkDockerDisks.sh
Created March 22, 2022 15:06 — forked from robsonke/checkDockerDisks.sh
This Bash script will loop through all running docker containers on a host and list the disk usage per mount. In case it's breaching the 65%, it will email you.
#!/bin/bash
# get all running docker container names
containers=$(sudo docker ps | awk '{if(NR>1) print $NF}')
host=$(hostname)
# loop through all containers
for container in $containers
do
echo "Container: $container"
@hi-ko
hi-ko / createPreviewsInFolder.js
Last active March 11, 2022 17:22
Alfresco Javascript Console
// example for the ecm4u smartTransformer to (re)create high quality Previews for Office-Docs
var suffixList=['pptx', 'ppt', 'xlsx', 'xls', 'docx', 'doc'];
recurse(document, function(node) {
if ( node.isDocument){
var suffix=node.properties["cm:name"].split('.').pop();
if (suffixList.indexOf(suffix.toLowerCase()) >= 0) {
print(node.displayPath+'/'+node.name+': ' + smarttransformer.createThumbnails(node).message);
}
@hi-ko
hi-ko / README.md
Last active September 30, 2023 01:28
joplin server install

this gist is no longer maintained

Please use https://github.com/hi-ko/joplin-server-ubuntu-install instead

Install joplin server on Ubuntu (20.04)

  1. as root run joplin-requirements.sh to install the joplin requirements but please take this script with causion since it is not well tested in existing environments. You could also create the requirements by yourself by
    1. create user joplin with home /home/joplin
    2. install nodejs 16
  2. install packages vim git build-essential python curl dirmngr apt-transport-https lsb-release ca-certificates