Skip to content

Instantly share code, notes, and snippets.

@rawdatalab
rawdatalab / stillalive.rc
Created April 11, 2019 17:42
STILL ALIVE as a Bash script with beep (didn't create, just sharing)
# Let 'em know that we're Still Alive
# http://pastebin.com/f72f8f72d (no longer valid)
#!/bin/bash
echo -n "This "
beep -f 784 -l 200
echo -n "was "
beep -f 740 -l 200
echo -n "a "
beep -f 659 -l 200
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@pepoviola
pepoviola / key_to_json
Last active April 4, 2024 03:56
convert new lines into \n for use ssh key in json
sed ':a;N;$!ba;s/\n/\\n/g' my_key.pem
or in vi
:%s/\n/\\n/
https://tickets.opscode.com/browse/CHEF-3540