- Save bash script to
/usr/local/bin/update-service-accounts.sh
- Save systemd file to
/etc/systemd/system/update-service-accounts.service
Enable the service:
# Reload systemd to pick up the new service
sudo systemctl daemon-reload
#------------------------------------------------------------------------------------------------------------------- | |
# Keep this section in sync with .gitignore | |
#------------------------------------------------------------------------------------------------------------------- | |
# Logs | |
*.log | |
npm-debug.log* | |
yarn-debug.log* | |
yarn-error.log* |
const crypto = require('crypto'); | |
const decToHex = (dec) => dec.toString(16); | |
const hexToDec = (hex) => parseInt(hex, 16); | |
const base32chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'; | |
const base32ToHex = (base32) => { | |
const bits = base32 | |
.split('') | |
.map((char) => { |
{ | |
"pure": { | |
"scope": "javascript,typescript,javascriptreact,typescriptreact", | |
"prefix": "filename", | |
"body": [ | |
"${1:$TM_FILENAME_BASE}", | |
], | |
"description": "Get current filename" | |
} | |
} |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
const cc = (prefix, suffix) => { | |
return prefix + suffix[0].toUpperCase() + suffix.slice(1); | |
}; | |
const makeStateNode = (events) => ({ | |
on: { ...events, logout: 'logout' }, | |
}); | |
const makeError = (next) => { |
const useSafeState = (initialState) => { | |
const [state, unsafeSetState] = useState(initialState); | |
const unmounted = useRef(false); | |
useEffect( | |
() => () => { | |
unmounted.current = true; | |
}, | |
[] |
const useResponsiveCanvas = (cb) => { | |
const [width, setWidth] = useState(false); | |
const [measureEl, setMeasureEl] = useState(null); | |
const [canvasEl, setCanvasEl] = useState(null); | |
const draw = useCallback(() => { | |
if (!canvasEl || !measureEl) { | |
return; | |
} | |
const w = measureEl.offsetWidth; |
const useResize = (cb) => { | |
useEffect(() => { | |
window.addEventListener('resize', cb); | |
return () => { | |
window.removeEventListener('resize', cb); | |
}; | |
}, [cb]); | |
}; |
const useResponsiveClientRect = () => { | |
const [rect, setRect] = useState(null); | |
const ref = useRef(); | |
const measure = useMemo( | |
() => () => { | |
if (ref.current) { | |
setRect(ref.current.getBoundingClientRect()); | |
} | |
}, | |
[] |