Skip to content

Instantly share code, notes, and snippets.

@Grayest
Grayest / aks_log_consumption.md
Created May 9, 2024 03:14 — forked from clemlesne/aks_log_consumption.md
Extract Azure Monitor consumption by Azure Kubernetes Service Pod labels

Run this command against your Azure Monitor logs:

ContainerLog
  | where TimeGenerated >= ago(360d)
  | project TimeGenerated, ContainerID, _BilledSize
  | lookup kind=leftouter (
      KubePodInventory
        | where TimeGenerated >= ago(360d)
 | sort by TimeGenerated desc
@Grayest
Grayest / index.js
Created August 16, 2019 04:17 — forked from meldsza/index.js
Pass pm2 logs to discord via webhook
const webhook_uri = "WEBHOOK URL HERE";
const spawn = require('child_process').spawn;
const request = require('request');
var pm2 = false;
let queue = [];
function createChunks(str) {
return str.match(new RegExp('.{1,' + 2000 + '}', 'g'));
}
function send(data) {
@Grayest
Grayest / List.md
Created July 23, 2019 02:56 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

#!/bin/bash
# Volume list file will have volume-id:Volume-name format
VOLUMES_LIST = /var/log/volumes-list
SNAPSHOT_INFO = /var/log/snapshot_info
DATE = `date +%Y-%m-%d`
REGION = “eu-west-1”
# Snapshots Retention Period for each volume snapshot
RETENTION=6
sudo su -s /bin/bash www-data
#!/bin/bash
read -p "Enter your Site Name to be created (include .com):" SITENAME
#1. Create apache2 site and it's folders
mkdir /var/www/html/$SITENAME
mkdir /var/www/html/$SITENAME/public_html/
chmod -R 755 /var/www/html/$SITENAME/public_html/
cat > /etc/apache2/sites-available/$SITENAME.conf << EOF
<VirtualHost *:80>
ServerAdmin admin@$SITENAME
ServerName $SITENAME