Skip to content

Instantly share code, notes, and snippets.

View billerby's full-sized avatar
🏠
Working from home

Erik Billerby billerby

🏠
Working from home
  • Redpill Linpro
  • Göteborg, Sweden
View GitHub Profile
@billerby
billerby / upload-files.sh
Created September 27, 2017 06:32
Post files to filebin
#!/bin/bash
#
# Upload files to a named filebin installation
# (https://github.com/espebra/filebin)
#
# Usage:
# Set the correct environments variables below and run.
#
# Author: billerby@gmail.com
#!/bin/bash
result=$(curl -sS http://holfuy.com/clientraw/s155/clientraw.txt)
set -f
variables=(${result//:/ })
current_wind_knots=${variables[1]}
gust_knots=${variables[2]}
--select * from alf_qname where local_name in ('currentVersion', 'installedVersion');
--SELECT node_id, qname_id, locale_id, string_value FROM alf_node_properties WHERE qname_id IN (160, 161) ORDER BY node_id;
--SELECT node_id, qname_id, locale_id, string_value FROM alf_node_properties WHERE node_id IN (920075) ;
UPDATE alf_node_properties SET string_value = '3.10.3' WHERE node_id = 920075 AND qname_id IN (161);
(https://community.alfresco.com/thread/148962-best-way-to-uninstall-a-amp-module)
# Powershell script to find processes that got stuck spawned by Alfresco Transformation Server and kill them.# # Get list of processes matching the name and older than x minutes where the cpu load is less than 1.50 (indicates its idle).# WINWORD idle process
$orphanProcs = get-process | where {($_.Name -eq "winword") -and ($_.StartTime -lt (get-date).addseconds(20))-and ($_.cpu -lt 1.50)}
#Check if list is Null and if not kill them all:
If ($orphanProcs) {
#display list
$orphanProcs
#kill list
$orphanProcs | foreach { $_.Kill() }
} Else {
echo "no processes found older than specified"
@billerby
billerby / ats-process-watchdog.ps
Last active February 13, 2017 08:20
watchdog
Get-Process winword | Where { $_.StartTime -lt (Get-Date).AddMinutes(-10) } | Stop-Process -Force
@billerby
billerby / documentlist-display-type.js
Created June 25, 2014 08:40
Share documentlibrary type renderer
(function() {
if (Alfresco.DocumentList)
{
YAHOO.Bubbling.fire("registerRenderer",
{
propertyName: "type",
renderer: function(record, label)
{
var key = 'type.' + record.jsNode.type.replace(":", "_");
@billerby
billerby / cp_norsk.sh
Created November 11, 2013 09:32
Copy nb_NO.properties files to a new set of no.properties files since some browsers seems not to support bokmål
#!/bin/bash
for file in $(find . -name "*nb_NO.properties*")
do
cp $file `echo $file | sed s/_nb_NO.properties$/_no.properties/`
done
# Get the latest Sun Java SDK from Oracle http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u1-download-513651.html
wget http://download.oracle.com/otn-pub/java/jdk/7u21-b11/jdk-7u21-linux-x64.rpm?AuthParam=1366191299_077cdb0b196500e0d7250707139c1cf7
# Rename the file downloaded, just to be nice
mv jdk-7u21-linux-x64.rpm\?AuthParam\=1366191299_077cdb0b196500e0d7250707139c1cf7 jdk-7u21-linux-x64.rpm
# Install Java
sudo rpm -i jdk-7u21-linux-x64.rpm
# Check if the default java version is set to sun jdk
@billerby
billerby / gist:4722164
Created February 6, 2013 12:00
treesize, put in /etc/treesize and make executable thanks to http://blog.aclarke.eu/a-simple-treesize-shell-script-for-linux/
#/bin/sh
du -k --max-depth=1 | sort -nr | awk '
BEGIN {
split("KB,MB,GB,TB", Units, ",");
}
{
u = 1;
while ($1 >= 1024) {
$1 = $1 / 1024;
u += 1
@billerby
billerby / strip-content-from-alf-data-dir.ps1
Last active July 22, 2023 05:36
Alfresco contentstore stripper
# Script that traverses a directory and strips all content from files larger than
# $filesizelimit This comes handy when we need to transfer a backuped directory
# structure to our local environment. We are normally not interested in the content
# of the files when debugging.
# Version 0.1,
# By Erik Billerby, billerby[-at-]acando.com
# Location where 7-Zip is installed on your computer.
# The default is in a folder, '7-Zip' in your Program Files directory.