Skip to content

Instantly share code, notes, and snippets.

sudo systemctl stop [servicename]
sudo systemctl disable [servicename]
#rm /etc/systemd/system/[servicename]
#rm /etc/systemd/system/[servicename] symlinks that might be related
sudo systemctl daemon-reload
sudo systemctl reset-failed
@Mossman1215
Mossman1215 / basic-actions.yml
Last active October 16, 2023 22:08
Hello-world-actions
#put in .github/workflows/
on:
pull_request: {}
workflow_dispatch: {}
push: {}
jobs:
hello:
runs-on: ubuntu-latest
steps:
- name: 'say hello'
@Mossman1215
Mossman1215 / crash.txt
Created October 4, 2023 02:03
snow crash gpu kernel logs
Oct 04 10:07:48 WERK-PUTER.lan kernel: nouveau 0000:02:00.0: Enabling HDA controller
Oct 04 10:47:49 WERK-PUTER.lan kernel: perf: interrupt took too long (2501 > 2500), lowering kernel.perf_event_max_sample_rate to 79000
Oct 04 11:21:21 WERK-PUTER.lan kernel: perf: interrupt took too long (3487 > 3126), lowering kernel.perf_event_max_sample_rate to 57000
Oct 04 12:08:27 WERK-PUTER.lan kernel: nouveau 0000:02:00.0: Enabling HDA controller
Oct 04 12:08:35 WERK-PUTER.lan kernel: [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx_low timeout, signaled seq=1131136, emitted seq=1131138
Oct 04 12:08:35 WERK-PUTER.lan kernel: [drm:amdgpu_job_timedout [amdgpu]] *ERROR* Process information: process firefox pid 5516 thread firefox:cs0 pid 6413
Oct 04 12:08:35 WERK-PUTER.lan kernel: amdgpu 0000:0a:00.0: amdgpu: GPU reset begin!
Oct 04 12:08:35 WERK-PUTER.lan kernel: [drm] psp gfx command UNLOAD_TA(0x2) failed and response status is (0x117)
Oct 04 12:08:35 WERK-PUTER.lan kernel: amdgpu 0000:0a:00.0: amdgpu: BACO reset
Oc
@Mossman1215
Mossman1215 / delete-actions-logs.sh
Created September 11, 2023 22:20
delete actions runs logs
#inspired by https://gist.github.com/gubatron/47552e1bfa345a142b2248be1925efb6#file-delete_github_workflow_run_logs-sh
#!/bin/bash -e
repo=reponame
user=username
WORKFLOW_RUN_IDS=$(gh api /repos/${user}/${repo}/actions/runs?per_page=999 | jq -r ".workflow_runs[] | [.id] | @tsv")
for id in ${WORKFLOW_RUN_IDS}
do
echo "Workflow ID: ${id}"
gh api -X DELETE "/repos/${user}/${repo}/actions/runs/${id}"
@Mossman1215
Mossman1215 / wifiapmikrotik.rsc
Created September 5, 2023 03:40
Mikrotik bridge configuration
/interface bridge
add admin-mac=18:FD:74:4A:9F:43 auto-mac=no comment=defconf name=bridge
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
add authentication-types=wpa2-psk eap-methods="" mode=dynamic-keys name="WIFI SSID" supplicant-identity="" wpa2-pre-shared-key=PASSWORDHERE
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX disabled=no distance=indoors frequency=2447 installation=indoor mode=ap-bridge security-profile="WIFI SSID" ssid=\
@Mossman1215
Mossman1215 / rhel8-puppetserver.dockerfile
Created March 14, 2023 21:55
ubi8 rhel8 puppetserver dockerfile
FROM registry.access.redhat.com/ubi8/ubi
RUN dnf -y update
RUN dnf install -y https://yum.puppet.com/puppet7-release-el-8.noarch.rpm
RUN dnf install -y puppetserver
VOLUME [ "/etc/puppetlabs/" ]
CMD [ "/opt/puppetlabs/bin/puppetserver", "foreground" ]

Keybase proof

I hereby claim:

  • I am mossman1215 on github.
  • I am mossman1215 (https://keybase.io/mossman1215) on keybase.
  • I have a public key ASAuKCd0pltWF-VE_tXaw9zAXOGartSlNO7f3uznOg19Qwo

To claim this, I am signing this object:

#requires pyvips and ruby-image-processing on ubuntu
import pyvips
import argparse
import pathlib
parser = argparse.ArgumentParser(description='resize images ')
parser.add_argument('images', metavar='file', nargs='+',
help='paths to files to shrink')
args = parser.parse_args()
for filepath in args.images:
image = pyvips.Image.new_from_file(filepath, access='sequential')
<?php
namespace SilverStripe\Com\Tasks;
use Psr\Log\LoggerInterface;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\BuildTask;
use SilverStripe\Versioned\Versioned;
use SilverStripe\CMS\Model\SiteTree;
/**
* export site tree for performance testing
@Mossman1215
Mossman1215 / goss.yaml
Last active May 15, 2020 03:58
cwp web server test
port:
tcp:222:
listening: true
ip:
- 0.0.0.0
tcp6:80:
listening: true
ip:
- '::'
tcp6:222: