This file contains 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
import os | |
from json import dumps | |
from httplib2 import Http | |
import base64 | |
def main(event, context): | |
url = os.environ['WEBHOOK_URL'] | |
bot_message = { | |
'text' : base64.b64decode(event['data']).decode('utf-8')} | |
message_headers = {'Content-Type': 'application/json; charset=UTF-8'} | |
http_obj = Http() |
This file contains 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
#run as root | |
find / -xdev -type f -size +100M -exec du -sh {} ';' | sort -rh | head -n50 |
This file contains 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
sed -i 's/\r$//' filename |
This file contains 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
#install brotli | |
sudo apt-get install brotli | |
#check nginx version | |
nginx -V | |
#download nginx source | |
wget http://nginx.org/download/nginx-1.14.1.tar.gz | |
#extract the source | |
tar -xzvf nginx-1.14.1.tar.gz |
This file contains 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
let start=datetime("2018-10-25T06:00:00.000Z"); | |
let end=datetime("2018-10-25T14:00:00.000Z"); | |
requests | where timestamp > start and timestamp < end | |
| where success == false and resultCode == "500" | |
| where url contains "your_service_path" | |
|join (traces | |
| where message contains "REQUEST: {" | |
) on $left.id == $right.operation_Id |
This file contains 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 | |
t.NAME AS TableName, | |
s.Name AS SchemaName, | |
p.rows AS RowCounts, | |
SUM(a.total_pages) * 8 AS TotalSpaceKB, | |
CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB, | |
SUM(a.used_pages) * 8 AS UsedSpaceKB, | |
CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB, | |
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB, | |
CAST(ROUND(((SUM(a.total_pages) - SUM(a.used_pages)) * 8) / 1024.00, 2) AS NUMERIC(36, 2)) AS UnusedSpaceMB |
This file contains 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
aptitude -F "%c %p %V" --disable-columns search '!~M ~i' | awk -F " " '{ print "apt-get -y install " $2"="$3 }' > aptshell.sh |
This file contains 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
stat -c '%a' file.tx |
This file contains 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
#!/bin/bash | |
#use this to remove older docker images left on CI machine, max_week_size represent the number of weeks that should be kept | |
max_week_size=4 | |
docker images | awk 'NR>1 {print $0}' | while read line; do | |
# echo $line | |
id_img=$(echo $line | awk '{print $3}') | |
# if older then a month | |
is_month=$(echo $line | grep 'month') | |
if [ ! -z "$is_month" ]; then |
This file contains 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
#The command to run, built from the raw link of this gist | |
#START http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/fvztdk/088d0fda0962fcf25d3059bfd6624c5b/raw/d202d5366271c60fe29139df7bf77097e75fa010/boxstarter.txt | |
#Special windowsy stuff. see http://boxstarter.org/WinConfig | |
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtension | |
Disable-BingSearch | |
Update-ExecutionPolicy | |
#utilities | |
cinst jdk8 |
NewerOlder