Skip to content

Instantly share code, notes, and snippets.

View skaag's full-sized avatar

Aric Fedida skaag

View GitHub Profile
@skaag
skaag / n8n_csv_import.js
Created January 22, 2024 17:16
Converts CSV data from a "data" field to actual records
// Define a function to convert a single CSV string to a JSON object
function csvToJson(csv) {
const lines = csv.split('\n').map(line => line.trim()).filter(line => line !== '');
// Split the lines at line breaks, trim whitespace, and remove empty lines
const headers = lines[0].split(',');
// Split the first line to get headers
return lines.slice(1).map(line => {
const data = line.split(',');
@skaag
skaag / docker-compose.yml
Created December 20, 2022 19:16
Immich docker-compose.yml
# Explanation: In this case, PostgreSQL and Redis are both already
# installed on the host, so this configuration skips them entirely,
# and removes the dependency on them from other images
version: "3.8"
services:
immich-server:
image: altran1502/immich-server:release
entrypoint: ["/bin/sh", "./start-server.sh"]
@skaag
skaag / .env
Created December 20, 2022 19:12
Immich .env file
###################################################################################
# Database
###################################################################################
DB_HOSTNAME=host.docker.internal
DB_USERNAME=immich
DB_PASSWORD=immich
DB_DATABASE_NAME=photosdb
# Optional Database settings:
@skaag
skaag / dmesg.txt
Created March 14, 2020 14:51
Surface Pro 4 dmesg
[ 0.000000] microcode: microcode updated early to revision 0xca, date = 2019-09-26
[ 0.000000] Linux version 5.1.15-surface-linux-surface (jake@jake-Surface-Laptop) (gcc version 8.3.0 (Ubuntu 8.3.0-6ubuntu1~18.10.1)) #8 SMP Thu Jun 27 12:03:55 EDT 2019
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.1.15-surface-linux-surface root=UUID=4e77cc61-ddb2-46d6-86c7-6089859c80f0 ro quiet splash vt.handoff=1
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Hygon HygonGenuine
[ 0.000000] Centaur CentaurHauls
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
@skaag
skaag / gist:df101bc975ba14e7114e6b6f1ee5f189
Created June 25, 2019 21:15
Cache Microsoft and Apple Updates
# Cache windows and apple updates in Squid:
refresh_pattern -i windowsupdate.com/.*\.(cab|exe|ms[i|u|f|p]|[ap]sf|wm[v|a]|dat|zip|psf) 43200 80% 129600 reload-into-ims;
refresh_pattern -i microsoft.com/.*\.(cab|exe|ms[i|u|f|p]|[ap]sf|wm[v|a]|dat|zip|psf) 43200 80% 129600 reload-into-ims;
refresh_pattern -i windows.com/.*\.(cab|exe|ms[i|u|f|p]|[ap]sf|wm[v|a]|dat|zip|psf) 43200 80% 129600 reload-into-ims;
refresh_pattern -i microsoft.com.akadns.net/.*\.(cab|exe|ms[i|u|f|p]|[ap]sf|wm[v|a]|dat|zip|psf) 43200 80% 129600 reload-into-ims;
refresh_pattern -i deploy.akamaitechnologies.com/.*\.(cab|exe|ms[i|u|f|p]|[ap]sf|wm[v|a]|dat|zip|psf) 43200 80% 129600 reload-into-ims;
refresh_pattern -i ([^.]+.|)(download|adcdownload).(apple.|)com/.*\.(pkg|dmg) 4320 100% 43200 reload-into-ims;
I, [2018-08-10T01:20:52.963033 #8288] INFO -- : [diaspora:web] sleeping for :start_grace 2.5
I, [2018-08-10T01:20:55.463482 #8288] INFO -- : [diaspora:web] load_external_pid_file: pid_file found, but process <8521> not found
E, [2018-08-10T01:20:55.463635 #8288] ERROR -- : [diaspora:web] exit status 1, process <8521> (from /home/diaspora/diaspora/tmp/pids/web.pid) was not found; ensure that the pid_file is being updated correctly (you should check the process logs ["/home/diaspora/diaspora/log/eye_processes_stdout.log", "/home/diaspora/diaspora/log/eye_processes_stderr.log"])
E, [2018-08-10T01:20:55.463684 #8288] ERROR -- : [diaspora:web] process <> failed to start (:not_really_running)
I, [2018-08-10T01:20:55.464061 #8288] INFO -- : [diaspora:web] switch :crashed [:starting => :down] crashed
I, [2018-08-10T01:20:55.464457 #8288] INFO -- : [diaspora:web] schedule :check_crash (crashed)
I, [2018-08-10T01:20:55.464534 #8288] INFO -- : [diaspora:web] <= restore
I, [2018-08-10T01:20:55.464576 #8288] INFO --
@skaag
skaag / to-mono.sh
Created August 29, 2017 18:36
Ghostscript recipe to convert a PDF to mono
gs -o $1-mono.pdf \
-sDEVICE=pdfwrite \
-r600 \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/screen \
-dEmbedAllFonts=true \
-dSubsetFonts=true \
-sColorConversionStrategy=/Mono \
-sColorConversionStrategyForImages=/Mono \
-c "/osetrgbcolor {/setrgbcolor} bind def /setrgbcolor {pop [0 0 0] osetrgbcolor} def" \
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 202 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 303 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0
192.168.1.1 0.0.0.0 255.255.255.255 UH 202 0 0 eth0
192.168.30.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
apt-get install -y xinetd
wget skaag.net/observium_agent_xinetd -O /etc/xinetd.d/observium_agent_xinetd
wget skaag.net/observium_agent -O /usr/bin/observium_agent
chmod +x /usr/bin/observium_agent
mkdir -p /usr/lib/observium_agent/local
service xinetd restart
zmprov gacf | grep zimbraMtaRestriction
zimbraMtaRestriction: reject_invalid_helo_hostname
zimbraMtaRestriction: reject_non_fqdn_helo_hostname
zimbraMtaRestriction: reject_non_fqdn_sender
zimbraMtaRestriction: reject_unknown_reverse_client_hostname
zimbraMtaRestriction: reject_unknown_sender_domain
zimbraMtaRestriction: reject_unknown_helo_hostname
zimbraMtaRestriction: reject_rbl_client bl.spamcop.net
zimbraMtaRestriction: reject_rbl_client dnsbl.sorbs.net
zimbraMtaRestriction: reject_rbl_client b.barracudacentral.org