Skip to content

Instantly share code, notes, and snippets.

View mpolinowski's full-sized avatar
👉
[object Object]

Mike Polinowski mpolinowski

👉
[object Object]
View GitHub Profile
// change your piwik server host
// change YOUR_SITE_ID with your site id
<amp-pixel src="https://piwik.example.org/piwik.php?idsite=YOUR_SITE_ID&rec=1&action_name=TITLE&urlref=DOCUMENT_REFERRER&url=CANONICAL_URL&rand=RANDOM"></amp-pixel>
@mpolinowski
mpolinowski / gist:be444c52280598752a408b9e9b3de123
Created October 26, 2017 12:28
React — Dynamic Component Names with JSX
import React from 'react'
import Layout from '../components/layout'
import Products from '../components/_products'
import IndoorCameras from '../components/_indoorCameras'
import OutdoorCameras from '../components/_outdoorCameras'
class InstarProducts extends Component {
components = {
products: Products,
@mpolinowski
mpolinowski / gist:94a2e4b1120eeb56c056ba40532bd7ff
Created March 30, 2018 06:12
Using fade-in Animation in Glamor
let fadein = css.keyframes({
'0%': { opacity: 0 },
'100%': { opacity: 1 }
})
let lazyload = css({
animation: `${fadein} 2s`,
})
@mpolinowski
mpolinowski / NGINX Config IPv6 Issue
Created April 1, 2018 09:31
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Error Message:
```
Redirecting to /bin/systemctl status -l nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2018-03-31 15:54:13 CEST; 16h ago
Process: 18761 ExecReload=/bin/kill -s HUP $MAINPID (code=exited, status=0/SUCCESS)
Process: 13076 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
Process: 13072 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
@mpolinowski
mpolinowski / certbot-systemd-nginx.md
Last active January 17, 2021 09:34
Certbot: Hook command "service nginx start" returned error code 1

PROBLEM: Certbot renews NGINX SSL certificate but fails to restart the NGINX service on CentOS:

Running post-hook command: service nginx start
Hook command "service nginx start" returned error code 1
Error output from service:
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

1 renew failure(s), 0 parse failure(s)
@mpolinowski
mpolinowski / certbot-systemd-nginx.md
Created March 5, 2019 14:17
NGINX Certbot certificate renewal with SystemD (Let's Encrypt)

Create a service unit file

$ nano /etc/systemd/system/certbot-renewal.service
[Unit]
@mpolinowski
mpolinowski / certbot.md
Created May 4, 2019 10:41
Manual renew certificate with Certbot / Let's Encrypt (NGINX Plugin)

An issue with one of the domains on the server prevents the cert update/renewal :

certbot renew

ERROR

Cert is due for renewal, auto-renewing...

Uninstall Kubernetes from Centos 7

kubectl drain \<node name\> --delete-local-data --force --ignore-daemonsets

kubectl delete node \<node name\>
This file has been truncated, but you can view the full file.
2019-06-17 12:14:39.661 [ERROR] [org.eclipse.smarthome.core ] - bundle org.eclipse.smarthome.core:0.11.0.oh250M1 (102)[org.eclipse.smarthome.core.internal.scheduler.PeriodicSchedulerImpl(65)] : doFindMethod: Suitable but non-accessible method found in class org.eclipse.smarthome.core.internal.scheduler.PeriodicSchedulerImpl
2019-06-17 12:14:39.691 [ERROR] [org.eclipse.smarthome.core ] - bundle org.eclipse.smarthome.core:0.11.0.oh250M1 (102)[org.eclipse.smarthome.core.internal.scheduler.PeriodicSchedulerImpl(65)] : findMethod: Suitable but non-accessible method setScheduler found in class org.eclipse.smarthome.core.internal.scheduler.PeriodicSchedulerImpl, subclass of org.eclipse.smarthome.core.internal.scheduler.PeriodicSchedulerImpl
2019-06-17 12:14:39.694 [ERROR] [org.eclipse.smarthome.core ] - bundle org.eclipse.smarthome.core:0.11.0.oh250M1 (102)[org.eclipse.smarthome.core.internal.scheduler.PeriodicSchedulerImpl(65)] : bind method [setScheduler] not found; Component will fail
2
2019-06-17 12:14:55.358 [.ItemChannelLinkAddedEvent] - Link 'INSTARHDIPCameraWithONVIFAndAPISupport_Pan-ipcamera:INSTAR:14e0df61:pan' has been added.
2019-06-17 12:14:55.361 [.ItemChannelLinkAddedEvent] - Link 'INSTARHDIPCameraWithONVIFAndAPISupport_ThresholdForTheAudioAlarm-ipcamera:INSTAR:1779690a:thresholdAudioAlarm' has been added.
2019-06-17 12:14:55.371 [.ItemChannelLinkAddedEvent] - Link 'INSTARHDIPCameraWithONVIFAndAPISupport_SnapshotFromCamera-ipcamera:INSTAR:834b227a:image' has been added.
2019-06-17 12:14:55.380 [.ItemChannelLinkAddedEvent] - Link 'AlarmAreasIN8015_AlarmAreas-mqtt:topic:8015-alarm-areas:OfficeCam' has been added.
2019-06-17 12:14:55.382 [.ItemChannelLinkAddedEvent] - Link 'IN9020FullHD_RTSPURL-ipcamera:INSTAR:eb0d50e2:rtspUrl' has been added.
2019-06-17 12:14:55.385 [.ItemChannelLinkAddedEvent] - Link 'test-ipcamera:INSTAR:eb0d50e2:enableMotionAlarm' has been added.
2019-06-17 12:14:55.387 [.ItemChannelLinkAddedEvent] - Link 'Test_Pan-ipcamera:INSTAR:a339f440:pan' has been added.
2