Skip to content

Instantly share code, notes, and snippets.

View fintanmm's full-sized avatar

Fintan MacMahon fintanmm

View GitHub Profile
@fintanmm
fintanmm / simpleWPmigration.sh
Last active December 9, 2024 15:06
simple script to download/restore a backup of a WP site
#!/bin/bash
# Variables
BITNAMI_DIR="/home/bitnami"
STACK_DIR="$BITNAMI_DIR/stack/wordpress/wp-content"
DB_PASSWORD_FILE="$BITNAMI_DIR/bitnami_application_password"
DB_NAME="bitnami_wordpress"
USER=""
PASSWORD=""
<repositories>
<repository>
<id>alfresco</id>
<name>Alfresco</name>
<url>https://artifacts.alfresco.com/nexus/content/groups/public/</url>
</repository>
</repositories>
@fintanmm
fintanmm / tasks.json
Created June 14, 2022 06:01
vscode quarkus lambda tasks
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Create Lambda",
"type": "shell",
"command": "target/manage.sh create",
"group": "none",
@fintanmm
fintanmm / jshell-run.sh
Created November 11, 2021 11:44
Run jshell with with the current env loaded.
mvn compile com.github.johnpoth:jshell-maven-plugin:1.3:run
@fintanmm
fintanmm / gist:213db6485c95cb74dd58a8f21c8cce9b
Created September 23, 2021 08:31
ansible apt update report
ansible-playbook -i hosts pacakges.yml -k -K |grep -A 1000 "PLAY RECAP"|tail -n +2|tr -d ':'|tr -s '[:space:]'|sed 's/[[:space:]]/,/g'> fixed_output.csv
SELECT
th.name as metric,
long_lat.site AS name,
long_lat.Latitude AS latitude,
long_lat.Longitude AS longitude,
COUNT(th.type_id) AS value
FROM ticket_history th
LEFT JOIN
-- SUB QUERY FOR LOCATIONS
(SELECT
@fintanmm
fintanmm / text.py
Created August 14, 2019 13:22
text prep for k-nn
import sys, os
# sys.path.append('./Common') # noqa
sys.path.append(os.path.abspath('./Common'))
import Common.common as common
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib
from collections import Counter, OrderedDict
@fintanmm
fintanmm / alfPeopletoCSV.sh
Created May 2, 2019 11:19
Get all users from Alfresco and convert it to csv file.
echo '"userName", "enabled", "firstName", "lastName", "jobtitle", "organization", "location", "telephone", "mobile", "email", "companyaddress1", "companyaddress2", "companyaddress3", "companypostcode", "companytelephone", "companyFax", "companyemail", "isDeleted"' > people.csv
curl -u user:"password" "https://domain.com/alfresco/s/api/people?maxResults=2000" | \
jq -r '.people[] | [.userName, .enabled, .firstName, .lastName, .jobtitle, .organization, .location, .telephone, .mobile, .email, .companyaddress1, .companyaddress2, .companyaddress3, .companypostcode, .companytelephone, .companyFax, .companyemail, .isDeleted] | @csv' >> people.csv
@fintanmm
fintanmm / findingFiles.sh
Last active March 27, 2019 11:25
Finding info about files and directories
#!/bin/bash
export project=$1
export pathOfProject=$2
mkdir -p "./$project"
# find data/B8493 -type f -printf '%h\n' | sort -u
echo "Empty Dirs"
import java.io.File
import org.apache.poi.ss.usermodel.WorkbookFactory
import org.apache.poi.ss.usermodel.{Row, Cell}
val baseUnitFile = new File("./BaseUnits_export_.xlsx")
var workbook = WorkbookFactory.create(baseUnitFile)
val sheet = workbook.getSheetAt(0)
val xmlTemplate = (DevName: Cell, IP: Cell) => <MirrorOp>
<Device>