Simple online editor for javascript
Just paste it into navigation bar:
1 |
data:text/html, <html><script>window.onbeforeunload = window.onunload = function(){return 'Confirm page reload';};</script><body><button onclick="console.log(eval(document.querySelector('textarea').value.replace('<div>', '\n').replace('</div>', '\n')))">run</button><br><textarea style="width:600px;height:400px"></textarea></body><script>document.querySelector('textarea').focus();</script> |
It just outputs the result into console when you click run button. It’s simple and works. Because sometimes you just don’t need monsters like jsfiddle or jsbin.
How to setup mac time machine on synology nas
In russian, sorry. https://www.synology.com/ru-ru/knowledgebase/DSM/tutorial/Backup_Restore/How_to_back_up_files_from_Mac_to_Synology_NAS_with_Time_Machine
Pipeline view in shell
1 |
tail -f /var/log/nginx/access.log | pv --line-mode --rate > /dev/null |
https://serverfault.com/questions/473905/is-there-a-unix-linux-command-to-count-lines-per-second-from-stdin
grep, zgrep, less and zless regexp examples
Grep all files with mask:
1 |
grep "regex to find" /var/log/lb-*.net/nginx/error.log |
Grep all zipped files with mask:
1 |
zgrep "regex to find" /var/remote-log/nodejs-1*.net/node/error.log.* |
Less all files with mask:
1 |
less /var/log/lb-*.net/nginx/error.log |
Grep all zipped files with mask:
1 |
zless /var/remote-log/nodejs-1*.net/node/error.log.* |
Tail all files with mask:
1 |
tail -f /var/log/lb-*.net/nginx/error.log |
Search for occurencies in directory with grep
1 |
grep -rnw '/path/to/somewhere/' -e 'pattern' |
https://stackoverflow.com/questions/16956810/how-do-i-find-all-files-containing-specific-text-on-linux
Storybook for creating components library
It works with all popular frameworks like React, Angular, Vue, and others. https://github.com/storybooks/storybook
BackBeat Pro not charging. Fix
Once I’ve run into a problem with my lovely Plantronics BackBeat Pro. It decided not to charge with any given cable or power source. It just didn’t react on plugged in a cable, while blinking with red lamp saying that it needs to be charged. After googling and dancing around it, I’ve found a solution: …
Free smart TV channels
Install this application on your TV http://forkplayer.tv/smart-tv/forkplayer/#install. After that start the application, open SMILE BY → Onliner → SEGAZ → IPTV → OnlyBest.
git squash variants
If you just want to squash all commits into one. 1. The simplest way:
1 2 3 4 |
git checkout -b <temp-branch> origin/master git merge --squash origin/<branch-with-changes-you-need> git commit -m 'commit message' git push origin refs/heads/<temp-branch>:<new-branch> |
https://stackoverflow.com/a/5309051 If you have a message like ‘error: failed to push some refs to’, add —force to the last command.
Check ssl certificates on a host
1 |
openssl s_client -connect your-host:443 |
If it says something like gethostbyname failure then try following. It needs socat, which can be installed on macOs like this — brew install socat. Then in one terminal open
1 |
socat TCP4-LISTEN:10443,fork TCP6:your-host:443 |
and in another terminal:
1 |
openssl s_client -crlf -connect 127.0.0.1:10443 |