Skip to content

Instantly share code, notes, and snippets.

View SA-JackMax's full-sized avatar

Jack Max SA-JackMax

View GitHub Profile
SELECT count(alf_node.id)
FROM alf_node INNER JOIN alf_node_aspects ON alf_node.id = alf_node_aspects.node_id
WHERE alf_node.store_id = 6
AND alf_node_aspects.qname_id = 2929;
Prerequisite
One instance of Alfresco on mysql, one postgresl of exactly the same version (schema version).
Step 1. Dump database
mysqldump --port 3306 -u alfresco --password=alfresco -h 127.0.0.1 --databases alfresco --skip-comments --skip-extended-insert --no-create-db --hex-blob --default-character-set=utf8 --skip-triggers --compact --no-create-info --skip-quote-names --compatible=postgresql > mydump.sql
Step 2. Dump local Postgres schema
You can install a clean version of Alfresco to use as for schema dump
(need to insert command for dump here)
@SA-JackMax
SA-JackMax / SolrQuerySyntaxPrimer.md
Created July 12, 2024 12:29 — forked from mankyKitty/SolrQuerySyntaxPrimer.md
The documentation around the basics of the Solr query syntax is terrible, this is an attempt to alleviate the doc-shock associated with trying to learn some fundamentals.

Solr Query Syntax Basics

This is a super basic beginners guide to Solr Lucene query syntax. We're going to cover running a straightforward query, as well as some of the more useful functionality such as filtering and creating facets. We'll point out some things you can't do and generally give you enough instruction so that you can get yourself into trouble.

For testing you need a REST client capable of sending requests to your Solr instance. Either RESTClient for Firefox or Postman for Chrome are good choices.

Misc

Request Specific Fields

To specify a list of fields to return instead of the default Solr response use fl and provide a comma delimited list of fields:

# on Fedora28 as root
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <master IP>"
exit 1
fi
set -ex
MASTER_IP=$1
@SA-JackMax
SA-JackMax / sysinfo
Created March 28, 2024 16:20 — forked from rytoj/sysinfo
#!/bin/bash
# Program to output a system information page
TITLE="System Information Report for $HOSTNAME"
TIME=$(date +%F:%T)
TIMESTAMP="Generated $TIME, by $USER uid: $(id -u)"
TOTALSPACE=$(df -h)
SELIUX_STATE=$(sestatus | head -1 ; sestatus | grep --color=auto "Current mode";)
LARGEST_FILES=$(du -a /home 2>/dev/null | sort -n -r | head -n 10)
type systemd 2>/dev/null && SERVICES=$(systemctl -t service) || SERVICES=$(chkconfig --list) #for cebos6.8
@SA-JackMax
SA-JackMax / backup.sh
Created March 28, 2024 16:14 — forked from firestar/backup.sh
MySQL Backup to Google Drive (requires gdrive)
#!/bin/bash
# backup Path
BACKUP_PATH="./mysql"
# database settings
DB_NAME=$1
DB_USER="user"
DB_PASS="password"
yum update -y
yum install -y epel-release
yum update -y
yum install -y containerd
systemctl enable --now containerd
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
echo "#######################################################################################################"
echo "#######################################################################################################"
echo "################# Installing Kubernetes ########################"
echo "#######################################################################################################"
echo "#######################################################################################################"
echo "Installing container selinux 2.28-1 from \"rpmfind.net\""
yum install libtool-ltdl.x86_64 policycoreutils libseccomp.x86_64 -y
cd /tmp
curl https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm -o docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
rpm -Uvh docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
#install kubernetes on CentOS
#run as root
#kubernetes will refuse to run on CentOS if swapoff is on
#line 1 & 2 ensure swapoff doesn’t interfere with k8
swapoff -a
sed -i '/ swap swap /s/^/#/' /etc/fstab
yum -y update
yum -y install docker
systemctl enable docker && systemctl start docker
echo “[kubernetes]
#!/bin/bash
dnf update -y &&\
dnf install -y kernel-devel kernel-header* make gcc elfutils-libelf-devel
echo "Installing Docker"
yum install -y yum-utils telnet &&\
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo &&\
yum install -y --allowerasing docker-ce docker-ce-cli containerd.io docker-compose-plugin &&\
systemctl enable docker.service &&\