Skip to content

Instantly share code, notes, and snippets.

View sujaypillai's full-sized avatar
🐳
Getting contained!!!

Sujay Pillai sujaypillai

🐳
Getting contained!!!
View GitHub Profile
@sujaypillai
sujaypillai / cleanAlfPropTables-MySQL.sql
Created January 13, 2016 13:56
SQL script for properly clearing Alfresco unused audit data / property values (NOT node properties, but the property tables used for AuditComponent and AttributeService functionality) for PostgreSQL / MySQL.NOTE: Only run when the Alfresco Repository is NOT running as values kept in in-memory caches will otherwise result in constraint violations.
set autocommit=0;
begin;
-- get all active references to alf_prop_root
create temporary table temp1 (id bigint(20), index (id));
insert into temp1 select disabled_paths_id as id from alf_audit_app;
insert into temp1 select audit_values_id as id from alf_audit_entry;
insert into temp1 select prop1_id as id from alf_prop_unique_ctx;
-- determine the obsolete entries from alf_prop_root
@sujaypillai
sujaypillai / DB query to find models
Created January 20, 2016 22:43
Find any model file by performing DB queries on the alf_node, alf_qname, alf_node_properties, alf_content_data and alf_content_url tables
select alf_content_url.content_url
from alf_node
left join alf_qname on alf_node.type_qname_id = alf_qname.id
left join alf_node_properties on alf_node_properties.node_id = alf_node.id
join alf_content_data on alf_content_data.id = alf_node_properties.long_value
left join alf_content_url on alf_content_url.id = alf_content_data.content_url_id
where
alf_qname.local_name = 'dictionaryModel'
and alf_content_url.content_url is not null
curl -X POST -H "Content-Type: application/json" --user 'admin':'admin' -d '{"shortName":"test1","sitePreset":"site-dashboard","title":"TestSite","visibility":"PUBLIC"}' http://localhost:8080/alfresco/service/api/sites
delete from ACT_HI_TASKINST where not exists (select pd.ID_ from ACT_RE_PROCDEF pd where pd.ID_ = PROC_DEF_ID_);
Failed to retrieve tasks assigned to authority {0} in state {1}.
....
Caused by: org.alfresco.service.cmr.workflow.WorkflowException: 04070413 Failed to retrieve tasks assigned to authority {0} in state {1}.
....
Caused by: org.activiti.engine.ActivitiException: no deployed process definition found with id 'RegConducereReg:1:14208'
package main
import (
"golang.org/x/net/context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/cli/command"
"github.com/docker/docker/client"
"fmt"
BITS 32
org 0x05000000
db 0x7F, "ELF"
dd 1
dd 0
dd $$
dw 2
dw 3
dd 0x0500001B
INSERT INTO ACT_HI_VARINST(
ID_,
PROC_INST_ID_,
EXECUTION_ID_,
TASK_ID_,
NAME_,
VAR_TYPE_,
REV_,
BYTEARRAY_ID_,
DOUBLE_,
@sujaypillai
sujaypillai / gist:7b1c43fabc0c1486d1da573ecbb2b6f9
Created October 10, 2017 16:16
Find the database tables that are using the most space on disk
SELECT relname AS "tablename", reltuples AS "rows", relpages * 8 / 1024 AS "MB" FROM pg_class
WHERE relname like 'alf%'
OR relname like 'act%'
OR relname like 'avm%'
OR relname like 'jbpm%'
ORDER BY relpages DESC;
@sujaypillai
sujaypillai / gist:364267c56aab1adca045e9bb7f0dd21b
Created March 18, 2018 10:30
list all tags for a image from repository
#!/bin/bash
if [ $# -lt 1 ]
then
cat << HELP
dockertags -- list all tags for a Docker image on a remote registry.
EXAMPLE:
- list all tags for ubuntu:
@sujaypillai
sujaypillai / docker-for-mac.md
Created July 18, 2018 15:39 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker for Mac Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Moby VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1