This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT user_id, | |
| session_id, | |
| min(action_time) AS session_start, | |
| max(action_time) AS session_end, | |
| dateDiff('second', session_start, session_end) AS duration_sec | |
| FROM ( | |
| SELECT user_id, | |
| action_time, | |
| sum(session_gap) OVER (PARTITION BY user_id ORDER BY action_time) AS session_id | |
| FROM ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ################################################################################ | |
| # Important commands | |
| ################################################################################ | |
| # Copy folder/file over SSH | |
| rsync -avz /home/domains/a.com -e "ssh -p 2012" [email protected]:/home/domains/ # --exclude logs/ --exclude cache/cache/ --exclude '*.log' | |
| # Start screen after su to another user | |
| su - someuser | |
| script /dev/null | |
| screen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| noti() { | |
| curl -s -u o.MQHVomYWwYUx0jVBof2d2jL6yQPSACWBt727: -X POST https://api.pushbullet.com/v2/pushes -H 'Content-Type: application/json' --data-binary '{"type": "note", "title": "Note Title", "body": "Note Body"}' > /dev/null | |
| } |